changeset 175:c4a8afde91c0 multiaccounts

fixed a problem that a notification is not prevented when a message was written from API.
author mikanbako <maoutwo@gmail.com>
date Sat, 02 Aug 2008 12:15:05 +0900
parents 002538feba6e
children 7affa10c1f0e
files pidgin-twitter.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Sat Aug 02 11:31:37 2008 +0900
+++ b/pidgin-twitter.c	Sat Aug 02 12:15:05 2008 +0900
@@ -475,6 +475,7 @@
     PurpleConversation *conv;
     GList *stp;
     const gchar *start;
+    PurpleMessageFlags msg_flags;
 
     g_return_if_fail(url_text != NULL);
 
@@ -515,10 +516,16 @@
              gchar *msg = NULL;
 
              msg = g_strdup_printf("%s: %s", st->screen_name, st->text);
+             msg_flags = PURPLE_MESSAGE_RECV;
+
+             /* suppress notification of this writing message. */
+             if(purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION))
+                 msg_flags |= PURPLE_MESSAGE_SYSTEM;
+
              purple_conv_im_write(conv->u.im,
                                   "twitter@twitter.com",
                                   msg,
-                                  PURPLE_MESSAGE_RECV,
+                                  msg_flags,
                                   st->time);
              lastid = st->id;