[polari] room: Change highlighting behavior of private chats



commit a8f513620dcf337ad84e3147d9db39a847ec7769
Author: Daronion <stefanosdimos 98 gmail com>
Date:   Wed Mar 27 23:55:46 2019 +0200

    room: Change highlighting behavior of private chats
    
    We never highlight any messages in private chats, not least
    because we assume that the desktop handles notifications for
    them. That assumption isn't necessarily true (not even for
    GNOME anymore), so this is a good opportunity to reflect what
    behavior we actually want for private chats:
    
     - show notifications for any message (either by the desktop or
       ourselves)
    
     - highlight any unread message in the sidebar
    
     - don't highlight any message in the chat log (because a bold
       font weight isn't effective when used for everything)
    
    Only the last point matches what should_highlight() currently does,
    however as conceptually *all* private messages are important, it
    makes more sense reflect that in the method and special-case the
    caller in chatView.
    
    https://gitlab.gnome.org/GNOME/polari/issues/18

 src/chatView.js       | 2 +-
 src/lib/polari-room.c | 2 +-
 src/roomList.js       | 2 --
 3 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index f99ae3b..6fc807c 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1296,7 +1296,7 @@ var ChatView = GObject.registerClass({
             tags.push(this._lookupTag('message'));
         }
 
-        if (highlight)
+        if (highlight && this._room.type != Tp.HandleType.CONTACT)
             tags.push(this._lookupTag('highlight'));
 
         let params = this._room.account.dup_parameters_vardict().deep_unpack();
diff --git a/src/lib/polari-room.c b/src/lib/polari-room.c
index a9cd67b..329f65e 100644
--- a/src/lib/polari-room.c
+++ b/src/lib/polari-room.c
@@ -143,7 +143,7 @@ polari_room_should_highlight_message (PolariRoom *room,
   priv = room->priv;
 
   if (priv->type != TP_HANDLE_TYPE_ROOM)
-    return FALSE;
+    return TRUE;
 
   if (match_self_nick (room, sender))
     return FALSE;
diff --git a/src/roomList.js b/src/roomList.js
index 03492ed..f742024 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -102,8 +102,6 @@ var RoomRow = GObject.registerClass({
 
         let pending = this._room.channel.dup_pending_messages();
         let nPending = pending.length;
-        if (!this._room.channel.has_interface(Tp.IFACE_CHANNEL_INTERFACE_GROUP))
-            return [nPending, nPending];
 
         let highlights = pending.filter(m => {
             let [text] = m.to_text();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]