isupport patch by David Leadbeater

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3211 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2004-01-20 10:57:57 +00:00 committed by cras
commit 217283caea
30 changed files with 520 additions and 133 deletions

View file

@ -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)) {

View file

@ -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);

View file

@ -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;*/

View file

@ -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;

View file

@ -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);

View file

@ -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);
}