diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.h')
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index f1e0f97f44..348d2a213a 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -74,10 +74,42 @@ struct CChatMark CMStringA szId, szFrom;
};
+
+
struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
{
friend struct ThreadData;
+ struct XmppMsg
+ {
+ friend struct ThreadData;
+ friend struct CJabberProto;
+ ~XmppMsg() {}
+ XmppMsg(const TiXmlElement* _node, ThreadData* _info, CJabberProto *proto):
+ node(_node), info(_info), m_proto(proto)
+ {
+ from = XmlGetAttr(node, "from"), type = XmlGetAttr(node, "type"),
+ idStr = XmlGetAttr(node, "id");
+ }
+ time_t extract_timestamp();
+ void process();
+ void handle_mam();
+ void handle_carbon();
+ void handle_omemo();
+ void handle_chatstates();
+ void add_to_db();
+
+ private:
+ time_t msgTime = 0;
+ bool bEnableDelivery = true, bCreateRead = false, bWasSent = false;
+ const char* from = nullptr, * type = nullptr,
+ * idStr = nullptr, * szMamMsgId = nullptr;
+ ThreadData* info = nullptr;
+ const TiXmlElement* node = nullptr;
+
+ CJabberProto* m_proto;
+ MCONTACT hContact;
+ };
class CJabberProtoImpl
{
friend struct CJabberProto;
@@ -829,6 +861,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void OnProcessChallenge(const TiXmlElement *node, ThreadData *info);
void OnProcessProceed(const TiXmlElement *node, ThreadData *info);
void OnProcessCompressed(const TiXmlElement *node, ThreadData *info);
+ //message processing helpers
void OnProcessMessage(const TiXmlElement *node, ThreadData *info);
void OnProcessPresence(const TiXmlElement *node, ThreadData *info);
void OnProcessPresenceCapabilites(const TiXmlElement *node, pResourceStatus &resource);
|