Mercurial > pidgin
comparison libpurple/protocols/irc/msgs.c @ 15439:8ff4af28c9f9
Recognize non-standard mode characters communicated in an 005 numeric for IRC
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 28 Jan 2007 06:31:19 +0000 |
parents | 21bc8d84974f |
children | 8c81db398f56 |
comparison
equal
deleted
inserted
replaced
15438:a415922e2882 | 15439:8ff4af28c9f9 |
---|---|
38 | 38 |
39 static void irc_msg_handle_privmsg(struct irc_conn *irc, const char *name, | 39 static void irc_msg_handle_privmsg(struct irc_conn *irc, const char *name, |
40 const char *from, const char *to, | 40 const char *from, const char *to, |
41 const char *rawmsg, gboolean notice); | 41 const char *rawmsg, gboolean notice); |
42 | 42 |
43 static char *mode_chars = NULL; | |
44 | |
43 static char *irc_mask_nick(const char *mask) | 45 static char *irc_mask_nick(const char *mask) |
44 { | 46 { |
45 char *end, *buf; | 47 char *end, *buf; |
46 | 48 |
47 end = strchr(mask, '!'); | 49 end = strchr(mask, '!'); |
71 } | 73 } |
72 | 74 |
73 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args) | 75 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args) |
74 { | 76 { |
75 gaim_debug(GAIM_DEBUG_INFO, "irc", "Unrecognized message: %s\n", args[0]); | 77 gaim_debug(GAIM_DEBUG_INFO, "irc", "Unrecognized message: %s\n", args[0]); |
78 } | |
79 | |
80 void irc_msg_features(struct irc_conn *irc, const char *name, const char *from, char **args) | |
81 { | |
82 gchar **features; | |
83 int i; | |
84 | |
85 if (!args || !args[0] || !args[1]) | |
86 return; | |
87 | |
88 features = g_strsplit(args[1], " ", -1); | |
89 for (i = 0; features[i]; i++) { | |
90 char *val; | |
91 if (!strncmp(features[i], "PREFIX=", 7)) { | |
92 if ((val = strchr(features[i] + 7, ')')) != NULL) | |
93 mode_chars = g_strdup(val + 1); | |
94 } | |
95 } | |
76 } | 96 } |
77 | 97 |
78 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args) | 98 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args) |
79 { | 99 { |
80 GaimConnection *gc; | 100 GaimConnection *gc; |
405 } else if (*cur == '%') { | 425 } else if (*cur == '%') { |
406 f = GAIM_CBFLAGS_HALFOP; | 426 f = GAIM_CBFLAGS_HALFOP; |
407 cur++; | 427 cur++; |
408 } else if(*cur == '+') { | 428 } else if(*cur == '+') { |
409 f = GAIM_CBFLAGS_VOICE; | 429 f = GAIM_CBFLAGS_VOICE; |
430 cur++; | |
431 } else if(mode_chars | |
432 && strchr(mode_chars, *cur)) { | |
410 cur++; | 433 cur++; |
411 } | 434 } |
412 tmp = g_strndup(cur, end - cur); | 435 tmp = g_strndup(cur, end - cur); |
413 users = g_list_prepend(users, tmp); | 436 users = g_list_prepend(users, tmp); |
414 flags = g_list_prepend(flags, GINT_TO_POINTER(f)); | 437 flags = g_list_prepend(flags, GINT_TO_POINTER(f)); |