[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:08:25 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=33e8493
The following commit has been merged in the master branch:
commit 33e849367a20a06adf416c54e6737808678f8b2d
Author: Marcin Ziemiński <zieminn at gmail.com>
Date: Wed Aug 20 15:55:41 2014 +0200
Do not emit messageSent signal when the policy is ALWAYS and the user is trying to send an unencrypted message.
Signed-off-by: Marcin Ziemiński <zieminn at gmail.com>
---
otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp | 30 +++++++++++++++---------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp b/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp
index 9fd2681..b506853 100644
--- a/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp
+++ b/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp
@@ -240,6 +240,8 @@ void OtrProxyChannel::Adaptee::sendOTRmessage(const OTR::Message &message)
void OtrProxyChannel::Adaptee::sendMessage(const Tp::MessagePartList &message, uint flags,
const Tp::Service::ChannelProxyInterfaceOTRAdaptor::SendMessageContextPtr &context)
{
+ kDebug();
+
if(!connected()) {
context->setFinishedWithError(KTP_PROXY_ERROR_NOT_CONNECTED, QString::fromLatin1("Proxy is not connected"));
return;
@@ -248,22 +250,28 @@ void OtrProxyChannel::Adaptee::sendMessage(const Tp::MessagePartList &message, u
OTR::Message otrMessage(message);
const OTR::CryptResult cres = otrSes.encrypt(otrMessage);
if(cres == OTR::CryptResult::ERROR) {
+ kDebug() << "Sending error";
context->setFinishedWithError(KTP_PROXY_ERROR_ENCRYPTION_ERROR,
QLatin1String("Message could not be encrypted with OTR"));
return;
}
- kDebug();
- PendingSendMessageResult *pending = new PendingSendMessageResult(
- chan->send(otrMessage.parts(), (Tp::MessageSendingFlags) flags),
- chan,
- context,
- message,
- flags);
-
- connect(pending,
- SIGNAL(finished(Tp::PendingOperation*)),
- SLOT(onPendingSendFinished(Tp::PendingOperation*)));
+ // we are starting an AKE - do not show it to the user
+ // policy is probably set to ALWAYS in this case
+ if(otrl_proto_message_type(otrMessage.text().toLocal8Bit()) == OTRL_MSGTYPE_QUERY) {
+ sendOTRmessage(otrMessage);
+ } else {
+ PendingSendMessageResult *pending = new PendingSendMessageResult(
+ chan->send(otrMessage.parts(), (Tp::MessageSendingFlags) flags),
+ chan,
+ context,
+ message,
+ flags);
+
+ connect(pending,
+ SIGNAL(finished(Tp::PendingOperation*)),
+ SLOT(onPendingSendFinished(Tp::PendingOperation*)));
+ }
}
void OtrProxyChannel::Adaptee::acknowledgePendingMessages(const Tp::UIntList &ids,
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list