Mercurial > pidgin
diff plugins/statenotify.c @ 13476:465c368366f8
[gaim-migrate @ 15852]
Add GAIM_MESSAGE_ACTIVE_ONLY:
This allows core plugins to hint to the UI that it should not show a message if a conversation is "inactive". For the GTK+ UI, this means conversations that aren't the active conversation in a contact-aware conversation.
With the GTK+ UI, to avoid having such a message logged, you need to either call gaim_conv_im_write() (which will drop the message before logging, or allow it through for both logging and displaying) or set the GAIM_MESSAGE_NO_LOG flag (which obviously suppresses all logging). Look at the Buddy State Notification and Psychic plugins for the examples of each of these techniques, respectively.
This fixes a ShowStopperBug.
Also, rearrange some stuff in gtkconv.c to make things more clear and remove unused code.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Thu, 09 Mar 2006 04:02:09 +0000 |
| parents | e856f985a0b9 |
| children |
line wrap: on
line diff
--- a/plugins/statenotify.c Thu Mar 09 03:11:50 2006 +0000 +++ b/plugins/statenotify.c Thu Mar 09 04:02:09 2006 +0000 @@ -25,6 +25,7 @@ if (conv == NULL) return; + g_return_if_fail(conv->type == GAIM_CONV_TYPE_IM); who = gaim_buddy_get_alias(buddy); escaped = g_markup_escape_text(who, -1); @@ -32,7 +33,7 @@ g_snprintf(buf, sizeof(buf), message, escaped); g_free(escaped); - gaim_conversation_write(conv, NULL, buf, GAIM_MESSAGE_SYSTEM, time(NULL)); + gaim_conv_im_write(conv->u.im, NULL, buf, GAIM_MESSAGE_SYSTEM | GAIM_MESSAGE_ACTIVE_ONLY, time(NULL)); } static void
