summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Planas <roger.planas@isode.com>2016-10-27 12:54:40 (GMT)
committerTobias Markmann <tm@ayena.de>2016-11-07 10:27:34 (GMT)
commit41c771ec02682c2b344263d29f68eb6452c42dbe (patch)
tree34aa3b366e56f0e529454a8d7f9d53a136062383 /Sluift/client.cpp
parent7eab2eb9de931236b7bbc10265b963a9948492f0 (diff)
downloadswift-41c771ec02682c2b344263d29f68eb6452c42dbe.zip
swift-41c771ec02682c2b344263d29f68eb6452c42dbe.tar.bz2
Sluift: Added Carbons element convertors
Sluift was showing payloads coming from a carbon copied message as a series of dom payloads, which was not really usable. With these ElementConvertors, the payload is translated into a much more sensible table Also a minor update to both presence/message events, which now will report the 'to' as well. Seemed handy to have. Test-information: Carbons sent/received messages are formated into a meaningful table now. Change-Id: I5b8943636e09e5377bde76d16970c01df29164d6
Diffstat (limited to 'Sluift/client.cpp')
-rw-r--r--Sluift/client.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Sluift/client.cpp b/Sluift/client.cpp
index 7d0924f..6376e9d 100644
--- a/Sluift/client.cpp
+++ b/Sluift/client.cpp
@@ -12,7 +12,6 @@
#include <Swiften/Base/foreach.h>
#include <Swiften/Disco/ClientDiscoManager.h>
#include <Swiften/Elements/DiscoInfo.h>
-#include <Swiften/Elements/MAMQuery.h>
#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/Presence.h>
#include <Swiften/Elements/RawXMLPayload.h>
@@ -487,6 +486,7 @@ static void pushEvent(lua_State* L, const SluiftClient::Event& event) {
Lua::Table result = boost::assign::map_list_of
("type", std::make_shared<Lua::Value>(std::string("message")))
("from", std::make_shared<Lua::Value>(message->getFrom().toString()))
+ ("to", std::make_shared<Lua::Value>(message->getTo().toString()))
("body", std::make_shared<Lua::Value>(message->getBody().get_value_or("")))
("message_type", std::make_shared<Lua::Value>(MessageConvertor::convertMessageTypeToString(message->getType())));
Lua::pushValue(L, result);
@@ -499,6 +499,7 @@ static void pushEvent(lua_State* L, const SluiftClient::Event& event) {
Lua::Table result = boost::assign::map_list_of
("type", std::make_shared<Lua::Value>(std::string("presence")))
("from", std::make_shared<Lua::Value>(presence->getFrom().toString()))
+ ("to", std::make_shared<Lua::Value>(presence->getTo().toString()))
("status", std::make_shared<Lua::Value>(presence->getStatus()))
("presence_type", std::make_shared<Lua::Value>(PresenceConvertor::convertPresenceTypeToString(presence->getType())));
Lua::pushValue(L, result);