[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Btelepathy-chat-handler=5D_lib=3A_Refactor_header_co?=
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2011-07-02 14:09:49
Message-ID: 20110702140949.C9216A60AE () git ! kde ! org
[Download RAW message or body]

Git commit 549a523d958d52a9a6f8b0964b8b3ff03701ef06 by David Edmundson.
Committed on 02/07/2011 at 13:50.
Pushed by davidedmundson into branch 'master'.

Refactor header code for group chat situations.
Show channel ID in header.

M  +6    -8    lib/chat-widget.cpp     

http://commits.kde.org/telepathy-chat-handler/549a523d958d52a9a6f8b0964b8b3ff03701ef06

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index a418af4..8cb26b7 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -161,8 +161,13 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
 
     AdiumThemeHeaderInfo info;
     Tp::Contacts allContacts = d->channel->groupContacts();
+
     //normal chat - self and one other person.
-    if (allContacts.size() == 2) {
+    if (d->isGroupChat) {
+        info.setChatName(d->channel->targetId());
+    }
+    else
+    {
         //find the other contact which isn't self.
         foreach(const Tp::ContactPtr & it, allContacts) {
             if (it == d->channel->groupSelfContact()) {
@@ -174,13 +179,6 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
                 info.setIncomingIconPath(it->avatarData().fileName);
             }
         }
-    } else {
-        //some sort of group chat scenario.. Not sure how to create this yet.
-        info.setChatName("Group Chat");
-        d->isGroupChat = true;
-    }
-
-    if (!d->isGroupChat) {
         d->ui.contactsView->hide();
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic