Tue, 07 Apr 2020 02:27:08 -0500
Move the mood api to it's own files and remove the remaining bits of the old menu bar from gtkblist
| 6333 | 1 | /** |
| 15884 | 2 | * purple |
| 6333 | 3 | * |
| 4 | * Copyright (C) 2003, Ethan Blanton <eblanton@cs.purdue.edu> | |
| 8351 | 5 | * |
| 6333 | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17409
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 6333 | 19 | */ |
| 20 | ||
| 21 | #include "internal.h" | |
|
39961
d508d5b5dd22
Update the irc prpl to only use purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
39589
diff
changeset
|
22 | #include <purple.h> |
| 6333 | 23 | |
| 24 | #include "irc.h" | |
| 25 | ||
| 26 | #include <stdio.h> | |
| 27 | #include <stdlib.h> | |
| 28 | #include <ctype.h> | |
| 29 | ||
|
36663
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
30 | static GSList *cmds = NULL; |
|
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
31 | |
| 6333 | 32 | static char *irc_send_convert(struct irc_conn *irc, const char *string); |
| 33 | static char *irc_recv_convert(struct irc_conn *irc, const char *string); | |
| 34 | ||
| 35 | static void irc_parse_error_cb(struct irc_conn *irc, char *input); | |
| 36 | ||
| 37 | static char *irc_mirc_colors[16] = { | |
| 38 | "white", "black", "blue", "dark green", "red", "brown", "purple", | |
| 39 | "orange", "yellow", "green", "teal", "cyan", "light blue", | |
| 40 | "pink", "grey", "light grey" }; | |
| 41 | ||
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36520
diff
changeset
|
42 | extern PurpleProtocol *_irc_protocol; |
| 14683 | 43 | |
| 6333 | 44 | /*typedef void (*IRCMsgCallback)(struct irc_conn *irc, char *from, char *name, char **args);*/ |
| 45 | static struct _irc_msg { | |
| 46 | char *name; | |
| 47 | char *format; | |
|
35253
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
48 | |
|
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
49 | /** The required parameter count, based on values we use, not protocol |
|
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
50 | * specification. */ |
|
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
51 | int req_cnt; |
|
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
52 | |
| 6333 | 53 | void (*cb)(struct irc_conn *irc, const char *name, const char *from, char **args); |
| 54 | } _irc_msgs[] = { | |
|
35250
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
55 | { "005", "n*", 2, irc_msg_features }, /* Feature list */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
56 | { "251", "n:", 1, irc_msg_luser }, /* Client & Server count */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
57 | { "255", "n:", 1, irc_msg_luser }, /* Client & Server count Mk. II */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
58 | { "301", "nn:", 3, irc_msg_away }, /* User is away */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
59 | { "303", "n:", 2, irc_msg_ison }, /* ISON reply */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
60 | { "311", "nnvvv:", 6, irc_msg_whois }, /* Whois user */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
61 | { "312", "nnv:", 4, irc_msg_whois }, /* Whois server */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
62 | { "313", "nn:", 2, irc_msg_whois }, /* Whois ircop */ |
| 39589 | 63 | { "314", "nnnvv:", 6, irc_msg_whois }, /* Whowas user */ |
| 64 | { "315", "nt:", 0, irc_msg_who }, /* end of WHO channel */ | |
|
35272
d33c29cda7bb
I think 317 actually only requires 3 args. I think the fourth is optional.
Mark Doliner <mark@kingant.net>
parents:
35253
diff
changeset
|
65 | { "317", "nnvv", 3, irc_msg_whois }, /* Whois idle */ |
|
35250
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
66 | { "318", "nt:", 2, irc_msg_endwhois }, /* End of WHOIS */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
67 | { "319", "nn:", 3, irc_msg_whois }, /* Whois channels */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
68 | { "320", "nn:", 2, irc_msg_whois }, /* Whois (fn ident) */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
69 | { "321", "*", 0, irc_msg_list }, /* Start of list */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
70 | { "322", "ncv:", 4, irc_msg_list }, /* List. */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
71 | { "323", ":", 0, irc_msg_list }, /* End of list. */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
72 | { "324", "ncv:", 3, irc_msg_chanmode }, /* Channel modes */ |
| 39589 | 73 | { "330", "nnv:", 4, irc_msg_whois }, /* Whois (fn login) */ |
|
35248
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
74 | { "331", "nc:", 3, irc_msg_topic }, /* No channel topic */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
75 | { "332", "nc:", 3, irc_msg_topic }, /* Channel topic */ |
|
35250
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
76 | { "333", "ncvv", 4, irc_msg_topicinfo }, /* Topic setter stuff */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
77 | { "352", "ncvvvnv:", 8, irc_msg_who }, /* Channel WHO */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
78 | { "353", "nvc:", 4, irc_msg_names }, /* Names list */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
79 | { "366", "nc:", 2, irc_msg_names }, /* End of names */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
80 | { "367", "ncnnv", 3, irc_msg_ban }, /* Ban list */ |
|
6b0e0566af20
IRC: fill required command parameter counts (part 3)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35249
diff
changeset
|
81 | { "368", "nc:", 2, irc_msg_ban }, /* End of ban list */ |
| 39589 | 82 | { "369", "nt:", 2, irc_msg_endwhois }, /* End of WHOWAS */ |
|
35249
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
83 | { "372", "n:", 1, irc_msg_motd }, /* MOTD */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
84 | { "375", "n:", 1, irc_msg_motd }, /* Start MOTD */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
85 | { "376", "n:", 1, irc_msg_motd }, /* End of MOTD */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
86 | { "391", "nv:", 3, irc_msg_time }, /* Time reply */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
87 | { "401", "nt:", 2, irc_msg_nonick }, /* No such nick/chan */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
88 | { "403", "nc:", 2, irc_msg_nochan }, /* No such channel */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
89 | { "404", "nt:", 3, irc_msg_nosend }, /* Cannot send to chan */ |
| 39589 | 90 | { "406", "nt:", 2, irc_msg_nonick }, /* No such nick for WHOWAS */ |
|
35249
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
91 | { "421", "nv:", 2, irc_msg_unknown }, /* Unknown command */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
92 | { "422", "n:", 1, irc_msg_motd }, /* MOTD file missing */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
93 | { "432", "vn:", 0, irc_msg_badnick }, /* Erroneous nickname */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
94 | { "433", "vn:", 2, irc_msg_nickused }, /* Nickname already in use */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
95 | { "437", "nc:", 2, irc_msg_unavailable }, /* Nick/channel is unavailable */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
96 | { "438", "nn:", 3, irc_msg_nochangenick }, /* Nick may not change */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
97 | { "442", "nc:", 3, irc_msg_notinchan }, /* Not in channel */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
98 | { "473", "nc:", 2, irc_msg_inviteonly }, /* Tried to join invite-only */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
99 | { "474", "nc:", 2, irc_msg_banned }, /* Banned from channel */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
100 | { "477", "nc:", 3, irc_msg_regonly }, /* Registration Required */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
101 | { "478", "nct:", 3, irc_msg_banfull }, /* Banlist is full */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
102 | { "482", "nc:", 3, irc_msg_notop }, /* Need to be op to do that */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
103 | { "501", "n:", 2, irc_msg_badmode }, /* Unknown mode flag */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
104 | { "506", "nc:", 3, irc_msg_nosend }, /* Must identify to send */ |
|
5845d9fa7084
IRC: fill required command parameter counts (part 2)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35248
diff
changeset
|
105 | { "515", "nc:", 3, irc_msg_regonly }, /* Registration required */ |
|
33404
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
106 | #ifdef HAVE_CYRUS_SASL |
|
35248
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
107 | { "903", "*", 0, irc_msg_authok}, /* SASL auth successful */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
108 | { "904", "*", 0, irc_msg_authtryagain }, /* SASL auth failed, can recover*/ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
109 | { "905", "*", 0, irc_msg_authfail }, /* SASL auth failed */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
110 | { "906", "*", 0, irc_msg_authfail }, /* SASL auth failed */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
111 | { "907", "*", 0, irc_msg_authfail }, /* SASL auth failed */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
112 | { "cap", "vv:", 3, irc_msg_cap }, /* SASL capable */ |
|
38908
86e7c9ca0bcd
irc: handle AUTHENTICATE as a normal command with server prefix
dx <dx@dxzone.com.ar>
parents:
38907
diff
changeset
|
113 | { "authenticate", ":", 1, irc_msg_authenticate }, /* SASL authenticate */ |
|
33404
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
114 | #endif |
|
35248
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
115 | { "invite", "n:", 2, irc_msg_invite }, /* Invited */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
116 | { "join", ":", 1, irc_msg_join }, /* Joined a channel */ |
|
35253
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
117 | { "kick", "cn:", 3, irc_msg_kick }, /* KICK */ |
|
35248
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
118 | { "mode", "tv:", 2, irc_msg_mode }, /* MODE for channel */ |
|
35253
4d9be297d399
Fill in req_cnt for irc_msg_kick and irc_msg_nick.
Mark Doliner <mark@kingant.net>
parents:
35250
diff
changeset
|
119 | { "nick", ":", 1, irc_msg_nick }, /* Nick change */ |
|
35248
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
120 | { "notice", "t:", 2, irc_msg_notice }, /* NOTICE recv */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
121 | { "part", "c:", 1, irc_msg_part }, /* Parted a channel */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
122 | { "ping", ":", 1, irc_msg_ping }, /* Received PING from server */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
123 | { "pong", "v:", 2, irc_msg_pong }, /* Received PONG from server */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
124 | { "privmsg", "t:", 2, irc_msg_privmsg }, /* Received private message */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
125 | { "topic", "c:", 2, irc_msg_topic }, /* TOPIC command */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
126 | { "quit", ":", 1, irc_msg_quit }, /* QUIT notice */ |
|
9f132a6855cd
IRC: fill required command parameter counts (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35245
diff
changeset
|
127 | { "wallops", ":", 1, irc_msg_wallops }, /* WALLOPS command */ |
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
128 | { NULL, NULL, 0, NULL } |
| 6333 | 129 | }; |
| 130 | ||
| 131 | static struct _irc_user_cmd { | |
| 132 | char *name; | |
| 133 | char *format; | |
| 134 | IRCCmdCallback cb; | |
| 9255 | 135 | char *help; |
| 6333 | 136 | } _irc_cmds[] = { |
| 9255 | 137 | { "action", ":", irc_cmd_ctcp_action, N_("action <action to perform>: Perform an action.") }, |
|
31651
24e136c4c399
Add authserv support to IRC. Need a name to credit tomos with. Fixes #13337.
Tomos Lelong <lelongt@gmail.com>
parents:
31565
diff
changeset
|
138 | { "authserv", ":", irc_cmd_service, N_("authserv: Send a command to authserv") }, |
| 9255 | 139 | { "away", ":", irc_cmd_away, N_("away [message]: Set an away message, or use no message to return from being away.") }, |
|
23895
4d883627111f
/ctcp command for IRC
Vladislav Guberinic <neosisani@gmail.com>
parents:
23532
diff
changeset
|
140 | { "ctcp", "t:", irc_cmd_ctcp, N_("ctcp <nick> <msg>: sends ctcp msg to nick.") }, |
| 12013 | 141 | { "chanserv", ":", irc_cmd_service, N_("chanserv: Send a command to chanserv") }, |
| 9258 | 142 | { "deop", ":", irc_cmd_op, N_("deop <nick1> [nick2] ...: Remove channel operator status from someone. You must be a channel operator to do this.") }, |
| 143 | { "devoice", ":", irc_cmd_op, N_("devoice <nick1> [nick2] ...: Remove channel voice status from someone, preventing them from speaking if the channel is moderated (+m). You must be a channel operator to do this.") }, | |
| 144 | { "invite", ":", irc_cmd_invite, N_("invite <nick> [room]: Invite someone to join you in the specified channel, or the current channel.") }, | |
| 9266 | 145 | { "j", "cv", irc_cmd_join, N_("j <room1>[,room2][,...] [key1[,key2][,...]]: Enter one or more channels, optionally providing a channel key for each if needed.") }, |
| 146 | { "join", "cv", irc_cmd_join, N_("join <room1>[,room2][,...] [key1[,key2][,...]]: Enter one or more channels, optionally providing a channel key for each if needed.") }, | |
| 9258 | 147 | { "kick", "n:", irc_cmd_kick, N_("kick <nick> [message]: Remove someone from a channel. You must be a channel operator to do this.") }, |
| 148 | { "list", ":", irc_cmd_list, N_("list: Display a list of chat rooms on the network. <i>Warning, some servers may disconnect you upon doing this.</i>") }, | |
| 9255 | 149 | { "me", ":", irc_cmd_ctcp_action, N_("me <action to perform>: Perform an action.") }, |
| 12013 | 150 | { "memoserv", ":", irc_cmd_service, N_("memoserv: Send a command to memoserv") }, |
|
10609
170a5af61448
[gaim-migrate @ 12055]
Richard Laager <rlaager@pidgin.im>
parents:
10564
diff
changeset
|
151 | { "mode", ":", irc_cmd_mode, N_("mode <+|-><A-Za-z> <nick|channel>: Set or unset a channel or user mode.") }, |
| 9258 | 152 | { "msg", "t:", irc_cmd_privmsg, N_("msg <nick> <message>: Send a private message to a user (as opposed to a channel).") }, |
| 153 | { "names", "c", irc_cmd_names, N_("names [channel]: List the users currently in a channel.") }, | |
| 9274 | 154 | { "nick", "n", irc_cmd_nick, N_("nick <new nickname>: Change your nickname.") }, |
| 12013 | 155 | { "nickserv", ":", irc_cmd_service, N_("nickserv: Send a command to nickserv") }, |
|
22092
52c00ca73f6f
Added /notice support for IRC. If I didn't do this properly, feel free
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
156 | { "notice", "t:", irc_cmd_privmsg, N_("notice <target<: Send a notice to a user or channel.") }, |
| 9258 | 157 | { "op", ":", irc_cmd_op, N_("op <nick1> [nick2] ...: Grant channel operator status to someone. You must be a channel operator to do this.") }, |
| 9255 | 158 | { "operwall", ":", irc_cmd_wallops, N_("operwall <message>: If you don't know what this is, you probably can't use it.") }, |
| 12013 | 159 | { "operserv", ":", irc_cmd_service, N_("operserv: Send a command to operserv") }, |
| 9258 | 160 | { "part", "c:", irc_cmd_part, N_("part [room] [message]: Leave the current channel, or a specified channel, with an optional message.") }, |
| 9255 | 161 | { "ping", "n", irc_cmd_ping, N_("ping [nick]: Asks how much lag a user (or the server if no user specified) has.") }, |
| 9258 | 162 | { "query", "n:", irc_cmd_query, N_("query <nick> <message>: Send a private message to a user (as opposed to a channel).") }, |
| 9255 | 163 | { "quit", ":", irc_cmd_quit, N_("quit [message]: Disconnect from the server, with an optional message.") }, |
| 164 | { "quote", "*", irc_cmd_quote, N_("quote [...]: Send a raw command to the server.") }, | |
| 165 | { "remove", "n:", irc_cmd_remove, N_("remove <nick> [message]: Remove someone from a room. You must be a channel operator to do this.") }, | |
| 10564 | 166 | { "time", "", irc_cmd_time, N_("time: Displays the current local time at the IRC server.") }, |
| 9255 | 167 | { "topic", ":", irc_cmd_topic, N_("topic [new topic]: View or change the channel topic.") }, |
| 168 | { "umode", ":", irc_cmd_mode, N_("umode <+|-><A-Za-z>: Set or unset a user mode.") }, | |
| 13943 | 169 | { "version", ":", irc_cmd_ctcp_version, N_("version [nick]: send CTCP VERSION request to a user") }, |
| 9258 | 170 | { "voice", ":", irc_cmd_op, N_("voice <nick1> [nick2] ...: Grant channel voice status to someone. You must be a channel operator to do this.") }, |
| 9255 | 171 | { "wallops", ":", irc_cmd_wallops, N_("wallops <message>: If you don't know what this is, you probably can't use it.") }, |
|
10609
170a5af61448
[gaim-migrate @ 12055]
Richard Laager <rlaager@pidgin.im>
parents:
10564
diff
changeset
|
172 | { "whois", "tt", irc_cmd_whois, N_("whois [server] <nick>: Get information on a user.") }, |
|
16474
bc8580a69dba
/whowas for IRC. Thanks, achris.
Ethan Blanton <elb@pidgin.im>
parents:
15884
diff
changeset
|
173 | { "whowas", "t", irc_cmd_whowas, N_("whowas <nick>: Get information on a user that has logged off.") }, |
|
11318
13fa1d5134f3
[gaim-migrate @ 13521]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11136
diff
changeset
|
174 | { NULL, NULL, NULL, NULL } |
| 6333 | 175 | }; |
| 176 | ||
| 15884 | 177 | static PurpleCmdRet irc_parse_purple_cmd(PurpleConversation *conv, const gchar *cmd, |
| 9597 | 178 | gchar **args, gchar **error, void *data) |
| 9130 | 179 | { |
| 15884 | 180 | PurpleConnection *gc; |
| 9130 | 181 | struct irc_conn *irc; |
| 182 | struct _irc_user_cmd *cmdent; | |
| 183 | ||
|
32698
154e4a2a6287
Our API really shouldn't have a 'gc' in it anymore.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32635
diff
changeset
|
184 | gc = purple_conversation_get_connection(conv); |
| 9130 | 185 | if (!gc) |
| 15884 | 186 | return PURPLE_CMD_RET_FAILED; |
| 9130 | 187 | |
|
32276
abc0b7c0cb86
Convert irc prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32157
diff
changeset
|
188 | irc = purple_connection_get_protocol_data(gc); |
| 9130 | 189 | |
| 190 | if ((cmdent = g_hash_table_lookup(irc->cmds, cmd)) == NULL) | |
| 15884 | 191 | return PURPLE_CMD_RET_FAILED; |
| 9130 | 192 | |
| 15884 | 193 | (cmdent->cb)(irc, cmd, purple_conversation_get_name(conv), (const char **)args); |
| 9130 | 194 | |
| 15884 | 195 | return PURPLE_CMD_RET_OK; |
| 9130 | 196 | } |
| 197 | ||
| 198 | static void irc_register_command(struct _irc_user_cmd *c) | |
| 199 | { | |
|
36663
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
200 | PurpleCmdId id; |
| 15884 | 201 | PurpleCmdFlag f; |
| 9130 | 202 | char args[10]; |
| 203 | char *format; | |
|
12316
b4e5d5ea15fd
[gaim-migrate @ 14620]
Richard Laager <rlaager@pidgin.im>
parents:
12282
diff
changeset
|
204 | size_t i; |
| 9130 | 205 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
206 | f = PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PROTOCOL_ONLY |
| 15884 | 207 | | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS; |
| 9130 | 208 | |
| 209 | format = c->format; | |
| 210 | ||
| 211 | for (i = 0; (i < (sizeof(args) - 1)) && *format; i++, format++) | |
| 212 | switch (*format) { | |
| 213 | case 'v': | |
| 214 | case 'n': | |
| 215 | case 'c': | |
| 216 | case 't': | |
| 217 | args[i] = 'w'; | |
| 218 | break; | |
| 219 | case ':': | |
| 220 | case '*': | |
| 221 | args[i] = 's'; | |
| 222 | break; | |
| 223 | } | |
| 224 | ||
| 225 | args[i] = '\0'; | |
| 226 | ||
|
37005
702a601fc2ca
Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents:
36910
diff
changeset
|
227 | id = purple_cmd_register(c->name, args, PURPLE_CMD_P_PROTOCOL, f, "prpl-irc", |
| 15884 | 228 | irc_parse_purple_cmd, _(c->help), NULL); |
|
36663
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
229 | cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id)); |
| 9130 | 230 | } |
| 231 | ||
| 232 | void irc_register_commands(void) | |
| 233 | { | |
| 234 | struct _irc_user_cmd *c; | |
| 235 | ||
| 236 | for (c = _irc_cmds; c && c->name; c++) | |
| 237 | irc_register_command(c); | |
| 238 | } | |
| 239 | ||
|
36663
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
240 | void irc_unregister_commands(void) |
|
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
241 | { |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
40001
diff
changeset
|
242 | g_slist_free_full(cmds, (GDestroyNotify)purple_cmd_unregister); |
|
36663
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
243 | } |
|
c61b6dbc1f03
Make protocols unregister their commands when being removed
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
244 | |
| 6333 | 245 | static char *irc_send_convert(struct irc_conn *irc, const char *string) |
| 246 | { | |
| 247 | char *utf8; | |
| 248 | GError *err = NULL; | |
| 10258 | 249 | gchar **encodings; |
| 250 | const gchar *enclist; | |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
251 | |
| 15884 | 252 | enclist = purple_account_get_string(irc->account, "encoding", IRC_DEFAULT_CHARSET); |
| 10258 | 253 | encodings = g_strsplit(enclist, ",", 2); |
| 254 | ||
|
17138
d666ace4a8ac
strcasecmp is post-C89, so use the glib equivalent
Ethan Blanton <elb@pidgin.im>
parents:
16993
diff
changeset
|
255 | if (encodings[0] == NULL || !g_ascii_strcasecmp("UTF-8", encodings[0])) { |
| 10278 | 256 | g_strfreev(encodings); |
|
23392
9268a4fc4786
Remove an unnecessary strdup when sending messages over IRC.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22798
diff
changeset
|
257 | return NULL; |
| 10278 | 258 | } |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
259 | |
| 10258 | 260 | utf8 = g_convert(string, strlen(string), encodings[0], "UTF-8", NULL, NULL, &err); |
| 6333 | 261 | if (err) { |
| 15884 | 262 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Send conversion error: %s\n", err->message); |
| 263 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Sending as UTF-8 instead of %s\n", encodings[0]); | |
| 6333 | 264 | utf8 = g_strdup(string); |
| 8954 | 265 | g_error_free(err); |
| 6333 | 266 | } |
| 10258 | 267 | g_strfreev(encodings); |
| 268 | ||
| 6333 | 269 | return utf8; |
| 270 | } | |
| 271 | ||
| 272 | static char *irc_recv_convert(struct irc_conn *irc, const char *string) | |
| 273 | { | |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
274 | char *utf8 = NULL; |
| 10258 | 275 | const gchar *charset, *enclist; |
| 276 | gchar **encodings; | |
|
23906
6962e96ddd38
This adds an "auto-detect UTF-8" option to IRC which, when enabled,
Ethan Blanton <elb@pidgin.im>
parents:
23895
diff
changeset
|
277 | gboolean autodetect; |
| 10258 | 278 | int i; |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
279 | |
|
32057
e0abdcaf6fd9
Fix a leak in IRC when accepting a UTF-8 message with a non-UTF-8 encoding.
Ethan Blanton <elb@pidgin.im>
parents:
32047
diff
changeset
|
280 | autodetect = purple_account_get_bool(irc->account, "autodetect_utf8", IRC_DEFAULT_AUTODETECT); |
|
e0abdcaf6fd9
Fix a leak in IRC when accepting a UTF-8 message with a non-UTF-8 encoding.
Ethan Blanton <elb@pidgin.im>
parents:
32047
diff
changeset
|
281 | |
|
e0abdcaf6fd9
Fix a leak in IRC when accepting a UTF-8 message with a non-UTF-8 encoding.
Ethan Blanton <elb@pidgin.im>
parents:
32047
diff
changeset
|
282 | if (autodetect && g_utf8_validate(string, -1, NULL)) { |
|
e0abdcaf6fd9
Fix a leak in IRC when accepting a UTF-8 message with a non-UTF-8 encoding.
Ethan Blanton <elb@pidgin.im>
parents:
32047
diff
changeset
|
283 | return g_strdup(string); |
|
e0abdcaf6fd9
Fix a leak in IRC when accepting a UTF-8 message with a non-UTF-8 encoding.
Ethan Blanton <elb@pidgin.im>
parents:
32047
diff
changeset
|
284 | } |
|
e0abdcaf6fd9
Fix a leak in IRC when accepting a UTF-8 message with a non-UTF-8 encoding.
Ethan Blanton <elb@pidgin.im>
parents:
32047
diff
changeset
|
285 | |
| 15884 | 286 | enclist = purple_account_get_string(irc->account, "encoding", IRC_DEFAULT_CHARSET); |
| 10258 | 287 | encodings = g_strsplit(enclist, ",", -1); |
| 288 | ||
|
10504
eae130eefbfe
[gaim-migrate @ 11796]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10278
diff
changeset
|
289 | if (encodings[0] == NULL) { |
|
eae130eefbfe
[gaim-migrate @ 11796]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10278
diff
changeset
|
290 | g_strfreev(encodings); |
| 15884 | 291 | return purple_utf8_salvage(string); |
|
10504
eae130eefbfe
[gaim-migrate @ 11796]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10278
diff
changeset
|
292 | } |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
293 | |
| 10258 | 294 | for (i = 0; encodings[i] != NULL; i++) { |
| 295 | charset = encodings[i]; | |
| 296 | while (*charset == ' ') | |
| 297 | charset++; | |
| 298 | ||
|
17156
6d4cc0f310d1
More strcasecmp() replacements.
Richard Laager <rlaager@pidgin.im>
parents:
17138
diff
changeset
|
299 | if (!g_ascii_strcasecmp("UTF-8", charset)) { |
|
11726
6f319ff4cea5
[gaim-migrate @ 14017]
Richard Laager <rlaager@pidgin.im>
parents:
11318
diff
changeset
|
300 | if (g_utf8_validate(string, -1, NULL)) |
| 10258 | 301 | utf8 = g_strdup(string); |
| 302 | } else { | |
|
11726
6f319ff4cea5
[gaim-migrate @ 14017]
Richard Laager <rlaager@pidgin.im>
parents:
11318
diff
changeset
|
303 | utf8 = g_convert(string, -1, "UTF-8", charset, NULL, NULL, NULL); |
| 10258 | 304 | } |
| 305 | ||
| 306 | if (utf8) { | |
| 307 | g_strfreev(encodings); | |
| 308 | return utf8; | |
| 309 | } | |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
310 | } |
|
10504
eae130eefbfe
[gaim-migrate @ 11796]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10278
diff
changeset
|
311 | g_strfreev(encodings); |
|
9644
a9a0dedb52c7
[gaim-migrate @ 10492]
Mark Doliner <markdoliner@pidgin.im>
parents:
9597
diff
changeset
|
312 | |
| 15884 | 313 | return purple_utf8_salvage(string); |
| 6333 | 314 | } |
| 315 | ||
|
20217
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
316 | /* This function is shamelessly stolen from glib--it is an old version of the |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
317 | * private function append_escaped_text, used by g_markup_escape_text, whose |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
318 | * behavior changed in glib 2.12. */ |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
319 | static void irc_append_escaped_text(GString *str, const char *text, gssize length) |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
320 | { |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
321 | const char *p = text; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
322 | const char *end = text + length; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
323 | const char *next = NULL; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
324 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
325 | while(p != end) { |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
326 | next = g_utf8_next_char(p); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
327 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
328 | switch(*p) { |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
329 | case '&': |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
330 | g_string_append(str, "&"); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
331 | break; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
332 | case '<': |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
333 | g_string_append(str, "<"); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
334 | break; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
335 | case '>': |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
336 | g_string_append(str, ">"); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
337 | break; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
338 | case '\'': |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
339 | g_string_append(str, "'"); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
340 | break; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
341 | case '"': |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
342 | g_string_append(str, """); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
343 | break; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
344 | default: |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
345 | g_string_append_len(str, p, next - p); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
346 | break; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
347 | } |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
348 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
349 | p = next; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
350 | } |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
351 | } |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
352 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
353 | /* This function is shamelessly stolen from glib--it is an old version of the |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
354 | * function g_markup_escape_text, whose behavior changed in glib 2.12. */ |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
355 | char *irc_escape_privmsg(const char *text, gssize length) |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
356 | { |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
357 | GString *str; |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
358 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
359 | g_return_val_if_fail(text != NULL, NULL); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
360 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
361 | if(length < 0) |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
362 | length = strlen(text); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
363 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
364 | str = g_string_sized_new(length); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
365 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
366 | irc_append_escaped_text(str, text, length); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
367 | |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
368 | return g_string_free(str, FALSE); |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
369 | } |
|
9249f67ef61e
applied changes from 6c08c628ee64e16c824829c25befc0ca09338f9d
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
370 | |
| 6333 | 371 | /* XXX tag closings are not necessarily correctly nested here! If we |
| 372 | * get a ^O or reach the end of the string and there are open | |
| 373 | * tags, they are closed in a fixed order ... this means, for | |
| 374 | * example, you might see <FONT COLOR="blue">some text <B>with | |
| 375 | * various attributes</FONT></B> (notice that B and FONT overlap | |
| 376 | * and are not cleanly nested). This is imminently fixable but | |
| 377 | * I am not fixing it right now. | |
| 378 | */ | |
| 379 | char *irc_mirc2html(const char *string) | |
| 380 | { | |
| 381 | const char *cur, *end; | |
| 382 | char fg[3] = "\0\0", bg[3] = "\0\0"; | |
| 383 | int fgnum, bgnum; | |
|
12158
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
384 | int font = 0, bold = 0, underline = 0, italic = 0; |
|
28468
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
385 | GString *decoded; |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
386 | |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
387 | if (string == NULL) |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
388 | return NULL; |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
389 | |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
390 | decoded = g_string_sized_new(strlen(string)); |
| 6333 | 391 | |
| 392 | cur = string; | |
| 393 | do { | |
| 6754 | 394 | end = strpbrk(cur, "\002\003\007\017\026\037"); |
| 6333 | 395 | |
|
36256
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35282
diff
changeset
|
396 | decoded = g_string_append_len(decoded, cur, (end ? (gssize)(end - cur) : (gssize)strlen(cur))); |
| 6333 | 397 | cur = end ? end : cur + strlen(cur); |
| 398 | ||
| 399 | switch (*cur) { | |
| 400 | case '\002': | |
| 401 | cur++; | |
| 402 | if (!bold) { | |
| 403 | decoded = g_string_append(decoded, "<B>"); | |
| 404 | bold = TRUE; | |
| 405 | } else { | |
| 406 | decoded = g_string_append(decoded, "</B>"); | |
| 407 | bold = FALSE; | |
| 408 | } | |
| 409 | break; | |
| 410 | case '\003': | |
| 411 | cur++; | |
| 412 | fg[0] = fg[1] = bg[0] = bg[1] = '\0'; | |
| 413 | if (isdigit(*cur)) | |
| 414 | fg[0] = *cur++; | |
| 415 | if (isdigit(*cur)) | |
| 416 | fg[1] = *cur++; | |
| 417 | if (*cur == ',') { | |
| 418 | cur++; | |
| 419 | if (isdigit(*cur)) | |
| 420 | bg[0] = *cur++; | |
| 421 | if (isdigit(*cur)) | |
| 422 | bg[1] = *cur++; | |
| 423 | } | |
| 424 | if (font) { | |
| 425 | decoded = g_string_append(decoded, "</FONT>"); | |
| 426 | font = FALSE; | |
| 427 | } | |
| 428 | ||
| 429 | if (fg[0]) { | |
| 430 | fgnum = atoi(fg); | |
| 431 | if (fgnum < 0 || fgnum > 15) | |
| 432 | continue; | |
| 433 | font = TRUE; | |
| 434 | g_string_append_printf(decoded, "<FONT COLOR=\"%s\"", irc_mirc_colors[fgnum]); | |
| 435 | if (bg[0]) { | |
| 436 | bgnum = atoi(bg); | |
| 437 | if (bgnum >= 0 && bgnum < 16) | |
| 438 | g_string_append_printf(decoded, " BACK=\"%s\"", irc_mirc_colors[bgnum]); | |
| 439 | } | |
| 440 | decoded = g_string_append_c(decoded, '>'); | |
| 441 | } | |
| 442 | break; | |
|
12158
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
443 | case '\011': |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
444 | cur++; |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
445 | if (!italic) { |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
446 | decoded = g_string_append(decoded, "<I>"); |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
447 | italic = TRUE; |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
448 | } else { |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
449 | decoded = g_string_append(decoded, "</I>"); |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
450 | italic = FALSE; |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
451 | } |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
452 | break; |
| 6754 | 453 | case '\037': |
| 454 | cur++; | |
| 455 | if (!underline) { | |
| 456 | decoded = g_string_append(decoded, "<U>"); | |
| 457 | underline = TRUE; | |
| 458 | } else { | |
| 459 | decoded = g_string_append(decoded, "</U>"); | |
| 12282 | 460 | underline = FALSE; |
| 6754 | 461 | } |
| 462 | break; | |
| 6333 | 463 | case '\007': |
| 464 | case '\026': | |
| 465 | cur++; | |
| 466 | break; | |
| 467 | case '\017': | |
| 468 | cur++; | |
| 469 | /* fallthrough */ | |
| 470 | case '\000': | |
| 471 | if (bold) | |
| 6754 | 472 | decoded = g_string_append(decoded, "</B>"); |
|
12158
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
473 | if (italic) |
|
02fcec741f07
[gaim-migrate @ 14459]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12013
diff
changeset
|
474 | decoded = g_string_append(decoded, "</I>"); |
| 6754 | 475 | if (underline) |
| 476 | decoded = g_string_append(decoded, "</U>"); | |
| 6333 | 477 | if (font) |
| 478 | decoded = g_string_append(decoded, "</FONT>"); | |
|
31974
28ac37064cd4
Fix the handling of IRC formatting following mIRC ^O.
Ethan Blanton <elb@pidgin.im>
parents:
31651
diff
changeset
|
479 | bold = italic = underline = font = FALSE; |
| 6333 | 480 | break; |
| 481 | default: | |
| 15884 | 482 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Unexpected mIRC formatting character %d\n", *cur); |
| 6333 | 483 | } |
| 484 | } while (*cur); | |
| 485 | ||
| 486 | return g_string_free(decoded, FALSE); | |
| 487 | } | |
| 488 | ||
| 8529 | 489 | char *irc_mirc2txt (const char *string) |
| 490 | { | |
|
28468
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
491 | char *result; |
| 8529 | 492 | int i, j; |
| 493 | ||
|
28468
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
494 | if (string == NULL) |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
495 | return NULL; |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
496 | |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
497 | result = g_strdup (string); |
|
aa8975185a48
Head irc_mirc2* bugs off at the pass with a NULL check
Ethan Blanton <elb@pidgin.im>
parents:
24763
diff
changeset
|
498 | |
| 8529 | 499 | for (i = 0, j = 0; result[i]; i++) { |
| 500 | switch (result[i]) { | |
| 501 | case '\002': | |
| 502 | case '\003': | |
|
17409
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
503 | /* Foreground color */ |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
504 | if (isdigit(result[i + 1])) |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
505 | i++; |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
506 | if (isdigit(result[i + 1])) |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
507 | i++; |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
508 | /* Optional comma and background color */ |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
509 | if (result[i + 1] == ',') { |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
510 | i++; |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
511 | if (isdigit(result[i + 1])) |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
512 | i++; |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
513 | if (isdigit(result[i + 1])) |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
514 | i++; |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
515 | } |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
516 | /* Note that i still points to the last character |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
517 | * of the color selection string. */ |
|
1205b4f7bb82
This performs mIRC formatting code stripping for the room list, as
Ethan Blanton <elb@pidgin.im>
parents:
17156
diff
changeset
|
518 | continue; |
| 8529 | 519 | case '\007': |
| 520 | case '\017': | |
| 521 | case '\026': | |
| 522 | case '\037': | |
| 523 | continue; | |
| 524 | default: | |
| 525 | result[j++] = result[i]; | |
| 526 | } | |
| 527 | } | |
| 11136 | 528 | result[j] = '\0'; |
|
24763
67d9d4c975c0
Replace spaces wth tabs in indentation and tabs with spaces in line continuations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24574
diff
changeset
|
529 | return result; |
| 8529 | 530 | } |
| 531 | ||
|
24574
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
532 | const char *irc_nick_skip_mode(struct irc_conn *irc, const char *nick) |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
533 | { |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
534 | static const char *default_modes = "@+%&"; |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
535 | const char *mode_chars; |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
536 | |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
537 | mode_chars = irc->mode_chars ? irc->mode_chars : default_modes; |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
538 | |
|
38918
bb3906c14782
irc: fix read out of bounds in irc_nick_skip_mode
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
539 | while (*nick && strchr(mode_chars, *nick) != NULL) |
|
24574
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
540 | nick++; |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
541 | |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
542 | return nick; |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
543 | } |
|
4ee71b4f335f
Strip multiple leading mode characters from incoming nicknames.
Marcos García Ochoa <magao@bigfoot.com>
parents:
23906
diff
changeset
|
544 | |
| 10208 | 545 | gboolean irc_ischannel(const char *string) |
| 546 | { | |
| 547 | return (string[0] == '#' || string[0] == '&'); | |
| 548 | } | |
| 549 | ||
| 6333 | 550 | char *irc_parse_ctcp(struct irc_conn *irc, const char *from, const char *to, const char *msg, int notice) |
| 551 | { | |
| 15884 | 552 | PurpleConnection *gc; |
| 6333 | 553 | const char *cur = msg + 1; |
| 554 | char *buf, *ctcp; | |
| 555 | ||
| 6754 | 556 | /* Note that this is NOT correct w.r.t. multiple CTCPs in one |
| 557 | * message and low-level quoting ... but if you want that crap, | |
| 558 | * use a real IRC client. */ | |
| 559 | ||
|
38920
306b7ae2c8a4
irc: Fix write of a single \0 before the start of a buffer in irc_parse_ctcp
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
560 | if (msg[0] != '\001' || msg[1] == '\0' || msg[strlen(msg) - 1] != '\001') |
| 6333 | 561 | return g_strdup(msg); |
| 562 | ||
| 563 | if (!strncmp(cur, "ACTION ", 7)) { | |
| 564 | cur += 7; | |
| 565 | buf = g_strdup_printf("/me %s", cur); | |
| 566 | buf[strlen(buf) - 1] = '\0'; | |
| 567 | return buf; | |
| 568 | } else if (!strncmp(cur, "PING ", 5)) { | |
| 569 | if (notice) { /* reply */ | |
|
40000
0eeff970bcdd
Use monotonic time for IRC ping messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39589
diff
changeset
|
570 | gint64 timestamp; |
| 15884 | 571 | gc = purple_account_get_connection(irc->account); |
| 6333 | 572 | if (!gc) |
| 573 | return NULL; | |
|
40000
0eeff970bcdd
Use monotonic time for IRC ping messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39589
diff
changeset
|
574 | if (sscanf(cur, "PING %" G_GINT64_FORMAT, ×tamp) == 1) { |
|
0eeff970bcdd
Use monotonic time for IRC ping messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39589
diff
changeset
|
575 | buf = g_strdup_printf(_("Reply time from %s: %f seconds"), from, |
|
0eeff970bcdd
Use monotonic time for IRC ping messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39589
diff
changeset
|
576 | (g_get_monotonic_time() - timestamp) / |
|
0eeff970bcdd
Use monotonic time for IRC ping messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39589
diff
changeset
|
577 | (gdouble)G_USEC_PER_SEC); |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34304
diff
changeset
|
578 | purple_notify_info(gc, _("PONG"), |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34304
diff
changeset
|
579 | _("CTCP PING reply"), buf, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34304
diff
changeset
|
580 | purple_request_cpar_from_connection(gc)); |
|
33809
d5e9c888ccd7
Add some error checking for sscanf usage (there are more places that could use this)
Daniel Atallah <datallah@pidgin.im>
parents:
33544
diff
changeset
|
581 | g_free(buf); |
|
d5e9c888ccd7
Add some error checking for sscanf usage (there are more places that could use this)
Daniel Atallah <datallah@pidgin.im>
parents:
33544
diff
changeset
|
582 | } else |
|
d5e9c888ccd7
Add some error checking for sscanf usage (there are more places that could use this)
Daniel Atallah <datallah@pidgin.im>
parents:
33544
diff
changeset
|
583 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Unable to parse PING timestamp"); |
| 6333 | 584 | return NULL; |
| 585 | } else { | |
| 586 | buf = irc_format(irc, "vt:", "NOTICE", from, msg); | |
| 587 | irc_send(irc, buf); | |
| 588 | g_free(buf); | |
| 589 | } | |
| 590 | } else if (!strncmp(cur, "VERSION", 7) && !notice) { | |
| 15884 | 591 | buf = irc_format(irc, "vt:", "NOTICE", from, "\001VERSION Purple IRC\001"); |
| 6333 | 592 | irc_send(irc, buf); |
| 593 | g_free(buf); | |
| 8351 | 594 | } else if (!strncmp(cur, "DCC SEND ", 9)) { |
| 595 | irc_dccsend_recv(irc, from, msg + 10); | |
| 596 | return NULL; | |
| 6333 | 597 | } |
| 598 | ||
| 599 | ctcp = g_strdup(msg + 1); | |
| 600 | ctcp[strlen(ctcp) - 1] = '\0'; | |
| 601 | buf = g_strdup_printf("Received CTCP '%s' (to %s) from %s", ctcp, to, from); | |
| 602 | g_free(ctcp); | |
| 603 | return buf; | |
| 604 | } | |
| 605 | ||
| 606 | void irc_msg_table_build(struct irc_conn *irc) | |
| 607 | { | |
| 608 | int i; | |
| 609 | ||
| 610 | if (!irc || !irc->msgs) { | |
| 15884 | 611 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Attempt to build a message table on a bogus structure\n"); |
| 6333 | 612 | return; |
| 613 | } | |
| 614 | ||
| 615 | for (i = 0; _irc_msgs[i].name; i++) { | |
| 616 | g_hash_table_insert(irc->msgs, (gpointer)_irc_msgs[i].name, (gpointer)&_irc_msgs[i]); | |
| 617 | } | |
| 618 | } | |
| 619 | ||
| 620 | void irc_cmd_table_build(struct irc_conn *irc) | |
| 621 | { | |
| 622 | int i; | |
| 623 | ||
| 624 | if (!irc || !irc->cmds) { | |
| 15884 | 625 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Attempt to build a command table on a bogus structure\n"); |
| 6333 | 626 | return; |
| 627 | } | |
| 628 | ||
| 629 | for (i = 0; _irc_cmds[i].name ; i++) { | |
| 630 | g_hash_table_insert(irc->cmds, (gpointer)_irc_cmds[i].name, (gpointer)&_irc_cmds[i]); | |
| 631 | } | |
| 632 | } | |
| 633 | ||
| 634 | char *irc_format(struct irc_conn *irc, const char *format, ...) | |
| 635 | { | |
| 636 | GString *string = g_string_new(""); | |
| 637 | char *tok, *tmp; | |
| 638 | const char *cur; | |
| 639 | va_list ap; | |
| 640 | ||
| 641 | va_start(ap, format); | |
| 642 | for (cur = format; *cur; cur++) { | |
| 643 | if (cur != format) | |
| 644 | g_string_append_c(string, ' '); | |
| 645 | ||
| 646 | tok = va_arg(ap, char *); | |
| 647 | switch (*cur) { | |
| 648 | case 'v': | |
| 649 | g_string_append(string, tok); | |
| 650 | break; | |
| 651 | case ':': | |
| 652 | g_string_append_c(string, ':'); | |
| 653 | /* no break! */ | |
| 654 | case 't': | |
| 655 | case 'n': | |
| 656 | case 'c': | |
| 657 | tmp = irc_send_convert(irc, tok); | |
|
23392
9268a4fc4786
Remove an unnecessary strdup when sending messages over IRC.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22798
diff
changeset
|
658 | g_string_append(string, tmp ? tmp : tok); |
| 6333 | 659 | g_free(tmp); |
| 660 | break; | |
| 661 | default: | |
| 15884 | 662 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "Invalid format character '%c'\n", *cur); |
| 6333 | 663 | break; |
| 664 | } | |
| 665 | } | |
| 666 | va_end(ap); | |
| 667 | g_string_append(string, "\r\n"); | |
| 668 | return (g_string_free(string, FALSE)); | |
| 669 | } | |
| 670 | ||
| 671 | void irc_parse_msg(struct irc_conn *irc, char *input) | |
| 672 | { | |
| 673 | struct _irc_msg *msgent; | |
| 674 | char *cur, *end, *tmp, *from, *msgname, *fmt, **args, *msg; | |
| 7631 | 675 | guint i; |
|
20440
42e5e5445a2f
Move prpl-irc to purple_connection_error_reason.
Will Thompson <resiak@pidgin.im>
parents:
19859
diff
changeset
|
676 | PurpleConnection *gc = purple_account_get_connection(irc->account); |
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
677 | gboolean fmt_valid; |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
678 | int args_cnt; |
| 6333 | 679 | |
|
14544
847944da3ca0
[gaim-migrate @ 17201]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
680 | irc->recv_time = time(NULL); |
|
14984
aa56a88dc792
[gaim-migrate @ 17694]
Mark Doliner <markdoliner@pidgin.im>
parents:
14683
diff
changeset
|
681 | |
|
aa56a88dc792
[gaim-migrate @ 17694]
Mark Doliner <markdoliner@pidgin.im>
parents:
14683
diff
changeset
|
682 | /* |
|
14996
291304176e0b
[gaim-migrate @ 17706]
Mark Doliner <markdoliner@pidgin.im>
parents:
14995
diff
changeset
|
683 | * The data passed to irc-receiving-text is the raw protocol data. |
|
14995
fc9f51b8f6d5
[gaim-migrate @ 17705]
Mark Doliner <markdoliner@pidgin.im>
parents:
14984
diff
changeset
|
684 | * TODO: It should be passed as an array of bytes and a length |
|
fc9f51b8f6d5
[gaim-migrate @ 17705]
Mark Doliner <markdoliner@pidgin.im>
parents:
14984
diff
changeset
|
685 | * instead of a null terminated string. |
|
14984
aa56a88dc792
[gaim-migrate @ 17694]
Mark Doliner <markdoliner@pidgin.im>
parents:
14683
diff
changeset
|
686 | */ |
|
36520
42a876472506
Refactored irc to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33811
diff
changeset
|
687 | purple_signal_emit(_irc_protocol, "irc-receiving-text", gc, &input); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31229
diff
changeset
|
688 | |
|
38907
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
689 | if (purple_debug_is_verbose()) { |
|
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
690 | char *clean = purple_utf8_salvage(input); |
|
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
691 | clean = g_strstrip(clean); |
|
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
692 | purple_debug_misc("irc", ">> %s\n", clean); |
|
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
693 | g_free(clean); |
|
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
694 | } |
|
d184ca7f413e
irc: show protocol debug if PURPLE_VERBOSE_DEBUG=1
dx <dx@dxzone.com.ar>
parents:
36256
diff
changeset
|
695 | |
| 6333 | 696 | if (!strncmp(input, "PING ", 5)) { |
| 697 | msg = irc_format(irc, "vv", "PONG", input + 5); | |
| 698 | irc_send(irc, msg); | |
| 699 | g_free(msg); | |
| 700 | return; | |
| 701 | } else if (!strncmp(input, "ERROR ", 6)) { | |
| 10154 | 702 | if (g_utf8_validate(input, -1, NULL)) { |
|
37966
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
703 | purple_connection_take_error(gc, g_error_new( |
|
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
704 | PURPLE_CONNECTION_ERROR, |
|
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
705 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
706 | "%s\n%s", _("Disconnected."), input)); |
| 10154 | 707 | } else |
|
37966
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
708 | purple_connection_take_error(gc, g_error_new_literal( |
|
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
709 | PURPLE_CONNECTION_ERROR, |
| 21279 | 710 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
37966
956640da6944
irc: Pass PurpleConnection errors as GErrors
Mike Ruprecht <cmaiku@gmail.com>
parents:
37158
diff
changeset
|
711 | _("Disconnected."))); |
| 6333 | 712 | return; |
|
33404
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
713 | #ifdef HAVE_CYRUS_SASL |
|
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
714 | } else if (!strncmp(input, "AUTHENTICATE ", 13)) { |
|
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
715 | irc_msg_auth(irc, input + 13); |
|
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
716 | return; |
|
bbd52f93184e
Implement SASL support for IRC, using Cyrus.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
32057
diff
changeset
|
717 | #endif |
| 6333 | 718 | } |
| 719 | ||
| 720 | if (input[0] != ':' || (cur = strchr(input, ' ')) == NULL) { | |
| 721 | irc_parse_error_cb(irc, input); | |
| 722 | return; | |
| 723 | } | |
| 724 | ||
| 725 | from = g_strndup(&input[1], cur - &input[1]); | |
| 726 | cur++; | |
| 727 | end = strchr(cur, ' '); | |
| 728 | if (!end) | |
| 729 | end = cur + strlen(cur); | |
| 730 | ||
| 731 | tmp = g_strndup(cur, end - cur); | |
| 732 | msgname = g_ascii_strdown(tmp, -1); | |
| 733 | g_free(tmp); | |
| 734 | ||
| 735 | if ((msgent = g_hash_table_lookup(irc->msgs, msgname)) == NULL) { | |
| 736 | irc_msg_default(irc, "", from, &input); | |
| 737 | g_free(msgname); | |
| 738 | g_free(from); | |
| 739 | return; | |
| 740 | } | |
| 741 | g_free(msgname); | |
| 742 | ||
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
743 | fmt_valid = TRUE; |
| 6333 | 744 | args = g_new0(char *, strlen(msgent->format)); |
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
745 | args_cnt = 0; |
| 6333 | 746 | for (cur = end, fmt = msgent->format, i = 0; fmt[i] && *cur++; i++) { |
| 747 | switch (fmt[i]) { | |
| 748 | case 'v': | |
| 749 | if (!(end = strchr(cur, ' '))) end = cur + strlen(cur); | |
|
32047
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
750 | /* This is a string of unknown encoding which we do not |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
751 | * want to transcode, but it may or may not be valid |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
752 | * UTF-8, so we'll salvage it. If a nick/channel/target |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
753 | * field has inadvertently been marked verbatim, this |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
754 | * could cause weirdness. */ |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
755 | tmp = g_strndup(cur, end - cur); |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
756 | args[i] = purple_utf8_salvage(tmp); |
|
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
757 | g_free(tmp); |
| 6333 | 758 | cur += end - cur; |
| 759 | break; | |
| 760 | case 't': | |
| 761 | case 'n': | |
| 762 | case 'c': | |
| 763 | if (!(end = strchr(cur, ' '))) end = cur + strlen(cur); | |
| 764 | tmp = g_strndup(cur, end - cur); | |
| 765 | args[i] = irc_recv_convert(irc, tmp); | |
| 766 | g_free(tmp); | |
| 767 | cur += end - cur; | |
| 768 | break; | |
| 769 | case ':': | |
| 770 | if (*cur == ':') cur++; | |
| 771 | args[i] = irc_recv_convert(irc, cur); | |
| 772 | cur = cur + strlen(cur); | |
| 773 | break; | |
| 774 | case '*': | |
|
32047
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
775 | /* Ditto 'v' above; we're going to salvage this in case |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36574
diff
changeset
|
776 | * it leaks past the IRC protocol */ |
|
32047
42d2acf32425
UTF-8 salvage unknown strings in IRC
Ethan Blanton <elb@pidgin.im>
parents:
32037
diff
changeset
|
777 | args[i] = purple_utf8_salvage(cur); |
| 6333 | 778 | cur = cur + strlen(cur); |
| 779 | break; | |
| 780 | default: | |
| 15884 | 781 | purple_debug(PURPLE_DEBUG_ERROR, "irc", "invalid message format character '%c'\n", fmt[i]); |
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
782 | fmt_valid = FALSE; |
| 6333 | 783 | break; |
| 784 | } | |
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
785 | if (fmt_valid) |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
786 | args_cnt = i + 1; |
| 6333 | 787 | } |
|
35245
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
788 | if (G_UNLIKELY(!fmt_valid)) { |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
789 | purple_debug_error("irc", "message format was invalid"); |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
790 | } else if (G_LIKELY(args_cnt >= msgent->req_cnt)) { |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
791 | tmp = irc_recv_convert(irc, from); |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
792 | (msgent->cb)(irc, msgent->name, tmp, args); |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
793 | g_free(tmp); |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
794 | } else { |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
795 | purple_debug_error("irc", "args count (%d) doesn't reach " |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
796 | "expected value of %d for the '%s' command", |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
797 | args_cnt, msgent->req_cnt, msgent->name); |
|
a167504359e5
IRC: implement support for required args checking in message parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33809
diff
changeset
|
798 | } |
| 6333 | 799 | for (i = 0; i < strlen(msgent->format); i++) { |
| 800 | g_free(args[i]); | |
| 801 | } | |
| 802 | g_free(args); | |
| 803 | g_free(from); | |
| 804 | } | |
| 805 | ||
| 806 | static void irc_parse_error_cb(struct irc_conn *irc, char *input) | |
| 807 | { | |
|
23433
0094a64519cb
Make the IRC "unknown message" debugging messages UTF-8 safe.
Ethan Blanton <elb@pidgin.im>
parents:
23392
diff
changeset
|
808 | char *clean; |
|
24763
67d9d4c975c0
Replace spaces wth tabs in indentation and tabs with spaces in line continuations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24574
diff
changeset
|
809 | /* This really should be escaped somehow that you can tell what |
|
67d9d4c975c0
Replace spaces wth tabs in indentation and tabs with spaces in line continuations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24574
diff
changeset
|
810 | * the junk was -- but as it is, it can crash glib. */ |
|
67d9d4c975c0
Replace spaces wth tabs in indentation and tabs with spaces in line continuations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24574
diff
changeset
|
811 | clean = purple_utf8_salvage(input); |
|
23433
0094a64519cb
Make the IRC "unknown message" debugging messages UTF-8 safe.
Ethan Blanton <elb@pidgin.im>
parents:
23392
diff
changeset
|
812 | purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unrecognized string: %s\n", clean); |
|
24763
67d9d4c975c0
Replace spaces wth tabs in indentation and tabs with spaces in line continuations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24574
diff
changeset
|
813 | g_free(clean); |
| 6333 | 814 | } |