Mercurial > pidgin
comparison src/protocols/irc/cmds.c @ 11338:17142948653e
[gaim-migrate @ 13551]
Change the GAIM_CONV_IM and GAIM_CONV_CHAT enums to GAIM_CONV_TYPE_IM
and GAIM_CONV_TYPE_CHAT. This touched A LOT of files. Also combined
two oscar header files (one of them was small and dorky).
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 25 Aug 2005 02:33:44 +0000 |
parents | 634fec5ed0f2 |
children | ddb7520d57bd |
comparison
equal
deleted
inserted
replaced
11337:1462b64f8fc9 | 11338:17142948653e |
---|---|
32 | 32 |
33 static void irc_do_mode(struct irc_conn *irc, const char *target, const char *sign, char **ops); | 33 static void irc_do_mode(struct irc_conn *irc, const char *target, const char *sign, char **ops); |
34 | 34 |
35 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args) | 35 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args) |
36 { | 36 { |
37 GaimConversation *convo = gaim_find_conversation_with_account(GAIM_CONV_ANY, target, irc->account); | 37 GaimConversation *convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, target, irc->account); |
38 char *buf; | 38 char *buf; |
39 | 39 |
40 if (!convo) | 40 if (!convo) |
41 return 1; | 41 return 1; |
42 | 42 |
43 buf = g_strdup_printf(_("Unknown command: %s"), cmd); | 43 buf = g_strdup_printf(_("Unknown command: %s"), cmd); |
44 if (gaim_conversation_get_type(convo) == GAIM_CONV_IM) | 44 if (gaim_conversation_get_type(convo) == GAIM_CONV_TYPE_IM) |
45 gaim_conv_im_write(GAIM_CONV_IM(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL)); | 45 gaim_conv_im_write(GAIM_CONV_IM(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL)); |
46 else | 46 else |
47 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL)); | 47 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL)); |
48 g_free(buf); | 48 g_free(buf); |
49 | 49 |
108 irc_cmd_privmsg(irc, cmd, target, (const char **)newargs); | 108 irc_cmd_privmsg(irc, cmd, target, (const char **)newargs); |
109 g_free(newargs[0]); | 109 g_free(newargs[0]); |
110 g_free(newargs[1]); | 110 g_free(newargs[1]); |
111 g_free(newargs); | 111 g_free(newargs); |
112 | 112 |
113 convo = gaim_find_conversation_with_account(GAIM_CONV_ANY, target, irc->account); | 113 convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY, target, irc->account); |
114 if (convo) { | 114 if (convo) { |
115 escaped = g_markup_escape_text(args[0], -1); | 115 escaped = g_markup_escape_text(args[0], -1); |
116 action = g_strdup_printf("/me %s", escaped); | 116 action = g_strdup_printf("/me %s", escaped); |
117 g_free(escaped); | 117 g_free(escaped); |
118 if (action[strlen(action) - 1] == '\n') | 118 if (action[strlen(action) - 1] == '\n') |
119 action[strlen(action) - 1] = '\0'; | 119 action[strlen(action) - 1] = '\0'; |
120 if (gaim_conversation_get_type(convo) == GAIM_CONV_CHAT) | 120 if (gaim_conversation_get_type(convo) == GAIM_CONV_TYPE_CHAT) |
121 serv_got_chat_in(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo)), | 121 serv_got_chat_in(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo)), |
122 gaim_connection_get_display_name(gc), | 122 gaim_connection_get_display_name(gc), |
123 0, action, time(NULL)); | 123 0, action, time(NULL)); |
124 else | 124 else |
125 gaim_conv_im_write(GAIM_CONV_IM(convo), gaim_connection_get_display_name(gc), | 125 gaim_conv_im_write(GAIM_CONV_IM(convo), gaim_connection_get_display_name(gc), |
167 GaimConversation *convo; | 167 GaimConversation *convo; |
168 | 168 |
169 if (!args || !args[0]) | 169 if (!args || !args[0]) |
170 return 0; | 170 return 0; |
171 | 171 |
172 convo = gaim_find_conversation_with_account(GAIM_CONV_CHAT, target, irc->account); | 172 convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, target, irc->account); |
173 if (!convo) | 173 if (!convo) |
174 return 0; | 174 return 0; |
175 | 175 |
176 if (args[1]) | 176 if (args[1]) |
177 buf = irc_format(irc, "vcn:", "KICK", target, args[0], args[1]); | 177 buf = irc_format(irc, "vcn:", "KICK", target, args[0], args[1]); |
395 GaimConnection *gc; | 395 GaimConnection *gc; |
396 | 396 |
397 if (!args || !args[0]) | 397 if (!args || !args[0]) |
398 return 0; | 398 return 0; |
399 | 399 |
400 convo = gaim_conversation_new(GAIM_CONV_IM, irc->account, args[0]); | 400 convo = gaim_conversation_new(GAIM_CONV_TYPE_IM, irc->account, args[0]); |
401 | 401 |
402 if (args[1]) { | 402 if (args[1]) { |
403 gc = gaim_account_get_connection(irc->account); | 403 gc = gaim_account_get_connection(irc->account); |
404 irc_cmd_privmsg(irc, cmd, target, args); | 404 irc_cmd_privmsg(irc, cmd, target, args); |
405 gaim_conv_im_write(GAIM_CONV_IM(convo), gaim_connection_get_display_name(gc), | 405 gaim_conv_im_write(GAIM_CONV_IM(convo), gaim_connection_get_display_name(gc), |
447 GaimConversation *convo; | 447 GaimConversation *convo; |
448 | 448 |
449 if (!args) | 449 if (!args) |
450 return 0; | 450 return 0; |
451 | 451 |
452 convo = gaim_find_conversation_with_account(GAIM_CONV_CHAT, target, irc->account); | 452 convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, target, irc->account); |
453 if (!convo) | 453 if (!convo) |
454 return 0; | 454 return 0; |
455 | 455 |
456 if (!args[0]) { | 456 if (!args[0]) { |
457 topic = gaim_conv_chat_get_topic (GAIM_CONV_CHAT(convo)); | 457 topic = gaim_conv_chat_get_topic (GAIM_CONV_CHAT(convo)); |