Mercurial > pidgin
comparison libpurple/server.c @ 26499:5617edc6c7a5
Set PURPLE_MESSAGE_RECV before receiving-im-msg. Also set it when receiving chat messages.
author | Richard Nelson <wabz@pidgin.im> |
---|---|
date | Mon, 06 Apr 2009 10:33:28 +0000 |
parents | 584063555949 |
children | fb44acfae441 |
comparison
equal
deleted
inserted
replaced
26498:246081d2d990 | 26499:5617edc6c7a5 |
---|---|
585 | 585 |
586 g_return_if_fail(msg != NULL); | 586 g_return_if_fail(msg != NULL); |
587 | 587 |
588 account = purple_connection_get_account(gc); | 588 account = purple_connection_get_account(gc); |
589 | 589 |
590 /* | |
591 * XXX: Should we be setting this here, or relying on prpls to set it? | |
592 */ | |
593 flags |= PURPLE_MESSAGE_RECV; | |
594 | |
590 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { | 595 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { |
591 /* protocol does not support privacy, handle it ourselves */ | 596 /* protocol does not support privacy, handle it ourselves */ |
592 if (!purple_privacy_check(account, who)) { | 597 if (!purple_privacy_check(account, who)) { |
593 purple_signal_emit(purple_conversations_get_handle(), "blocked-im-msg", | 598 purple_signal_emit(purple_conversations_get_handle(), "blocked-im-msg", |
594 account, who, msg, flags, (unsigned int)mtime); | 599 account, who, msg, flags, (unsigned int)mtime); |
627 name, message, conv, flags); | 632 name, message, conv, flags); |
628 | 633 |
629 /* search for conversation again in case it was created by received-im-msg handler */ | 634 /* search for conversation again in case it was created by received-im-msg handler */ |
630 if (conv == NULL) | 635 if (conv == NULL) |
631 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account); | 636 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account); |
632 | |
633 /* | |
634 * XXX: Should we be setting this here, or relying on prpls to set it? | |
635 */ | |
636 flags |= PURPLE_MESSAGE_RECV; | |
637 | 637 |
638 if (conv == NULL) | 638 if (conv == NULL) |
639 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); | 639 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); |
640 | 640 |
641 purple_conv_im_write(PURPLE_CONV_IM(conv), name, message, flags, mtime); | 641 purple_conv_im_write(PURPLE_CONV_IM(conv), name, message, flags, mtime); |
923 int plugin_return; | 923 int plugin_return; |
924 | 924 |
925 g_return_if_fail(who != NULL); | 925 g_return_if_fail(who != NULL); |
926 g_return_if_fail(message != NULL); | 926 g_return_if_fail(message != NULL); |
927 | 927 |
928 /* | |
929 * XXX: Should we be setting this here, or relying on prpls to set it? | |
930 */ | |
931 if (g_strcmp0(purple_account_get_username(g->account), who)) | |
932 flags |= PURPLE_MESSAGE_RECV; | |
933 | |
928 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { | 934 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { |
929 conv = (PurpleConversation *)bcs->data; | 935 conv = (PurpleConversation *)bcs->data; |
930 | 936 |
931 chat = PURPLE_CONV_CHAT(conv); | 937 chat = PURPLE_CONV_CHAT(conv); |
932 | 938 |