summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_caps.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-10 19:14:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-10 19:14:19 +0300
commit3d83eeec481c25253e2535e7ce9476e3f046123a (patch)
treec0cc9f3ffc49a79f510fcff8658fb9baaba99605 /protocols/JabberG/src/jabber_caps.h
parente98d9da63ab340e4fdaf2fa2cd4037e4b7f0a498 (diff)
Jabber:
- more fixes for XEP-115 support; - obsolete code removed;
Diffstat (limited to 'protocols/JabberG/src/jabber_caps.h')
-rwxr-xr-xprotocols/JabberG/src/jabber_caps.h73
1 files changed, 36 insertions, 37 deletions
diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h
index 503e0f3146..eaf9875891 100755
--- a/protocols/JabberG/src/jabber_caps.h
+++ b/protocols/JabberG/src/jabber_caps.h
@@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _JABBER_CAPS_H_
#define _JABBER_CAPS_H_
-#include "jabber_iq.h"
-
typedef unsigned __int64 JabberCapsBits;
#define JABBER_RESOURCE_CAPS_QUERY_TIMEOUT 10000
@@ -211,16 +209,16 @@ typedef unsigned __int64 JabberCapsBits;
class CJabberClientPartialCaps
{
-
-protected:
- wchar_t *m_szVer;
+ ptrW m_szHash, m_szOs, m_szOsVer, m_szSoft, m_szSoftVer, m_szSoftMir;
JabberCapsBits m_jcbCaps;
- CJabberClientPartialCaps *m_pNext;
int m_nIqId;
DWORD m_dwRequestTime;
+ class CJabberClientCaps *m_parent;
+ CJabberClientPartialCaps *m_pNext;
+
public:
- CJabberClientPartialCaps(const wchar_t *szVer);
+ CJabberClientPartialCaps(CJabberClientCaps *pParent, const wchar_t *szHash, const wchar_t *szVer);
~CJabberClientPartialCaps();
CJabberClientPartialCaps* SetNext(CJabberClientPartialCaps *pCaps);
@@ -228,54 +226,48 @@ public:
{ return m_pNext;
}
+ void Parse(HXML);
void SetCaps(JabberCapsBits jcbCaps, int nIqId = -1);
JabberCapsBits GetCaps();
- __inline wchar_t* GetVersion()
- { return m_szVer;
- }
+ __inline const wchar_t* GetHash() const { return m_szHash.get(); }
+ __inline const wchar_t* GetNode() const;
- __inline int GetIqId()
- { return m_nIqId;
- }
+ __inline const wchar_t* GetOs() const { return m_szOs.get(); }
+ __inline const wchar_t* GetOsVer() const { return m_szOsVer.get(); }
+ __inline const wchar_t* GetSoft() const { return m_szSoft.get(); }
+ __inline const wchar_t* GetSoftVer() const { return m_szSoftVer.get(); }
+ __inline const wchar_t* GetSoftMir() const { return m_szSoftMir.get(); }
+
+ __inline int GetIqId() const { return m_nIqId; }
};
class CJabberClientCaps
{
-
-protected:
wchar_t *m_szNode;
CJabberClientPartialCaps *m_pCaps;
- CJabberClientCaps *m_pNext;
-
-protected:
- CJabberClientPartialCaps* FindByVersion(const wchar_t *szVer);
- CJabberClientPartialCaps* FindById(int nIqId);
public:
CJabberClientCaps(const wchar_t *szNode);
~CJabberClientCaps();
- CJabberClientCaps* SetNext(CJabberClientCaps *pClient);
- __inline CJabberClientCaps* GetNext()
- { return m_pNext;
- }
+ CJabberClientPartialCaps* FindByVersion(const wchar_t *szHash);
+ CJabberClientPartialCaps* FindById(int nIqId);
- JabberCapsBits GetPartialCaps(wchar_t *szVer);
- BOOL SetPartialCaps(const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
- BOOL SetPartialCaps(int nIqId, JabberCapsBits jcbCaps);
+ JabberCapsBits GetPartialCaps(const wchar_t *szVer);
+ CJabberClientPartialCaps* SetPartialCaps(const wchar_t *szHash, const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
+ CJabberClientPartialCaps* SetPartialCaps(int nIqId, JabberCapsBits jcbCaps);
- __inline wchar_t* GetNode()
- { return m_szNode;
- }
+ __inline wchar_t* GetNode() const { return m_szNode; }
};
+__inline const wchar_t* CJabberClientPartialCaps::GetNode() const { return m_parent->GetNode(); }
+
class CJabberClientCapsManager
{
-
-protected:
mir_cs m_cs;
- CJabberClientCaps *m_pClients;
+ OBJLIST<CJabberClientCaps> m_arCaps;
+
CJabberProto *ppro;
CMStringW m_szFeaturesCrc;
@@ -290,11 +282,18 @@ public:
const wchar_t* GetFeaturesCrc();
void UpdateFeatHash();
- JabberCapsBits GetClientCaps(wchar_t *szNode, wchar_t *szVer);
- BOOL SetClientCaps(const wchar_t *szNode, const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
- BOOL SetClientCaps(int nIqId, JabberCapsBits jcbCaps);
+ JabberCapsBits GetClientCaps(const wchar_t *szNode, const wchar_t *szHash);
+ CJabberClientPartialCaps* GetPartialCaps(const wchar_t *szNode, const wchar_t *szHash);
+
+ CJabberClientPartialCaps* SetClientCaps(const wchar_t *szNode, const wchar_t *szHash, const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
+ CJabberClientPartialCaps* SetClientCaps(int nIqId, JabberCapsBits jcbCaps);
+
+ __inline CJabberClientPartialCaps* SetOwnCaps(const wchar_t *szNode, const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1)
+ {
+ return SetClientCaps(szNode, m_szFeaturesCrc, szVer, jcbCaps, nIqId);
+ }
- BOOL HandleInfoRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode);
+ bool HandleInfoRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode);
};
struct JabberFeatCapPair