[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:30 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=1ca273d
The following commit has been merged in the master branch:
commit 1ca273dca3dcab2c85ad04446c844334474e7794
Author: Lasath Fernando <kde at lasath.org>
Date: Sun Mar 3 15:00:51 2013 +1100
Add outgoing constructor to KTp::Message
The only distinction from the others is the fact that this takes
a QString rather than an exisiting message format - hopefully that
will be enough.
---
KTp/message.cpp | 17 +++++++++++++++++
KTp/message.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/KTp/message.cpp b/KTp/message.cpp
index a7bc6c2..31bfec6 100644
--- a/KTp/message.cpp
+++ b/KTp/message.cpp
@@ -120,6 +120,23 @@ Message::Message(const Tpl::TextEventPtr &original, const KTp::MessageContext &c
setMainMessagePart(original->message());
}
+Message::Message(const QString &messageText, const MessageContext &context) :
+ d(new Private)
+{
+ d->sentTime = QDateTime::currentDateTime();
+ d->messageType = Tp::ChannelTextMessageTypeNormal;
+ d->direction = LocalToRemote;
+ d->isHistory = false;
+
+ setProperty("senderName", context.account()->nickname());
+ setProperty("senderId", context.account()->
+ connection()->selfContact()->id());
+ setProperty("senderAvatar", context.account()->
+ connection()->selfContact()->avatarData().fileName);
+
+ setMainMessagePart(messageText);
+}
+
Message::Message(const Message& other):
d(other.d)
{
diff --git a/KTp/message.h b/KTp/message.h
index 796d5ea..812c90e 100644
--- a/KTp/message.h
+++ b/KTp/message.h
@@ -152,6 +152,7 @@ protected:
Message(const Tp::Message &original, const KTp::MessageContext &context);
Message(const Tp::ReceivedMessage &original, const KTp::MessageContext &context);
Message(const Tpl::TextEventPtr &original, const KTp::MessageContext &context);
+ explicit Message(const QString &messageText, const KTp::MessageContext &context);
private:
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list