diff options
author | Timo Sirainen <cras@irssi.org> | 2004-01-20 10:57:57 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-01-20 10:57:57 +0000 |
commit | 217283caeaf5fc19e671a56547610ceb42e2ea7b (patch) | |
tree | 7f2fa9d29fdd2d9bb9f7782f1c928a53cebe70d2 /src/core | |
parent | 3ccbd0405b8d3185a143c150a5b42070403fdc36 (diff) | |
download | irssi-217283caeaf5fc19e671a56547610ceb42e2ea7b.zip |
isupport patch by David Leadbeater
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3211 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/channels.c | 4 | ||||
-rw-r--r-- | src/core/chat-commands.c | 3 | ||||
-rw-r--r-- | src/core/nick-rec.h | 1 | ||||
-rw-r--r-- | src/core/nicklist.c | 9 | ||||
-rw-r--r-- | src/core/server-rec.h | 4 | ||||
-rw-r--r-- | src/core/session.c | 5 |
6 files changed, 18 insertions, 8 deletions
diff --git a/src/core/channels.c b/src/core/channels.c index 9a92b896..08142f8b 100644 --- a/src/core/channels.c +++ b/src/core/channels.c @@ -219,7 +219,7 @@ static void event_connected(SERVER_REC *server) static int match_nick_flags(SERVER_REC *server, NICK_REC *nick, char flag) { - const char *flags = server->get_nick_flags(); + const char *flags = server->get_nick_flags(server); return strchr(flags, flag) == NULL || (flag == flags[0] && nick->op) || @@ -259,7 +259,7 @@ void channel_send_autocommands(CHANNEL_REC *channel) continue; nick = nicklist_find_mask(channel, - channel->server->isnickflag(*botnick) ? + channel->server->isnickflag(channel->server, *botnick) ? botnick+1 : botnick); if (nick != NULL && match_nick_flags(channel->server, nick, *botnick)) { diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index e991f6fc..f3197520 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -345,7 +345,7 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) GHashTable *optlist; char *target, *origtarget, *msg; void *free_arg; - int free_ret, target_type; + int free_ret, target_type = SEND_TARGET_NICK; g_return_if_fail(data != NULL); @@ -398,7 +398,6 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) if (target != NULL) server->send_message(server, target, msg, target_type); - signal_emit(target != NULL && target_type == SEND_TARGET_CHANNEL ? "message own_public" : "message own_private", 4, server, msg, target, origtarget); diff --git a/src/core/nick-rec.h b/src/core/nick-rec.h index d0dbce3d..8e641222 100644 --- a/src/core/nick-rec.h +++ b/src/core/nick-rec.h @@ -19,6 +19,7 @@ unsigned int send_massjoin:1; /* Waiting to be sent in massjoin signal */ unsigned int op:1; unsigned int halfop:1; unsigned int voice:1; +unsigned int other:7; /*GHashTable *module_data;*/ diff --git a/src/core/nicklist.c b/src/core/nicklist.c index 7b97cb8e..3d557987 100644 --- a/src/core/nicklist.c +++ b/src/core/nicklist.c @@ -369,7 +369,10 @@ int nicklist_compare(NICK_REC *p1, NICK_REC *p2) * returns :-) * -- yath */ - if (p1->op) + /* Treat others as highest - should really use order in 005 numeric */ + if (p1->other) + status1 = 5; + else if (p1->op) status1 = 4; else if (p1->halfop) status1 = 3; @@ -378,7 +381,9 @@ int nicklist_compare(NICK_REC *p1, NICK_REC *p2) else status1 = 1; - if (p2->op) + if (p2->other) + status2 = 5; + else if (p2->op) status2 = 4; else if (p2->halfop) status2 = 3; diff --git a/src/core/server-rec.h b/src/core/server-rec.h index 0003f698..bc8124dc 100644 --- a/src/core/server-rec.h +++ b/src/core/server-rec.h @@ -53,12 +53,12 @@ GSList *queries; channel keys etc. */ void (*channels_join)(SERVER_REC *server, const char *data, int automatic); /* returns true if `flag' indicates a nick flag (op/voice/halfop) */ -int (*isnickflag)(char flag); +int (*isnickflag)(SERVER_REC *server, char flag); /* returns true if `data' indicates a channel */ int (*ischannel)(SERVER_REC *server, const char *data); /* returns all nick flag characters in order op, voice, halfop. If some of them aren't supported '\0' can be used. */ -const char *(*get_nick_flags)(void); +const char *(*get_nick_flags)(SERVER_REC *server); /* send public or private message to server */ void (*send_message)(SERVER_REC *server, const char *target, const char *msg, int target_type); diff --git a/src/core/session.c b/src/core/session.c index ec589d70..2355df78 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -118,12 +118,17 @@ static void cmd_upgrade(const char *data) static void session_save_nick(CHANNEL_REC *channel, NICK_REC *nick, CONFIG_REC *config, CONFIG_NODE *node) { + static char other[2]; node = config_node_section(node, NULL, NODE_TYPE_BLOCK); config_node_set_str(config, node, "nick", nick->nick); config_node_set_bool(config, node, "op", nick->op); config_node_set_bool(config, node, "halfop", nick->halfop); config_node_set_bool(config, node, "voice", nick->voice); + + other[0] = nick->other; + other[1] = '\0'; + config_node_set_str(config, node, "other", other); signal_emit("session save nick", 4, channel, nick, config, node); } |