| 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 (purple_conversation_get_type(convo) == PURPLE_CONV_TYPE_IM) |
44 purple_conversation_write_message(convo, "", buf, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
| 45 purple_im_conversation_write_message(PURPLE_CONV_IM(convo), "", buf, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
|
| 46 else |
|
| 47 purple_chat_conversation_write_message(PURPLE_CONV_CHAT(convo), "", buf, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
|
| 48 g_free(buf); |
45 g_free(buf); |
| 49 |
46 |
| 50 return 1; |
47 return 1; |
| 51 } |
48 } |
| 52 |
49 |
| 137 escaped = g_markup_escape_text(args[0], -1); |
134 escaped = g_markup_escape_text(args[0], -1); |
| 138 action = g_strdup_printf("/me %s", escaped); |
135 action = g_strdup_printf("/me %s", escaped); |
| 139 g_free(escaped); |
136 g_free(escaped); |
| 140 if (action[strlen(action) - 1] == '\n') |
137 if (action[strlen(action) - 1] == '\n') |
| 141 action[strlen(action) - 1] = '\0'; |
138 action[strlen(action) - 1] = '\0'; |
| 142 if (purple_conversation_get_type(convo) == PURPLE_CONV_TYPE_CHAT) |
139 if (PURPLE_IS_CHAT_CONVERSATION(convo)) |
| 143 serv_got_chat_in(gc, purple_chat_conversation_get_id(PURPLE_CONV_CHAT(convo)), |
140 serv_got_chat_in(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(convo)), |
| 144 purple_connection_get_display_name(gc), |
141 purple_connection_get_display_name(gc), |
| 145 PURPLE_MESSAGE_SEND, action, time(NULL)); |
142 PURPLE_MESSAGE_SEND, action, time(NULL)); |
| 146 else |
143 else |
| 147 purple_im_conversation_write_message(PURPLE_CONV_IM(convo), purple_connection_get_display_name(gc), |
144 purple_conversation_write_message(convo, purple_connection_get_display_name(gc), |
| 148 action, PURPLE_MESSAGE_SEND, time(NULL)); |
145 action, PURPLE_MESSAGE_SEND, time(NULL)); |
| 149 g_free(action); |
146 g_free(action); |
| 150 } |
147 } |
| 151 |
148 |
| 152 return 1; |
149 return 1; |
| 456 purple_conversation_present(convo); |
453 purple_conversation_present(convo); |
| 457 |
454 |
| 458 if (args[1]) { |
455 if (args[1]) { |
| 459 gc = purple_account_get_connection(irc->account); |
456 gc = purple_account_get_connection(irc->account); |
| 460 irc_cmd_privmsg(irc, cmd, target, args); |
457 irc_cmd_privmsg(irc, cmd, target, args); |
| 461 purple_im_conversation_write_message(PURPLE_CONV_IM(convo), purple_connection_get_display_name(gc), |
458 purple_conversation_write_message(convo, purple_connection_get_display_name(gc), |
| 462 args[1], PURPLE_MESSAGE_SEND, time(NULL)); |
459 args[1], PURPLE_MESSAGE_SEND, time(NULL)); |
| 463 } |
460 } |
| 464 |
461 |
| 465 return 0; |
462 return 0; |
| 466 } |
463 } |
| 525 convo = purple_conversations_find_chat_with_account(target, irc->account); |
522 convo = purple_conversations_find_chat_with_account(target, irc->account); |
| 526 if (!convo) |
523 if (!convo) |
| 527 return 0; |
524 return 0; |
| 528 |
525 |
| 529 if (!args[0]) { |
526 if (!args[0]) { |
| 530 topic = purple_chat_conversation_get_topic (PURPLE_CONV_CHAT(convo)); |
527 topic = purple_chat_conversation_get_topic (PURPLE_CHAT_CONVERSATION(convo)); |
| 531 |
528 |
| 532 if (topic) { |
529 if (topic) { |
| 533 char *tmp, *tmp2; |
530 char *tmp, *tmp2; |
| 534 tmp = g_markup_escape_text(topic, -1); |
531 tmp = g_markup_escape_text(topic, -1); |
| 535 tmp2 = purple_markup_linkify(tmp); |
532 tmp2 = purple_markup_linkify(tmp); |
| 536 buf = g_strdup_printf(_("current topic is: %s"), tmp2); |
533 buf = g_strdup_printf(_("current topic is: %s"), tmp2); |
| 537 g_free(tmp); |
534 g_free(tmp); |
| 538 g_free(tmp2); |
535 g_free(tmp2); |
| 539 } else |
536 } else |
| 540 buf = g_strdup(_("No topic is set")); |
537 buf = g_strdup(_("No topic is set")); |
| 541 purple_chat_conversation_write_message(PURPLE_CONV_CHAT(convo), target, buf, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
538 purple_conversation_write_message(convo, target, buf, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL)); |
| 542 g_free(buf); |
539 g_free(buf); |
| 543 |
540 |
| 544 return 0; |
541 return 0; |
| 545 } |
542 } |
| 546 |
543 |