]> git.0d.be Git - empathy.git/commitdiff
theme_adium_remove_focus_marks: early return if there is no unread message
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 11 May 2011 10:14:53 +0000 (12:14 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 11 May 2011 10:16:26 +0000 (12:16 +0200)
libempathy-gtk/empathy-theme-adium.c

index 8c3aec8a02148cd2f03b1342cf93f922caa7db70..06410c528a8c3a28c65cf20d76c8383dc9abd39f 100644 (file)
@@ -571,11 +571,17 @@ theme_adium_append_event_escaped (EmpathyChatView *view,
 static void
 theme_adium_remove_focus_marks (EmpathyThemeAdium *theme)
 {
+       EmpathyThemeAdiumPriv *priv = GET_PRIV (theme);
        WebKitDOMDocument *dom;
        WebKitDOMNodeList *nodes;
        guint i;
        GError *error = NULL;
 
+       if (!priv->has_unread_message)
+               return;
+
+       priv->has_unread_message = FALSE;
+
        dom = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (theme));
        if (dom == NULL) {
                return;
@@ -928,10 +934,7 @@ theme_adium_focus_toggled (EmpathyChatView *view,
        EmpathyThemeAdiumPriv *priv = GET_PRIV (view);
 
        priv->has_focus = has_focus;
-       if (priv->has_focus) {
-               priv->has_unread_message = FALSE;
-       }
-       else {
+       if (!priv->has_focus) {
                theme_adium_remove_focus_marks (self);
        }
 }