diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-24 19:50:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-24 19:50:44 +0000 |
commit | f6de1e36aeeeb662a04e3287b3929a07384bf510 (patch) | |
tree | de89ca1a736fe457d805d36062513427088bbf7a /protocols/JabberG/src | |
parent | 3fed56c332215dd3a753d2fc0b31616c1b270a51 (diff) |
- IJabberNetInterface::GetHandle() method added to retrieve a network handle;
- another major clutch removed from GTalkExt;
- version.rc added;
- bunch of crap removed;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4177 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber.h | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 30 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_std.cpp | 11 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_svc.cpp | 5 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 3 |
6 files changed, 26 insertions, 31 deletions
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index 1eedf528db..d6cc3803df 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -702,10 +702,6 @@ struct JabberAdHocData TCHAR* ResponderJID;
};
-//---- jabber_std.cpp -------------------------------------------------------------------
-
-char* __fastcall JTranslate(const char* str);
-
//---- jabber_util.cpp ------------------------------------------------------------------
struct TStringPairsElem
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 9958742177..684d784dbe 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -682,9 +682,9 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact) case PFLAGNUM_4:
return PF4_FORCEAUTH | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_IMSENDUTF | PF4_FORCEADDED;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR) JTranslate("JID");
+ return (DWORD_PTR)Translate("JID");
case PFLAG_UNIQUEIDSETTING:
- return (DWORD_PTR) "jid";
+ return (DWORD_PTR)"jid";
case PFLAG_MAXCONTACTSPERPACKET:
{
DBVARIANT dbv;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 44c1e3352c..90ef79398a 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -102,30 +102,32 @@ struct CJabberSysInterface: public IJabberSysInterface struct CJabberNetInterface: public IJabberNetInterface
{
- int STDMETHODCALLTYPE GetVersion() const; // Returns version of IJabberNetInterface.
- unsigned int STDMETHODCALLTYPE SerialNext(); // Returns id that can be used for next message sent through SendXmlNode().
- int STDMETHODCALLTYPE SendXmlNode(HXML node); // Sends XML node.
+ int STDMETHODCALLTYPE GetVersion() const; // Returns version of IJabberNetInterface.
+ UINT STDMETHODCALLTYPE SerialNext(); // Returns id that can be used for next message sent through SendXmlNode().
+ int STDMETHODCALLTYPE SendXmlNode(HXML node); // Sends XML node.
// In all incoming stanza handlers, return TRUE to continue processing of the stanza (Jabber plugin will then call other handlers). Return FALSE only when you're sure noone else will need to process this stanza.
// Registers incoming <presence/> handler. Returns handler handle on success or NULL on error.
- HJHANDLER STDMETHODCALLTYPE AddPresenceHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority);
+ HJHANDLER STDMETHODCALLTYPE AddPresenceHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority);
// Registers incoming <message/> handler for messages of types specified by iMsgTypes. iMsgTypes is a combination of JABBER_MESSAGE_TYPE_* flags. Returns handler handle on success or NULL on error.
- HJHANDLER STDMETHODCALLTYPE AddMessageHandler(JABBER_HANDLER_FUNC Func, int iMsgTypes, LPCTSTR szXmlns, LPCTSTR szTag, void *pUserData, int iPriority);
+ HJHANDLER STDMETHODCALLTYPE AddMessageHandler(JABBER_HANDLER_FUNC Func, int iMsgTypes, LPCTSTR szXmlns, LPCTSTR szTag, void *pUserData, int iPriority);
// Registers incoming <iq/> handler. iIqTypes is a combination of JABBER_IQ_TYPE_* flags. Returns handler handle on success or NULL on error.
- HJHANDLER STDMETHODCALLTYPE AddIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, LPCTSTR szXmlns, LPCTSTR szTag, void *pUserData, int iPriority);
+ HJHANDLER STDMETHODCALLTYPE AddIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, LPCTSTR szXmlns, LPCTSTR szTag, void *pUserData, int iPriority);
// Registers temporary handler for incoming <iq/> stanza of type iIqType with id iIqId. iIqTypes is a combination of JABBER_IQ_TYPE_* flags. Returns handler handle on success or NULL on error. You must free pUserData in the handler by yourself.
- HJHANDLER STDMETHODCALLTYPE AddTemporaryIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, int iIqId, void *pUserData, DWORD dwTimeout, int iPriority);
+ HJHANDLER STDMETHODCALLTYPE AddTemporaryIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, int iIqId, void *pUserData, DWORD dwTimeout, int iPriority);
// Registers handler for outgoing nodes. The handler may modify the node if it's necessary. Return TRUE in the handler to continue, or FALSE to abort sending.
- HJHANDLER STDMETHODCALLTYPE AddSendHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority);
+ HJHANDLER STDMETHODCALLTYPE AddSendHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority);
// Unregisters handler by its handle.
- int STDMETHODCALLTYPE RemoveHandler(HJHANDLER hHandler);
-
- int STDMETHODCALLTYPE RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription); // Registers feature so that it's displayed with proper description in other users' details. Call this function in your ME_SYSTEM_MODULESLOADED handler. Returns TRUE on success or FALSE on error.
- int STDMETHODCALLTYPE AddFeatures(LPCTSTR szFeatures); // Adds features to the list of features returned by the client.
- int STDMETHODCALLTYPE RemoveFeatures(LPCTSTR szFeatures); // Removes features from the list of features returned by the client.
- LPTSTR STDMETHODCALLTYPE GetResourceFeatures(LPCTSTR jid); // Returns all features supported by JID in format "feature1\0feature2\0...\0featureN\0\0". You must free returned string using mir_free().
+ int STDMETHODCALLTYPE RemoveHandler(HJHANDLER hHandler);
+
+ // Registers feature so that it's displayed with proper description in other users' details. Call this function in your ME_SYSTEM_MODULESLOADED handler. Returns TRUE on success or FALSE on error.
+ int STDMETHODCALLTYPE RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription);
+ int STDMETHODCALLTYPE AddFeatures(LPCTSTR szFeatures); // Adds features to the list of features returned by the client.
+ int STDMETHODCALLTYPE RemoveFeatures(LPCTSTR szFeatures); // Removes features from the list of features returned by the client.
+ LPTSTR STDMETHODCALLTYPE GetResourceFeatures(LPCTSTR jid); // Returns all features supported by JID in format "feature1\0feature2\0...\0featureN\0\0". You must free returned string using mir_free().
+ HANDLE STDMETHODCALLTYPE GetHandle(); // Returns connection handle
CJabberProto *m_psProto;
diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index 5aacd4cc11..9d4ae894fd 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -202,16 +202,10 @@ DWORD CJabberProto::JSetWord(HANDLE hContact, const char* valueName, int parValu return db_set_w(hContact, m_szModuleName, valueName, parValue);
}
-char* __fastcall JTranslate(const char* str)
-{
- return Translate(str);
-}
-
// save/load crypted strings
void __forceinline sttCryptString(char *str)
{
- for (;*str; ++str)
- {
+ for (;*str; ++str) {
const char c = *str ^ 0xc3;
if (c) *str = c;
}
@@ -220,14 +214,11 @@ void __forceinline sttCryptString(char *str) TCHAR* CJabberProto::JGetStringCrypt(HANDLE hContact, char *valueName)
{
DBVARIANT dbv;
-
if ( DBGetContactSettingString(hContact, m_szModuleName, valueName, &dbv))
return NULL;
sttCryptString(dbv.pszVal);
WCHAR *res = mir_utf8decodeW(dbv.pszVal);
-
-
db_free(&dbv);
return res;
}
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 0e1e12c2b2..fa1ebe4188 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -1131,3 +1131,8 @@ LPTSTR CJabberNetInterface::GetResourceFeatures(LPCTSTR jid) }
return NULL;
}
+
+HANDLE CJabberNetInterface::GetHandle()
+{
+ return m_psProto->m_hNetlibUser;
+}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index eb0e65926f..7edfdb49b2 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -381,7 +381,8 @@ LBL_FatalError: _tcsncpy(info->password, passw, SIZEOF(info->password));
info->password[SIZEOF(info->password)-1] = '\0';
mir_free(passw);
- } }
+ }
+ }
else if (info->type == JABBER_SESSION_REGISTER) {
// Register new user connection, all connection parameters are already filled-in.
|