mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
Channel mode handling changed - there's no more mode_xxx fields in
channel structure, but instead just one mode string field. Also handling half-ops (+h) should work right. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@617 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
7cbd164e75
commit
67cc9af1bd
15 changed files with 351 additions and 232 deletions
|
|
@ -4,8 +4,21 @@
|
|||
#include "server.h"
|
||||
#include "channels.h"
|
||||
|
||||
#define HAS_MODE_ARG(c) ((c) == 'b' || (c) == 'e' || (c) == 'I' || \
|
||||
(c) == 'v' || (c) == 'o' || (c) == 'l' || (c) == 'k')
|
||||
/* modes that have argument always */
|
||||
#define HAS_MODE_ARG_ALWAYS(mode) \
|
||||
((mode) == 'b' || (mode) == 'e' || (mode) == 'I' || \
|
||||
(mode) == 'o' || (mode) == 'h' || (mode) == 'v' || (mode) == 'k')
|
||||
|
||||
/* modes that have argument when being set (+) */
|
||||
#define HAS_MODE_ARG_SET(mode) \
|
||||
(HAS_MODE_ARG_ALWAYS(mode) || (mode) == 'l')
|
||||
|
||||
/* modes that have argument when being unset (-) */
|
||||
#define HAS_MODE_ARG_UNSET(mode) \
|
||||
HAS_MODE_ARG_ALWAYS(mode)
|
||||
|
||||
#define HAS_MODE_ARG(type, mode) \
|
||||
((type) == '+' ? HAS_MODE_ARG_SET(mode) : HAS_MODE_ARG_UNSET(mode))
|
||||
|
||||
void modes_init(void);
|
||||
void modes_deinit(void);
|
||||
|
|
@ -13,9 +26,14 @@ void modes_deinit(void);
|
|||
/* add `mode' to `old' - return newly allocated mode. */
|
||||
char *modes_join(const char *old, const char *mode);
|
||||
|
||||
void parse_channel_modes(CHANNEL_REC *channel, const char *setby, const char *modestr);
|
||||
int channel_mode_is_set(CHANNEL_REC *channel, char mode);
|
||||
|
||||
void channel_set_singlemode(IRC_SERVER_REC *server, const char *channel, const char *nicks, const char *mode);
|
||||
void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *mode);
|
||||
void parse_channel_modes(CHANNEL_REC *channel, const char *setby,
|
||||
const char *modestr);
|
||||
|
||||
void channel_set_singlemode(IRC_SERVER_REC *server, const char *channel,
|
||||
const char *nicks, const char *mode);
|
||||
void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
|
||||
const char *mode);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue