[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:18:34 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=0745f3f

The following commit has been merged in the master branch:
commit 0745f3f19a2f9f05a0cdf39d5b413b15fe582ada
Author: George Kiagiadakis <george.kiagiadakis at collabora.co.uk>
Date:   Sun Jan 30 20:09:08 2011 +0200

    Catch contact alias changes.
---
 lib/chatwindow.cpp | 31 +++++++++++++++++++++++++++++++
 lib/chatwindow.h   |  2 ++
 2 files changed, 33 insertions(+)

diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index 0409d3d..32268e4 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -128,6 +128,8 @@ void ChatWindow::init()
     ChannelContactList* contactList = new ChannelContactList(d->channel, this);
     connect(contactList, SIGNAL(contactPresenceChanged(Tp::ContactPtr,Tp::Presence)),
             SLOT(onContactPresenceChange(Tp::ContactPtr,Tp::Presence)));
+    connect(contactList, SIGNAL(contactAliasChanged(Tp::ContactPtr,QString)),
+            SLOT(onContactAliasChanged(Tp::ContactPtr,QString)));
 
     AdiumThemeHeaderInfo info;
     Tp::Contacts allContacts = d->channel->groupContacts();
@@ -452,6 +454,35 @@ void ChatWindow::onContactPresenceChange(const Tp::ContactPtr & contact, const T
     }
 }
 
+void ChatWindow::onContactAliasChanged(const Tp::ContactPtr & contact, const QString& alias)
+{
+    QString message;
+    bool isYou = (contact == d->channel->groupSelfContact());
+
+    if (isYou) {
+        message = i18n("You are now known as %1", alias);
+    } else if (!d->isGroupChat) {
+        //HACK the title is the contact alias on non-groupchats,
+        //but we should have a better way of keeping the previous
+        //aliases of all contacts
+        message = i18n("%1 is now known as %2", d->title, alias);
+    }
+
+    if (!message.isEmpty()) {
+        AdiumThemeStatusInfo statusMessage;
+        statusMessage.setMessage(message);
+        statusMessage.setStatus(QString());
+        statusMessage.setService(d->channel->connection()->protocolName());
+        statusMessage.setTime(QDateTime::currentDateTime());
+        d->ui.chatArea->addStatusMessage(statusMessage);
+    }
+
+    //if in a non-group chat situation, and the other contact has changed alias...
+    if (!d->isGroupChat && !isYou) {
+        Q_EMIT titleChanged(alias);
+    }
+}
+
 void ChatWindow::onInputBoxChanged()
 {
     //if the box is empty
diff --git a/lib/chatwindow.h b/lib/chatwindow.h
index 1e4db5a..f7b812c 100644
--- a/lib/chatwindow.h
+++ b/lib/chatwindow.h
@@ -61,6 +61,8 @@ protected slots:
 
     void onContactPresenceChange(const Tp::ContactPtr & contact, const Tp::Presence & presence);
 
+    void onContactAliasChanged(const Tp::ContactPtr & contact, const QString & alias);
+
     void onInputBoxChanged();
 
     void chatViewReady();

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list