[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:06:28 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=bd1a56e

The following commit has been merged in the master branch:
commit bd1a56e618e270ad7d86439de97dfa01eddd87cd
Author: Lasath Fernando <kde at lasath.org>
Date:   Tue Feb 26 11:57:51 2013 -0500

    Make message store sender
    
    Rather than adding more methods/attributes for it, I merely stored
    the name in property "sender", and avatar in "sender-avatar".
---
 KTp/message.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/KTp/message.cpp b/KTp/message.cpp
index 7be60e0..c87f89b 100644
--- a/KTp/message.cpp
+++ b/KTp/message.cpp
@@ -55,7 +55,11 @@ Message::Message(const Tp::Message &original, const KTp::MessageContext &context
     d->messageType = original.messageType();
     d->isHistory = false;
     d->direction = KTp::Message::LocalToRemote;
+
     setMainMessagePart(original.text());
+
+    setProperty("sender", context.account()->nickname());
+    setProperty("sender-avatar", context.account()->avatar().avatarData);
 }
 
 Message::Message(const Tp::ReceivedMessage &original, const KTp::MessageContext &context) :
@@ -69,6 +73,13 @@ Message::Message(const Tp::ReceivedMessage &original, const KTp::MessageContext
     d->direction = KTp::Message::RemoteToLocal;
 
     setMainMessagePart(original.text());
+
+    if (!original.sender().isNull()) {
+        setProperty("sender", original.sender()->alias());
+        setProperty("sender-avatar", original.sender()->avatarData().fileName);
+    } else {
+        setProperty("sender", original.senderNickname());
+    }
 }
 
 Message::Message(const Tpl::TextEventPtr &original, const KTp::MessageContext &context) :
@@ -86,6 +97,9 @@ Message::Message(const Tpl::TextEventPtr &original, const KTp::MessageContext &c
     }
 
     setMainMessagePart(original->message());
+
+    setProperty("sender", original->sender()->alias());
+    setProperty("sender-avatar", original->sender()->avatarToken());
 }
 
 Message::Message(const Message& other):

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list