[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:29 UTC 2016


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

The following commit has been merged in the master branch:
commit 5fb89683ce8ca1993d1dd71e89da0fa27e14091d
Author: Lasath Fernando <kde at lasath.org>
Date:   Sat Mar 2 03:06:50 2013 -0500

    Add senderId as property to KTp::Message
---
 KTp/message.cpp | 9 +++++++++
 KTp/message.h   | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/KTp/message.cpp b/KTp/message.cpp
index 0218a5c..1b409d3 100644
--- a/KTp/message.cpp
+++ b/KTp/message.cpp
@@ -66,6 +66,8 @@ Message::Message(const Tp::Message &original, const KTp::MessageContext &context
 
     setProperty("senderName", context.account()->nickname());
     setProperty("senderAvatar", context.account()->avatar().avatarData);
+    setProperty("senderId",
+                context.account()->connection()->selfContact()->id());
 }
 
 Message::Message(const Tp::ReceivedMessage &original, const KTp::MessageContext &context) :
@@ -88,6 +90,7 @@ Message::Message(const Tp::ReceivedMessage &original, const KTp::MessageContext
     if (!original.sender().isNull()) {
         setProperty("senderName", original.sender()->alias());
         setProperty("senderAvatar", original.sender()->avatarData().fileName);
+        setProperty("senderId", original.sender()->id());
     } else {
         setProperty("senderName", original.senderNickname());
     }
@@ -111,6 +114,7 @@ Message::Message(const Tpl::TextEventPtr &original, const KTp::MessageContext &c
 
     setProperty("senderName", original->sender()->alias());
     setProperty("senderAvatar", original->sender()->avatarToken());
+    setProperty("senderId", original->sender()->identifier());
 }
 
 Message::Message(const Message& other):
@@ -201,6 +205,11 @@ QString Message::senderName() const
     return property("senderName").toString();
 }
 
+QString Message::senderId() const
+{
+    return property("senderId").toString();
+}
+
 int Message::partsSize() const
 {
     return d->parts.size();
diff --git a/KTp/message.h b/KTp/message.h
index 147ea53..5e914a1 100644
--- a/KTp/message.h
+++ b/KTp/message.h
@@ -137,6 +137,8 @@ class KTP_EXPORT Message
     Tp::ChannelTextMessageType type() const;
     /*! 
eturn the alias of the contact who composed this message */
     QString senderName() const;
+    /*! 
eturn the Id of the contact who composed this message */
+    QString senderId() const;
 
     /*! 
eturn the number of appended parts */
     int partsSize() const;

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list