comparison src/protocols/napster/napster.c @ 12216:4d3119205a33

[gaim-migrate @ 14518] Remove GaimConvImFlags and GaimConvChatFlags - use GaimMessageFlags everywhere instead. Add a new GAIM_MESSAGE_IMAGES flag, and set it when sending a message containing images. When sending a message, the core will now always send "html" to the prpls, just like it expects to receive html from the prpls for received messages. This will allow text prpls such as SILC to support IM images and differentiate them from user input. Previously gaim_unescape_html() was used before passing the message to the prpl, now the prpl does this itself if it needs it. I think I updated all the prpls correctly, but I'm not so sure about sametime. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 24 Nov 2005 20:47:46 +0000
parents cbebda5f019c
children 1b57012eec7b
comparison
equal deleted inserted replaced
12215:31b91bfab029 12216:4d3119205a33
124 g_strfreev(res); 124 g_strfreev(res);
125 return 0; 125 return 0;
126 } 126 }
127 127
128 /* 205 - MSG_CLIENT_PRIVMSG */ 128 /* 205 - MSG_CLIENT_PRIVMSG */
129 static int nap_send_im(GaimConnection *gc, const char *who, const char *message, GaimConvImFlags flags) 129 static int nap_send_im(GaimConnection *gc, const char *who, const char *message, GaimMessageFlags flags)
130 { 130 {
131 131 char *tmp = gaim_unescape_html(message);
132 if ((strlen(message) < 2) || (message[0] != '/' ) || (message[1] == '/')) { 132
133 if ((strlen(tmp) < 2) || (tmp[0] != '/' ) || (tmp[1] == '/')) {
133 /* Actually send a chat message */ 134 /* Actually send a chat message */
134 nap_write_packet(gc, 205, "%s %s", who, message); 135 nap_write_packet(gc, 205, "%s %s", who, tmp);
135 } else { 136 } else {
136 /* user typed an IRC-style command */ 137 /* user typed an IRC-style command */
137 nap_do_irc_style(gc, message, who); 138 nap_do_irc_style(gc, tmp, who);
138 } 139 }
140
141 g_free(tmp);
139 142
140 return 1; 143 return 1;
141 } 144 }
142 145
143 /* 207 - MSG_CLIENT_ADD_HOTLIST */ 146 /* 207 - MSG_CLIENT_ADD_HOTLIST */
218 221
219 nap_write_packet(gc, 401, "%s", c->name); 222 nap_write_packet(gc, 401, "%s", c->name);
220 } 223 }
221 224
222 /* 402 - MSG_CLIENT_PUBLIC */ 225 /* 402 - MSG_CLIENT_PUBLIC */
223 static int nap_chat_send(GaimConnection *gc, int id, const char *message) 226 static int nap_chat_send(GaimConnection *gc, int id, const char *message, GaimMessageFlags flags)
224 { 227 {
225 GaimConversation *c = gaim_find_chat(gc, id); 228 GaimConversation *c = gaim_find_chat(gc, id);
229 char *tmp = gaim_unescape_html(message);
226 230
227 if (!c) 231 if (!c)
228 return -EINVAL; 232 return -EINVAL;
229 233
230 if ((strlen(message) < 2) || (message[0] != '/' ) || (message[1] == '/')) { 234 if ((strlen(tmp) < 2) || (tmp[0] != '/' ) || (tmp[1] == '/')) {
231 /* Actually send a chat message */ 235 /* Actually send a chat message */
232 nap_write_packet(gc, 402, "%s %s", c->name, message); 236 nap_write_packet(gc, 402, "%s %s", c->name, tmp);
233 } else { 237 } else {
234 /* user typed an IRC-style command */ 238 /* user typed an IRC-style command */
235 nap_do_irc_style(gc, message, c->name); 239 nap_do_irc_style(gc, tmp, c->name);
236 } 240 }
241
242 g_free(tmp);
237 243
238 return 0; 244 return 0;
239 } 245 }
240 246
241 /* 603 - MSG_CLIENT_WHOIS */ 247 /* 603 - MSG_CLIENT_WHOIS */