comparison src/server.c @ 8999:8f838ae3e710

[gaim-migrate @ 9774] " This patch renames the existing received-*-msg signals to receiving-*msg to fit the naming of other signals where a pointer to the message is passed (writing, sending, displaying) It adds new received-*-msg signals which are emitted after the receiving signals, in line with the other conversation signals (wrote, sent, displayed) This is necessary to allow plugins which depend on the final received message to work alongside plugins which may modify the message. One known example of this is festival-gaim alongside gaim-encryption - festival-gaim would try to "speak" the encrypted text: http://sf.net/tracker/?func=detail&aid=943216&group_id=89763&atid=591320 I've tested this with gaim-encryption and festival-gaim (locally modified so gaim-encryption uses the receiving signal and festival uses the received signal) All in-tree users of received-*-msg are updated to use receiving-*-msg if they do modify the message, the conversation-signals documentation is updated, the signals-test.c & signal-test.tcl plugins are also updated." --Stu Tomlinson committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 21 May 2004 14:33:32 +0000
parents 80b4c956d7ae
children cde9fb3546ed
comparison
equal deleted inserted replaced
8998:3738d1eac0ad 8999:8f838ae3e710
825 strcpy(buffy, msg); 825 strcpy(buffy, msg);
826 angel = g_strdup(who); 826 angel = g_strdup(who);
827 827
828 plugin_return = GPOINTER_TO_INT( 828 plugin_return = GPOINTER_TO_INT(
829 gaim_signal_emit_return_1(gaim_conversations_get_handle(), 829 gaim_signal_emit_return_1(gaim_conversations_get_handle(),
830 "received-im-msg", gc->account, 830 "receiving-im-msg", gc->account,
831 &angel, &buffy, &imflags)); 831 &angel, &buffy, &imflags));
832 832
833 if (!buffy || !angel || plugin_return) { 833 if (!buffy || !angel || plugin_return) {
834 if (buffy) 834 if (buffy)
835 g_free(buffy); 835 g_free(buffy);
836 if (angel) 836 if (angel)
837 g_free(angel); 837 g_free(angel);
838 return; 838 return;
839 } 839 }
840
840 name = angel; 841 name = angel;
841
842 message = buffy; 842 message = buffy;
843
844 gaim_signal_emit(gaim_conversations_get_handle(), "received-im-msg", gc->account,
845 name, message, imflags);
843 846
844 /* Make sure URLs are clickable */ 847 /* Make sure URLs are clickable */
845 buffy = gaim_markup_linkify(message); 848 buffy = gaim_markup_linkify(message);
846 g_free(message); 849 g_free(message);
847 message = buffy; 850 message = buffy;
1483 strcpy(buffy, message); 1486 strcpy(buffy, message);
1484 angel = g_strdup(who); 1487 angel = g_strdup(who);
1485 1488
1486 plugin_return = GPOINTER_TO_INT( 1489 plugin_return = GPOINTER_TO_INT(
1487 gaim_signal_emit_return_1(gaim_conversations_get_handle(), 1490 gaim_signal_emit_return_1(gaim_conversations_get_handle(),
1488 "received-chat-msg", g->account, 1491 "receiving-chat-msg", g->account,
1489 &angel, &buffy, conv)); 1492 &angel, &buffy, conv));
1490 1493
1491 if (!buffy || !angel || plugin_return) { 1494 if (!buffy || !angel || plugin_return) {
1492 if (buffy) 1495 if (buffy)
1493 g_free(buffy); 1496 g_free(buffy);
1496 return; 1499 return;
1497 } 1500 }
1498 who = angel; 1501 who = angel;
1499 message = buffy; 1502 message = buffy;
1500 1503
1504 gaim_signal_emit(gaim_conversations_get_handle(), "received-chat-msg", g->account,
1505 who, message, conv);
1506
1501 /* Make sure URLs are clickable */ 1507 /* Make sure URLs are clickable */
1502 buf = gaim_markup_linkify(message); 1508 buf = gaim_markup_linkify(message);
1503 1509
1504 if (whisper) 1510 if (whisper)
1505 w = GAIM_MESSAGE_WHISPER; 1511 w = GAIM_MESSAGE_WHISPER;