diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 12:33:13 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 12:33:13 +0000 |
commit | 159b565b390687258ee65a3b66596e118752063c (patch) | |
tree | 91105378fcb9e030ba4a7f6572c4ea307cb8c8d6 /protocols/Tlen | |
parent | 7f4d529b59698d7eb2403bd1f9088a5aa7fa9080 (diff) |
replace strcmp to mir_strcmp
git-svn-id: http://svn.miranda-ng.org/main/trunk@13752 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen')
-rw-r--r-- | protocols/Tlen/src/tlen_avatar.cpp | 2 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_file.cpp | 20 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_iqid.cpp | 68 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_muc.cpp | 6 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_p2p_new.cpp | 16 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_p2p_old.cpp | 2 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_picture.cpp | 8 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_presence.cpp | 18 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_svc.cpp | 38 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_thread.cpp | 122 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_userinfo.cpp | 2 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_xml.cpp | 12 |
12 files changed, 157 insertions, 157 deletions
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index bfa27646e0..2137bf8c58 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -141,7 +141,7 @@ int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_IT } if (md5 != NULL) { /* check contact's avatar hash - md5 */ - if (oldHash == NULL || strcmp(oldHash, md5)) { + if (oldHash == NULL || mir_strcmp(oldHash, md5)) { if (item != NULL) { item->newAvatarDownloading = TRUE; } diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index 9d05fef08f..105f3785f1 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -552,7 +552,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) int numFiles;
TLEN_LIST_ITEM *item;
-// if (!node->name || strcmp(node->name, "f")) return;
+// if (!node->name || mir_strcmp(node->name, "f")) return;
if (info == NULL) return;
char *from=TlenXmlGetAttrValue(node, "f");
@@ -564,7 +564,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) }
char *e=TlenXmlGetAttrValue(node, "e");
if (e != NULL) {
- if (!strcmp(e, "1")) {
+ if (!mir_strcmp(e, "1")) {
// FILE_RECV : e='1' : File transfer request
TLEN_FILE_TRANSFER *ft = TlenFileCreateFT(info->proto, jid);
ft->hContact = TlenHContactFromJID(info->proto, jid);
@@ -610,7 +610,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) TlenP2PFreeFileTransfer(ft);
}
}
- else if (!strcmp(e, "3")) {
+ else if (!mir_strcmp(e, "3")) {
// FILE_RECV : e='3' : invalid transfer error
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, p)) != NULL) {
@@ -622,27 +622,27 @@ void TlenProcessF(XmlNode *node, ThreadData *info) }
}
}
- else if (!strcmp(e, "4")) {
+ else if (!mir_strcmp(e, "4")) {
// FILE_SEND : e='4' : File sending request was denied by the remote client
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, p)) != NULL) {
- if (!strcmp(item->ft->jid, jid)) {
+ if (!mir_strcmp(item->ft->jid, jid)) {
ProtoBroadcastAck(info->proto->m_szModuleName, item->ft->hContact, ACKTYPE_FILE, ACKRESULT_DENIED, item->ft, 0);
TlenListRemove(info->proto, LIST_FILE, p);
}
}
}
}
- else if (!strcmp(e, "5")) {
+ else if (!mir_strcmp(e, "5")) {
// FILE_SEND : e='5' : File sending request was accepted
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, p)) != NULL) {
- if (!strcmp(item->ft->jid, jid))
+ if (!mir_strcmp(item->ft->jid, jid))
forkthread((void (__cdecl *)(void*))TlenFileSendingThread, 0, item->ft);
}
}
}
- else if (!strcmp(e, "6")) {
+ else if (!mir_strcmp(e, "6")) {
// FILE_RECV : e='6' : IP and port information to connect to get file
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, p)) != NULL) {
@@ -656,7 +656,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) }
}
}
- else if (!strcmp(e, "7")) {
+ else if (!mir_strcmp(e, "7")) {
// FILE_RECV : e='7' : IP and port information to connect to send file
// in case the conection to the given server was not successful
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
@@ -673,7 +673,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) }
}
}
- else if (!strcmp(e, "8")) {
+ else if (!mir_strcmp(e, "8")) {
// FILE_RECV : e='8' : transfer error
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, p)) != NULL) {
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index 837a24d81b..e0b831b98e 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -35,7 +35,7 @@ void TlenIqResultAuth(TlenProtocol *proto, XmlNode *iqNode) if (type == NULL)
return;
- if (!strcmp(type, "result")) {
+ if (!mir_strcmp(type, "result")) {
DBVARIANT dbv;
if (db_get(NULL, proto->m_szModuleName, "Nick", &dbv))
@@ -50,7 +50,7 @@ void TlenIqResultAuth(TlenProtocol *proto, XmlNode *iqNode) TlenSend(proto, "<iq to='tcfg' type='get' id='TcfgGetAfterLoggedIn'></iq>");
}
// What to do if password error? etc...
- else if (!strcmp(type, "error")) {
+ else if (!mir_strcmp(type, "error")) {
char text[128];
TlenSend(proto, "</s>");
@@ -69,13 +69,13 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) { for (int i=0; i<queryNode->numChild; i++) {
XmlNode *itemNode = queryNode->child[i];
- if (!strcmp(itemNode->name, "item")) {
+ if (!mir_strcmp(itemNode->name, "item")) {
char *jid=TlenXmlGetAttrValue(itemNode, "jid");
if (jid != NULL) {
char *str = TlenXmlGetAttrValue(itemNode, "subscription");
if (str == NULL)
continue;
- else if (!strcmp(str, "remove")) {
+ else if (!mir_strcmp(str, "remove")) {
if ((hContact = TlenHContactFromJID(proto, jid)) != NULL) {
if (db_get_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
@@ -84,11 +84,11 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) { } else {
TLEN_LIST_ITEM *item = TlenListAdd(proto, LIST_ROSTER, jid);
if (item != NULL) {
- if (!strcmp(str, "both"))
+ if (!mir_strcmp(str, "both"))
item->subscription = SUB_BOTH;
- else if (!strcmp(str, "to"))
+ else if (!mir_strcmp(str, "to"))
item->subscription = SUB_TO;
- else if (!strcmp(str, "from"))
+ else if (!mir_strcmp(str, "from"))
item->subscription = SUB_FROM;
else
item->subscription = SUB_NONE;
@@ -113,7 +113,7 @@ void TlenResultSetRoster(TlenProtocol *proto, XmlNode *queryNode) { Clist_CreateGroup(0, _A2T(item->group));
// Don't set group again if already correct, or Miranda may show wrong group count in some case
if (!db_get(hContact, "CList", "Group", &dbv)) {
- if (strcmp(dbv.pszVal, item->group))
+ if (mir_strcmp(dbv.pszVal, item->group))
db_set_s(hContact, "CList", "Group", item->group);
db_free(&dbv);
} else
@@ -139,9 +139,9 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) XmlNode *queryNode=TlenXmlGetChild(iqNode, "query");
if (queryNode == NULL) return;
- if (!strcmp(type, "result")) {
+ if (!mir_strcmp(type, "result")) {
char *str = TlenXmlGetAttrValue(queryNode, "xmlns");
- if (str != NULL && !strcmp(str, "jabber:iq:roster")) {
+ if (str != NULL && !mir_strcmp(str, "jabber:iq:roster")) {
DBVARIANT dbv;
XmlNode *itemNode, *groupNode;
TLEN_SUBSCRIPTION sub;
@@ -151,14 +151,14 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) for (i=0; i<queryNode->numChild; i++) {
itemNode = queryNode->child[i];
- if (!strcmp(itemNode->name, "item")) {
+ if (!mir_strcmp(itemNode->name, "item")) {
str = TlenXmlGetAttrValue(itemNode, "subscription");
if (str == NULL) sub = SUB_NONE;
- else if (!strcmp(str, "both")) sub = SUB_BOTH;
- else if (!strcmp(str, "to")) sub = SUB_TO;
- else if (!strcmp(str, "from")) sub = SUB_FROM;
+ else if (!mir_strcmp(str, "both")) sub = SUB_BOTH;
+ else if (!mir_strcmp(str, "to")) sub = SUB_TO;
+ else if (!mir_strcmp(str, "from")) sub = SUB_FROM;
else sub = SUB_NONE;
- //if (str != NULL && (!strcmp(str, "to") || !strcmp(str, "both"))) {
+ //if (str != NULL && (!mir_strcmp(str, "to") || !mir_strcmp(str, "both"))) {
if ((jid=TlenXmlGetAttrValue(itemNode, "jid")) != NULL) {
if ((name=TlenXmlGetAttrValue(itemNode, "name")) != NULL)
nick = TlenTextDecode(name);
@@ -183,7 +183,7 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) Clist_CreateGroup(0, _A2T(item->group));
// Don't set group again if already correct, or Miranda may show wrong group count in some case
if (!db_get(hContact, "CList", "Group", &dbv)) {
- if (strcmp(dbv.pszVal, item->group))
+ if (mir_strcmp(dbv.pszVal, item->group))
db_set_s(hContact, "CList", "Group", item->group);
db_free(&dbv);
}
@@ -247,7 +247,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) char *type=TlenXmlGetAttrValue(iqNode, "type");
if (type == NULL) return;
- if (!strcmp(type, "result")) {
+ if (!mir_strcmp(type, "result")) {
DBVARIANT dbv;
XmlNode *queryNode=TlenXmlGetChild(iqNode, "query");
@@ -265,7 +265,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) db_free(&dbv);
if ((hContact=TlenHContactFromJID(proto, text)) == NULL) {
if (db_get(NULL, proto->m_szModuleName, "LoginName", &dbv)) return;
- if (strcmp(dbv.pszVal, jid)) {
+ if (mir_strcmp(dbv.pszVal, jid)) {
db_free(&dbv);
return;
}
@@ -279,7 +279,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) for (int i=0; i<itemNode->numChild; i++) {
XmlNode *n = itemNode->child[i];
if (n == NULL || n->name == NULL) continue;
- if (!strcmp(n->name, "first")) {
+ if (!mir_strcmp(n->name, "first")) {
if (n->text != NULL) {
hasFirst = true;
nText = TlenTextDecode(n->text);
@@ -287,7 +287,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) mir_free(nText);
}
}
- else if (!strcmp(n->name, "last")) {
+ else if (!mir_strcmp(n->name, "last")) {
if (n->text != NULL) {
hasLast = true;
nText = TlenTextDecode(n->text);
@@ -295,7 +295,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) mir_free(nText);
}
}
- else if (!strcmp(n->name, "nick")) {
+ else if (!mir_strcmp(n->name, "nick")) {
if (n->text != NULL) {
hasNick = true;
nText = TlenTextDecode(n->text);
@@ -303,7 +303,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) mir_free(nText);
}
}
- else if (!strcmp(n->name, "email")) {
+ else if (!mir_strcmp(n->name, "email")) {
if (n->text != NULL) {
hasEmail = true;
nText = TlenTextDecode(n->text);
@@ -311,7 +311,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) mir_free(nText);
}
}
- else if (!strcmp(n->name, "c")) {
+ else if (!mir_strcmp(n->name, "c")) {
if (n->text != NULL) {
hasCity = true;
nText = TlenTextDecode(n->text);
@@ -319,20 +319,20 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) mir_free(nText);
}
}
- else if (!strcmp(n->name, "b")) {
+ else if (!mir_strcmp(n->name, "b")) {
if (n->text != NULL) {
WORD nAge = atoi(n->text);
hasAge = true;
db_set_w(hContact, proto->m_szModuleName, "Age", nAge);
}
}
- else if (!strcmp(n->name, "s")) {
+ else if (!mir_strcmp(n->name, "s")) {
if (n->text != NULL && n->text[1] == '\0' && (n->text[0] == '1' || n->text[0] == '2')) {
hasGender = true;
db_set_b(hContact, proto->m_szModuleName, "Gender", (BYTE) (n->text[0] == '1'?'M':'F'));
}
}
- else if (!strcmp(n->name, "e")) {
+ else if (!mir_strcmp(n->name, "e")) {
if (n->text != NULL) {
hasSchool = true;
nText = TlenTextDecode(n->text);
@@ -340,27 +340,27 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) mir_free(nText);
}
}
- else if (!strcmp(n->name, "j")) {
+ else if (!mir_strcmp(n->name, "j")) {
if (n->text != NULL) {
hasOccupation = true;
WORD nOccupation = atoi(n->text);
db_set_w(hContact, proto->m_szModuleName, "Occupation", nOccupation);
}
}
- else if (!strcmp(n->name, "r")) {
+ else if (!mir_strcmp(n->name, "r")) {
if (n->text != NULL) {
WORD nLookFor = atoi(n->text);
hasLookFor = true;
db_set_w(hContact, proto->m_szModuleName, "LookingFor", nLookFor);
}
}
- else if (!strcmp(n->name, "g")) { // voice chat enabled
+ else if (!mir_strcmp(n->name, "g")) { // voice chat enabled
if (n->text != NULL) {
BYTE bVoice = atoi(n->text);
db_set_w(hContact, proto->m_szModuleName, "VoiceChat", bVoice);
}
}
- else if (!strcmp(n->name, "v")) { // status visibility
+ else if (!mir_strcmp(n->name, "v")) { // status visibility
if (n->text != NULL) {
BYTE bPublic = atoi(n->text);
db_set_w(hContact, proto->m_szModuleName, "PublicStatus", bPublic);
@@ -409,14 +409,14 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) return;
int id = atoi(str+mir_strlen(TLEN_IQID));
- if (!strcmp(type, "result")) {
+ if (!mir_strcmp(type, "result")) {
if ((queryNode=TlenXmlGetChild(iqNode, "query")) == NULL) return;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
jsr.hdr.cbSize = sizeof(TLEN_SEARCH_RESULT);
jsr.hdr.flags = PSR_TCHAR;
for (i=0; i<queryNode->numChild; i++) {
itemNode = queryNode->child[i];
- if (!strcmp(itemNode->name, "item")) {
+ if (!mir_strcmp(itemNode->name, "item")) {
if ((jid=TlenXmlGetAttrValue(itemNode, "jid")) != NULL) {
if (strchr(jid, '@') != NULL) {
strncpy_s(jsr.jid, jid, _TRUNCATE);
@@ -495,7 +495,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) if (!found) {
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) id, 0);
}
- } else if (!strcmp(type, "error")) {
+ } else if (!mir_strcmp(type, "error")) {
// ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, (HANDLE) id, 0);
// There is no ACKRESULT_FAILED for ACKTYPE_SEARCH :) look at findadd.c
// So we will just send a SUCCESS
@@ -523,7 +523,7 @@ void TlenIqResultTcfg(TlenProtocol *proto, XmlNode *iqNode) char *type=TlenXmlGetAttrValue(iqNode, "type");
if (type == NULL) return;
- if (!strcmp(type, "result")) {
+ if (!mir_strcmp(type, "result")) {
if ((queryNode=TlenXmlGetChild(iqNode, "query")) == NULL) return;
if ((miniMailNode=TlenXmlGetChild(queryNode, "mini-mail")) == NULL) return;
if ((node=TlenXmlGetChild(miniMailNode, "base")) != NULL) {
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index 9712af7339..07b59d5f47 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -39,9 +39,9 @@ static int isSelf(TlenProtocol *proto, const char *roomID, const char *nick) item = TlenListGetItemPtr(proto, LIST_CHATROOM, roomID);
if (item != NULL) {
if (item->nick == NULL) {
- if (!strcmp(nick, proto->threadData->username)) result = 1;
+ if (!mir_strcmp(nick, proto->threadData->username)) result = 1;
} else if (nick[0] == '~') {
- if (!strcmp(nick+1, item->nick)) {
+ if (!mir_strcmp(nick+1, item->nick)) {
result = 1;
}
}
@@ -72,7 +72,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
mir_snprintf(jid, SIZEOF(jid), "%s@%s", id, dbv.pszVal);
db_free(&dbv);
- if (((hContact=TlenHContactFromJID(proto, jid)) != NULL) || !strcmp(id, proto->threadData->username)) {
+ if (((hContact=TlenHContactFromJID(proto, jid)) != NULL) || !mir_strcmp(id, proto->threadData->username)) {
CONTACTINFO ci = { sizeof(ci) };
ci.hContact = hContact;
ci.szProto = (char *)proto->m_szModuleName;
diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp index 868b877313..5401396e96 100644 --- a/protocols/Tlen/src/tlen_p2p_new.cpp +++ b/protocols/Tlen/src/tlen_p2p_new.cpp @@ -243,7 +243,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { e = TlenXmlGetAttrValue(fs, "e");
id = TlenXmlGetAttrValue(fs, "i");
if (e != NULL) {
- if (!strcmp(e, "1")) {
+ if (!mir_strcmp(e, "1")) {
TLEN_FILE_TRANSFER * ft = (TLEN_FILE_TRANSFER *) mir_alloc(sizeof(TLEN_FILE_TRANSFER));
memset(ft, 0, sizeof(TLEN_FILE_TRANSFER));
char *c = TlenXmlGetAttrValue(fs, "c");
@@ -270,11 +270,11 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { ProtoChainRecvFile(ft->hContact, &pre);
mir_free(filenameT);
}
- } else if (!strcmp(e, "3")) {
+ } else if (!mir_strcmp(e, "3")) {
/* transfer error */
- } else if (!strcmp(e, "4")) {
+ } else if (!mir_strcmp(e, "4")) {
/* transfer denied */
- } else if (!strcmp(e, "5")) {
+ } else if (!mir_strcmp(e, "5")) {
/* transfer accepted */
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, id)) != NULL) {
item->id2 = mir_strdup("84273372");
@@ -290,7 +290,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { char *s = TlenXmlGetAttrValue(dcng, "s");
char *id2 = TlenXmlGetAttrValue(dcng, "i");
char *id = TlenXmlGetAttrValue(dcng, "mi");
- if (!strcmp(s, "1")) {
+ if (!mir_strcmp(s, "1")) {
/* Keys */
/* s - step */
/* i - id of the file */
@@ -301,7 +301,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { char *v = TlenXmlGetAttrValue(dcng, "v"); // v - ???
char *ck = TlenXmlGetAttrValue(dcng, "ck"); // ck - aes key
char *iv = TlenXmlGetAttrValue(dcng, "iv"); // iv - aes initial vector
- if (!strcmp(n, "file_send")) {
+ if (!mir_strcmp(n, "file_send")) {
if ((item=TlenListGetItemPtr(info->proto, LIST_FILE, id)) != NULL) {
item->id2 = mir_strdup(id2);
item->ft->id2 = mir_strdup(id2);
@@ -310,7 +310,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { item->ft->jid, item->ft->localName, item->ft->wLocalPort, item->ft->localName, item->ft->wLocalPort, item->ft->id2);
}
}
- } else if (!strcmp(s, "2")) {
+ } else if (!mir_strcmp(s, "2")) {
info->proto->debugLogA("step = 2");
info->proto->debugLogA("%s",from);
info->proto->debugLogA("%s",id2);
@@ -324,7 +324,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { forkthread((void (__cdecl *)(void*))TlenNewFileReceiveThread, 0, item->ft);
forkthread((void (__cdecl *)(void*))TlenNewFileSendThread, 0, item->ft);
}
- } else if (!strcmp(s, "4")) {
+ } else if (!mir_strcmp(s, "4")) {
/* IP and port */
if ((item=TlenListFindItemPtrById2(info->proto, LIST_FILE, id2)) != NULL) {
info->proto->debugLogA("step = 4");
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp index dee4b8831a..64edd27d0e 100644 --- a/protocols/Tlen/src/tlen_p2p_old.cpp +++ b/protocols/Tlen/src/tlen_p2p_old.cpp @@ -203,7 +203,7 @@ TLEN_FILE_TRANSFER* TlenP2PEstablishIncomingConnection(TlenProtocol *proto, HAND item = TlenListGetItemPtrFromIndex(proto, i);
if (item != NULL) {
mir_snprintf(str, SIZEOF(str), "%d", iqId);
- if (!strcmp(item->ft->iqId, str)) {
+ if (!mir_strcmp(item->ft->iqId, str)) {
char *hash, *nick;
int j;
nick = TlenNickFromJID(item->ft->jid);
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index cfda82403b..cc7163c13f 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -188,7 +188,7 @@ void TlenProcessPic(XmlNode *node, TlenProtocol *proto) { item = TlenListGetItemPtr(proto, LIST_PICTURE, idt);
}
if (item != NULL) {
- if (!strcmp(from, "ps")) {
+ if (!mir_strcmp(from, "ps")) {
char *st = TlenXmlGetAttrValue(node, "st");
if (st != NULL) {
item->ft->iqId = mir_strdup(st);
@@ -198,12 +198,12 @@ void TlenProcessPic(XmlNode *node, TlenProtocol *proto) { item->ft->hFileEvent = NULL;
}
}
- } else if (!strcmp(item->ft->jid, fromRaw)) {
+ } else if (!mir_strcmp(item->ft->jid, fromRaw)) {
if (crc_c != NULL) {
- if (!strcmp(crc_c, "n")) {
+ if (!mir_strcmp(crc_c, "n")) {
/* crc_c = n, picture transfer accepted */
TlenPsPost(proto, item);
- } else if (!strcmp(crc_c, "f")) {
+ } else if (!mir_strcmp(crc_c, "f")) {
/* crc_c = f, picture cached, no need to transfer again */
LogPictureMessage(proto, item->ft->jid, item->ft->files[0], TRUE);
TlenP2PFreeFileTransfer(item->ft);
diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp index a3920281b7..c68af8606c 100644 --- a/protocols/Tlen/src/tlen_presence.cpp +++ b/protocols/Tlen/src/tlen_presence.cpp @@ -44,7 +44,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) TlenProcessPresenceAvatar(proto, node, item); } } - if (type == NULL || (!strcmp(type, "available"))) { + if (type == NULL || (!mir_strcmp(type, "available"))) { if ((nick=TlenLocalNickFromJID(from)) != NULL) { if ((hContact=TlenHContactFromJID(proto, from)) == NULL) hContact = TlenDBCreateContact(proto, from, nick, FALSE); @@ -55,11 +55,11 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) status = ID_STATUS_ONLINE; if ((showNode=TlenXmlGetChild(node, "show")) != NULL) { if ((show=showNode->text) != NULL) { - if (!strcmp(show, "away")) status = ID_STATUS_AWAY; - else if (!strcmp(show, "xa")) status = ID_STATUS_NA; - else if (!strcmp(show, "dnd")) status = ID_STATUS_DND; - else if (!strcmp(show, "chat")) status = ID_STATUS_FREECHAT; - else if (!strcmp(show, "unavailable")) { + if (!mir_strcmp(show, "away")) status = ID_STATUS_AWAY; + else if (!mir_strcmp(show, "xa")) status = ID_STATUS_NA; + else if (!mir_strcmp(show, "dnd")) status = ID_STATUS_DND; + else if (!mir_strcmp(show, "chat")) status = ID_STATUS_FREECHAT; + else if (!mir_strcmp(show, "unavailable")) { // Always show invisible (on old Tlen client) as invisible (not offline) status = ID_STATUS_OFFLINE; } @@ -106,7 +106,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) mir_free(nick); } } - else if (!strcmp(type, "unavailable")) { + else if (!mir_strcmp(type, "unavailable")) { if (!TlenListExist(proto, LIST_ROSTER, from)) { proto->debugLogA("Receive presence offline from %s (who is not in my roster)", from); TlenListAdd(proto, LIST_ROSTER, from); @@ -153,7 +153,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) proto->debugLogA("%s offline, set contact status to %d", from, status); } } - else if (!strcmp(type, "subscribe")) { + else if (!mir_strcmp(type, "subscribe")) { if (strchr(from, '@') == NULL) { // automatically send authorization allowed to agent/transport TlenSend(proto, "<presence to='%s' type='subscribed'/>", from); @@ -164,7 +164,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) mir_free(nick); } } - else if (!strcmp(type, "subscribed")) { + else if (!mir_strcmp(type, "subscribed")) { if ((item=TlenListGetItemPtr(proto, LIST_ROSTER, from)) != NULL) { if (item->subscription == SUB_FROM) item->subscription = SUB_BOTH; else if (item->subscription == SUB_NONE) { diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index b578bf6e6b..5572212bbb 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -233,7 +233,7 @@ MCONTACT TlenProtocol::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent mir_free(dbei.pBlob);
return NULL;
}
- if (strcmp(dbei.szModule, m_szModuleName)) {
+ if (mir_strcmp(dbei.szModule, m_szModuleName)) {
mir_free(dbei.pBlob);
return NULL;
}
@@ -278,7 +278,7 @@ int TlenProtocol::Authorize(MEVENT hDbEvent) mir_free(dbei.pBlob);
return 1;
}
- if (strcmp(dbei.szModule, m_szModuleName)) {
+ if (mir_strcmp(dbei.szModule, m_szModuleName)) {
mir_free(dbei.pBlob);
return 1;
}
@@ -327,7 +327,7 @@ int TlenProtocol::AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason) mir_free(dbei.pBlob);
return 1;
}
- if (strcmp(dbei.szModule, m_szModuleName)) {
+ if (mir_strcmp(dbei.szModule, m_szModuleName)) {
mir_free(dbei.pBlob);
return 1;
}
@@ -449,7 +449,7 @@ int TlenProtocol::SetAwayMsg(int iStatus, const PROTOCHAR* msg) }
if ((*szMsg == NULL && newModeMsg == NULL) ||
- (*szMsg != NULL && newModeMsg != NULL && !strcmp(*szMsg, newModeMsg))) {
+ (*szMsg != NULL && newModeMsg != NULL && !mir_strcmp(*szMsg, newModeMsg))) {
// Message is the same, no update needed
if (newModeMsg != NULL) mir_free(newModeMsg);
}
@@ -572,7 +572,7 @@ static void __cdecl TlenGetAwayMsgThread(void *ptr) item->statusMessage==NULL ? (LPARAM)NULL : (LPARAM)(TCHAR*)_A2T(item->statusMessage));
} else {
ptrA ownJid(db_get_sa(NULL, data->proto->m_szModuleName, "jid"));
- if (!strcmp(ownJid, dbv.pszVal)){
+ if (!mir_strcmp(ownJid, dbv.pszVal)){
DBVARIANT dbv2;
if (!db_get_s(data->hContact, "CList", "StatusMsg", &dbv2, DBVT_TCHAR)){
data->proto->ProtoBroadcastAck(data->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv2.ptszVal);
@@ -614,11 +614,11 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int, const char* msgRAW) int id = TlenSerialNext(this);
- if (!strcmp(msgRAW, "<alert>")) {
+ if (!mir_strcmp(msgRAW, "<alert>")) {
TlenSend(this, "<m tp='a' to='%s'/>", dbv.pszVal);
forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id));
}
- else if (!strcmp(msgRAW, "<image>")) {
+ else if (!mir_strcmp(msgRAW, "<image>")) {
TlenSend(this, "<message to='%s' type='%s' crc='%x' idt='%d'/>", dbv.pszVal, "pic", 0x757f044, id);
forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id));
}
@@ -632,10 +632,10 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int, const char* msgRAW) else
strcpy(msgType, "chat");
- if (!strcmp(msgType, "groupchat") || db_get_b(NULL, m_szModuleName, "MsgAck", FALSE) == FALSE) {
- if (!strcmp(msgType, "groupchat"))
+ if (!mir_strcmp(msgType, "groupchat") || db_get_b(NULL, m_szModuleName, "MsgAck", FALSE) == FALSE) {
+ if (!mir_strcmp(msgType, "groupchat"))
TlenSend(this, "<message to='%s' type='%s'><body>%s</body></message>", dbv.pszVal, msgType, msgEnc);
- else if (!strcmp(msgType, "privchat"))
+ else if (!mir_strcmp(msgType, "privchat"))
TlenSend(this, "<m to='%s'><b n='6' s='10' f='0' c='000000'>%s</b></m>", dbv.pszVal, msgEnc);
else
TlenSend(this, "<message to='%s' type='%s' id='"TLEN_IQID"%d'><body>%s</body><x xmlns='jabber:x:event'><composing/></x></message>", dbv.pszVal, msgType, id, msgEnc);
@@ -875,15 +875,15 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) if (hContact == NULL) return 0;
if (!isConnected) return 0;
- if (!strcmp(cws->szModule, "CList")) {
+ if (!mir_strcmp(cws->szModule, "CList")) {
DBVARIANT dbv;
TLEN_LIST_ITEM *item;
char *nick, *jid, *group;
char *szProto = GetContactProto(hContact);
- if (szProto == NULL || strcmp(szProto, m_szModuleName)) return 0;
+ if (szProto == NULL || mir_strcmp(szProto, m_szModuleName)) return 0;
// A contact's group is changed
- if (!strcmp(cws->szSetting, "Group")) {
+ if (!mir_strcmp(cws->szSetting, "Group")) {
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
if ((item=TlenListGetItemPtr(this, LIST_ROSTER, dbv.pszVal)) != NULL) {
db_free(&dbv);
@@ -905,7 +905,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) }
else if (cws->value.pszVal != NULL) {
char *newGroup = settingToChar(cws);
- if (item->group == NULL || strcmp(newGroup, item->group)) {
+ if (item->group == NULL || mir_strcmp(newGroup, item->group)) {
debugLogA("Group set to %s", newGroup);
if ((group=TlenGroupEncode(newGroup)) != NULL) {
TlenSend(this, "<iq type='set'><query xmlns='jabber:iq:roster'><item name='%s' jid='%s'><group>%s</group></item></query></iq>", nick, item->jid, group);
@@ -923,12 +923,12 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) }
}
// A contact is renamed
- else if (!strcmp(cws->szSetting, "MyHandle")) {
+ else if (!mir_strcmp(cws->szSetting, "MyHandle")) {
char *newNick;
// hContact = (MCONTACT) wParam;
// szProto = GetContactProto(hContact);
-// if (szProto == NULL || strcmp(szProto, proto->m_szModuleName)) return 0;
+// if (szProto == NULL || mir_strcmp(szProto, proto->m_szModuleName)) return 0;
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
jid = dbv.pszVal;
@@ -941,7 +941,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) newNick = NULL;
}
// Note: we need to compare with item->nick to prevent infinite loop
- if (newNick != NULL && (item->nick == NULL || (item->nick != NULL && strcmp(item->nick, newNick)))) {
+ if (newNick != NULL && (item->nick == NULL || (item->nick != NULL && mir_strcmp(item->nick, newNick)))) {
if ((nick=TlenTextEncode(newNick)) != NULL) {
debugLogA("Nick set to %s", newNick);
if (item->group != NULL && (group=TlenGroupEncode(item->group)) != NULL) {
@@ -959,7 +959,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) }
}
// A temporary contact has been added permanently
- else if (!strcmp(cws->szSetting, "NotOnList")) {
+ else if (!mir_strcmp(cws->szSetting, "NotOnList")) {
char *jid, *nick, *pGroup;
if (cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_BYTE && cws->value.bVal==0)) {
@@ -1006,7 +1006,7 @@ int TlenProtocol::TlenContactDeleted(WPARAM wParam, LPARAM lParam) return 0;
char *szProto = GetContactProto(wParam);
- if (szProto == NULL || strcmp(szProto, m_szModuleName))
+ if (szProto == NULL || mir_strcmp(szProto, m_szModuleName))
return 0;
DBVARIANT dbv;
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 2b6af296c1..4984a7f6a5 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -418,7 +418,7 @@ static void TlenSendAuth(TlenProtocol *proto) { /* processing <s ... > tag sent from server on session opening */
static void TlenProcessStreamOpening(XmlNode *node, ThreadData *info)
{
- if (node->name == NULL || strcmp(node->name, "s"))
+ if (node->name == NULL || mir_strcmp(node->name, "s"))
return;
char *sid=TlenXmlGetAttrValue(node, "i");
@@ -427,7 +427,7 @@ static void TlenProcessStreamOpening(XmlNode *node, ThreadData *info) info->streamId = mir_strdup(sid);
}
char *s=TlenXmlGetAttrValue(node, "s");
- if (s != NULL && !strcmp(s, "1")) {
+ if (s != NULL && !mir_strcmp(s, "1")) {
int i;
unsigned char aes_key[32];
char aes_key_str[140], aes_iv_str[40];
@@ -474,11 +474,11 @@ static void TlenProcessStreamOpening(XmlNode *node, ThreadData *info) static void TlenProcessStreamClosing(XmlNode *node, ThreadData *info)
{
Netlib_CloseHandle(info->proto);
- if (node->name && !strcmp(node->name, "stream:error") && node->text){
+ if (node->name && !mir_strcmp(node->name, "stream:error") && node->text){
char buffer[1024];
mir_snprintf(buffer, SIZEOF(buffer), "%s\n%s", Translate("Tlen Connection Error"), Translate(node->text));
PUShowMessage(buffer, SM_WARNING);
- } else if (!strcmp(node->name, "s")){
+ } else if (!mir_strcmp(node->name, "s")){
info->proto->debugLogA("Disconnected server message");
}
}
@@ -486,27 +486,27 @@ static void TlenProcessStreamClosing(XmlNode *node, ThreadData *info) /* processing session tags sent from server */
static void TlenProcessProtocol(XmlNode *node, ThreadData *info)
{
- if (!strcmp(node->name, "message"))
+ if (!mir_strcmp(node->name, "message"))
TlenProcessMessage(node, info);
- else if (!strcmp(node->name, "presence"))
+ else if (!mir_strcmp(node->name, "presence"))
TlenProcessPresence(node, info->proto);
- else if (!strcmp(node->name, "iq"))
+ else if (!mir_strcmp(node->name, "iq"))
TlenProcessIq(node, info);
- else if (!strcmp(node->name, "f"))
+ else if (!mir_strcmp(node->name, "f"))
TlenProcessF(node, info);
- else if (!strcmp(node->name, "w"))
+ else if (!mir_strcmp(node->name, "w"))
TlenProcessW(node, info);
- else if (!strcmp(node->name, "m"))
+ else if (!mir_strcmp(node->name, "m"))
TlenProcessM(node, info);
- else if (!strcmp(node->name, "n"))
+ else if (!mir_strcmp(node->name, "n"))
TlenProcessN(node, info);
- else if (!strcmp(node->name, "p"))
+ else if (!mir_strcmp(node->name, "p"))
TlenProcessP(node, info);
- else if (!strcmp(node->name, "v"))
+ else if (!mir_strcmp(node->name, "v"))
TlenProcessV(node, info);
- else if (!strcmp(node->name, "avatar"))
+ else if (!mir_strcmp(node->name, "avatar"))
TlenProcessAvatar(node, info);
- else if (!strcmp(node->name, "cipher"))
+ else if (!mir_strcmp(node->name, "cipher"))
TlenProcessCipher(node, info);
else
info->proto->debugLogA("Invalid top-level tag (only <message/> <presence/> <iq/> <f/> <w/> <m/> <n/> <p/> <v/> <cipher/> and <avatar/> allowed)");
@@ -604,10 +604,10 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) BOOL delivered, composing;
int i;
- if (!node->name || strcmp(node->name, "message")) return;
+ if (!node->name || mir_strcmp(node->name, "message")) return;
char *type=TlenXmlGetAttrValue(node, "type");
- if (type != NULL && !strcmp(type, "error")) {
+ if (type != NULL && !mir_strcmp(type, "error")) {
}
else {
char *from=TlenXmlGetAttrValue(node, "from");
@@ -620,11 +620,11 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) TLEN_LIST_ITEM *item = TlenListGetItemPtr(info->proto, LIST_ROSTER, fromJid);
BOOL isChatRoomJid = TlenListExist(info->proto, LIST_CHATROOM, from);
- if (isChatRoomJid && type != NULL && !strcmp(type, "groupchat")) {
+ if (isChatRoomJid && type != NULL && !mir_strcmp(type, "groupchat")) {
//TlenGroupchatProcessMessage(node, userdata);
- } else if (type != NULL && !strcmp(type, "pic")) {
+ } else if (type != NULL && !mir_strcmp(type, "pic")) {
TlenProcessPic(node, info->proto);
- } else if (type != NULL && !strcmp(type, "iq")) {
+ } else if (type != NULL && !mir_strcmp(type, "iq")) {
XmlNode *iqNode;
// Tlen-compatible iq
if ((iqNode=TlenXmlGetChild(node, "iq")) != NULL) {
@@ -649,12 +649,12 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) i = 1;
while ((xNode=TlenXmlGetNthChild(node, "x", i)) != NULL) {
if ((p=TlenXmlGetAttrValue(xNode, "xmlns")) != NULL) {
- if (!strcmp(p, "jabber:x:delay") && msgTime==0) {
+ if (!mir_strcmp(p, "jabber:x:delay") && msgTime==0) {
if ((p=TlenXmlGetAttrValue(xNode, "stamp")) != NULL) {
msgTime = TlenIsoToUnixTime(p);
}
}
- else if (!strcmp(p, "jabber:x:event")) {
+ else if (!mir_strcmp(p, "jabber:x:event")) {
// Check whether any event is requested
if (!delivered && (n=TlenXmlGetChild(xNode, "delivered")) != NULL) {
delivered = TRUE;
@@ -738,7 +738,7 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) int id;
int i;
- if (!node->name || strcmp(node->name, "iq")) return;
+ if (!node->name || mir_strcmp(node->name, "iq")) return;
char *type=TlenXmlGetAttrValue(node, "type");
// if ((type=TlenXmlGetAttrValue(node, "type")) == NULL) return;
@@ -765,17 +765,17 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) // MORE GENERAL ROUTINES, WHEN ID DOES NOT MATCH
/////////////////////////////////////////////////////////////////////////
// new p2p connections
- } else if (xmlns != NULL && !strcmp(xmlns, "p2p")) {
+ } else if (xmlns != NULL && !mir_strcmp(xmlns, "p2p")) {
if (info->proto->tlenOptions.useNewP2P) {
TlenProcessP2P(node, info);
}
}
// RECVED: <iq type='set'><query ...
- else if (!strcmp(type, "set") && queryNode != NULL && xmlns != NULL) {
+ else if (!mir_strcmp(type, "set") && queryNode != NULL && xmlns != NULL) {
// RECVED: roster push
// ACTION: similar to iqIdGetRoster above
- if (!strcmp(xmlns, "jabber:iq:roster")) {
+ if (!mir_strcmp(xmlns, "jabber:iq:roster")) {
XmlNode *itemNode, *groupNode;
TLEN_LIST_ITEM *item;
char *name;
@@ -783,11 +783,11 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) info->proto->debugLogA("<iq/> Got roster push, query has %d children", queryNode->numChild);
for (i=0; i<queryNode->numChild; i++) {
itemNode = queryNode->child[i];
- if (!strcmp(itemNode->name, "item")) {
+ if (!mir_strcmp(itemNode->name, "item")) {
if ((jid=TlenXmlGetAttrValue(itemNode, "jid")) != NULL) {
if ((str=TlenXmlGetAttrValue(itemNode, "subscription")) != NULL) {
// we will not add new account when subscription=remove
- if (!strcmp(str, "to") || !strcmp(str, "both") || !strcmp(str, "from") || !strcmp(str, "none")) {
+ if (!mir_strcmp(str, "to") || !mir_strcmp(str, "both") || !mir_strcmp(str, "from") || !mir_strcmp(str, "none")) {
if ((name=TlenXmlGetAttrValue(itemNode, "name")) != NULL) {
nick = TlenTextDecode(name);
} else {
@@ -813,7 +813,7 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) item->group = NULL;
db_unset(hContact, "CList", "Group");
}
- if (!strcmp(str, "none") || (!strcmp(str, "from") && strchr(jid, '@') != NULL)) {
+ if (!mir_strcmp(str, "none") || (!mir_strcmp(str, "from") && strchr(jid, '@') != NULL)) {
if (db_get_w(hContact, info->proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, info->proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
}
@@ -824,11 +824,11 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) }
}
if ((item=TlenListGetItemPtr(info->proto, LIST_ROSTER, jid)) != NULL) {
- if (!strcmp(str, "both"))
+ if (!mir_strcmp(str, "both"))
item->subscription = SUB_BOTH;
- else if (!strcmp(str, "to"))
+ else if (!mir_strcmp(str, "to"))
item->subscription = SUB_TO;
- else if (!strcmp(str, "from"))
+ else if (!mir_strcmp(str, "from"))
item->subscription = SUB_FROM;
else
item->subscription = SUB_NONE;
@@ -836,7 +836,7 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) // subscription = remove is to remove from roster list
// but we will just set the contact to offline and not actually
// remove, so that history will be retained.
- if (!strcmp(str, "remove")) {
+ if (!mir_strcmp(str, "remove")) {
if ((hContact=TlenHContactFromJID(info->proto, jid)) != NULL) {
if (db_get_w(hContact, info->proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, info->proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
@@ -852,38 +852,38 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) }
// RECVED: <iq type='get'><query ...
- else if ( !strcmp( type, "get" ) && queryNode != NULL && xmlns != NULL ) {
+ else if ( !mir_strcmp( type, "get" ) && queryNode != NULL && xmlns != NULL ) {
// RECVED: software version query
// ACTION: return my software version
- if ( !strcmp( xmlns, "jabber:iq:version" )) TlenProcessIqGetVersion(info->proto, node);
+ if ( !mir_strcmp( xmlns, "jabber:iq:version" )) TlenProcessIqGetVersion(info->proto, node);
}
// RECVED: <iq type='result'><query ...
- else if ( !strcmp( type, "result") && queryNode != NULL) {
+ else if ( !mir_strcmp( type, "result") && queryNode != NULL) {
if (xmlns != NULL ) {
- if ( !strcmp(xmlns, "jabber:iq:roster" )) {
+ if ( !mir_strcmp(xmlns, "jabber:iq:roster" )) {
TlenIqResultRoster(info->proto, node);
- } else if ( !strcmp( xmlns, "jabber:iq:version" )) {
+ } else if ( !mir_strcmp( xmlns, "jabber:iq:version" )) {
TlenIqResultVersion(info->proto, node);
- } else if ( !strcmp( xmlns, "jabber:iq:info" )) {
+ } else if ( !mir_strcmp( xmlns, "jabber:iq:info" )) {
TlenIqResultInfo(info->proto, node);
}
} else {
char *from;
if (( from=TlenXmlGetAttrValue( node, "from" )) != NULL ) {
- if ( !strcmp(from, "tcfg" )) {
+ if ( !mir_strcmp(from, "tcfg" )) {
TlenIqResultTcfg(info->proto, node);
}
}
}
}
// RECVED: <iq type='error'> ...
- else if (!strcmp(type, "error")) {
+ else if (!mir_strcmp(type, "error")) {
TLEN_LIST_ITEM *item;
// Check for file transfer deny by comparing idStr with ft->iqId
i = 0;
while ((i=TlenListFindNext(info->proto, LIST_FILE, i)) >= 0) {
item = TlenListGetItemPtrFromIndex(info->proto,i);
- if (item->ft->state==FT_CONNECTING && !strcmp(idStr, item->ft->iqId)) {
+ if (item->ft->state==FT_CONNECTING && !mir_strcmp(idStr, item->ft->iqId)) {
item->ft->state = FT_DENIED;
if (item->ft->hFileEvent != NULL)
SetEvent(item->ft->hFileEvent); // Simulate the termination of file server connection
@@ -902,7 +902,7 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) char *str, *localMessage;
int strSize;
- if (!node->name || strcmp(node->name, "w"))
+ if (!node->name || mir_strcmp(node->name, "w"))
return;
char *body=node->text;
@@ -953,7 +953,7 @@ static void TlenProcessM(XmlNode *node, ThreadData *info) int i;
XmlNode *xNode, *invNode, *bNode;
- if (!node->name || strcmp(node->name, "m")) return;
+ if (!node->name || mir_strcmp(node->name, "m")) return;
char *f = TlenXmlGetAttrValue(node, "f"); //, *from;//username
if (f != NULL) {
@@ -963,19 +963,19 @@ static void TlenProcessM(XmlNode *node, ThreadData *info) char *tp=TlenXmlGetAttrValue(node, "tp");//typing start/stop
if (tp != NULL) {
TLEN_LIST_ITEM *item = TlenListGetItemPtr(info->proto, LIST_ROSTER, fLogin);
- if (!strcmp(tp, "t")) { //contact is writing
+ if (!mir_strcmp(tp, "t")) { //contact is writing
if (item != NULL ) {
item->isTyping = TRUE;
CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_INFINITE);
}
}
- else if (!strcmp(tp, "u")) {//contact stopped writing
+ else if (!mir_strcmp(tp, "u")) {//contact stopped writing
if (item != NULL) {
item->isTyping = FALSE;
CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF);
}
}
- else if (!strcmp(tp, "a")) {//alert was received
+ else if (!mir_strcmp(tp, "a")) {//alert was received
int bAlert = TRUE;
if (info->proto->tlenOptions.alertPolicy == TLEN_ALERTS_IGNORE_ALL) {
bAlert = FALSE;
@@ -1011,7 +1011,7 @@ static void TlenProcessM(XmlNode *node, ThreadData *info) bNode = TlenXmlGetChild(node, "b");
f = TlenTextDecode(f);
if (bNode != NULL && bNode->text != NULL) {
- if (tp != NULL && !strcmp(tp, "p")) {
+ if (tp != NULL && !mir_strcmp(tp, "p")) {
/* MUC private message */
str = TlenResourceFromJID(f);
hContact = TlenDBCreateContact(info->proto, f, str, TRUE);
@@ -1082,7 +1082,7 @@ static void TlenProcessN(XmlNode *node, ThreadData *info) char *str, *popupTitle, *popupText;
int strSize;
- if (!node->name || strcmp(node->name, "n")) return;
+ if (!node->name || mir_strcmp(node->name, "n")) return;
char *s = TlenXmlGetAttrValue(node, "s");
char *f = TlenXmlGetAttrValue(node, "f");
@@ -1118,7 +1118,7 @@ static void TlenProcessP(XmlNode *node, ThreadData *info) XmlNode *sNode, *xNode, *iNode, *kNode;
int status, flags;
- if (!node->name || strcmp(node->name, "p")) return;
+ if (!node->name || mir_strcmp(node->name, "p")) return;
// presence from users in chat room
flags = 0;
@@ -1167,7 +1167,7 @@ static void TlenProcessP(XmlNode *node, ThreadData *info) }
sNode = TlenXmlGetChild(node, "s");
if (sNode != NULL) {
- if (!strcmp(sNode->text, "unavailable")) {
+ if (!mir_strcmp(sNode->text, "unavailable")) {
status = ID_STATUS_OFFLINE;
}
}
@@ -1193,7 +1193,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) char jid[128];
TLEN_LIST_ITEM *item;
char *id, *e, *p;
-// if (!node->name || strcmp(node->name, "v")) return;
+// if (!node->name || mir_strcmp(node->name, "v")) return;
char *from=TlenXmlGetAttrValue(node, "f");
if (from != NULL) {
@@ -1203,12 +1203,12 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) strncpy_s(jid, from, _TRUNCATE);
}
if ((e=TlenXmlGetAttrValue(node, "e")) != NULL) {
- if (!strcmp(e, "1")) {
+ if (!mir_strcmp(e, "1")) {
if ((id=TlenXmlGetAttrValue(node, "i")) != NULL) {
SkinPlaySound("TlenVoiceNotify");
TlenVoiceAccept(info->proto, id, from);
}
- } else if (!strcmp(e, "3")) {
+ } else if (!mir_strcmp(e, "3")) {
// FILE_RECV : e='3' : invalid transfer error
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_VOICE, p)) != NULL) {
@@ -1230,28 +1230,28 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) }
}
}
- } else if (!strcmp(e, "4")) {
+ } else if (!mir_strcmp(e, "4")) {
// FILE_SEND : e='4' : File sending request was denied by the remote client
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_VOICE, p)) != NULL) {
- if (!strcmp(item->ft->jid, jid)) {
+ if (!mir_strcmp(item->ft->jid, jid)) {
TlenVoiceCancelAll(info->proto);
//TlenListRemove(info->proto, LIST_VOICE, p);
}
}
}
- } else if (!strcmp(e, "5")) {
+ } else if (!mir_strcmp(e, "5")) {
// FILE_SEND : e='5' : Voice request was accepted
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_VOICE, p)) != NULL) {
info->proto->debugLogA("should start voice 1 ? %s ?? %s", jid, item->ft->jid);
- if (!strcmp(item->ft->jid, jid)) {
+ if (!mir_strcmp(item->ft->jid, jid)) {
info->proto->debugLogA("starting voice 1");
TlenVoiceStart(item->ft, 1);
}
}
}
- } else if (!strcmp(e, "6")) {
+ } else if (!mir_strcmp(e, "6")) {
// FILE_RECV : e='6' : IP and port information to connect to get file
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_VOICE, p)) != NULL) {
@@ -1266,7 +1266,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) }
}
}
- else if (!strcmp(e, "7")) {
+ else if (!mir_strcmp(e, "7")) {
// FILE_RECV : e='7' : IP and port information to connect to send file
// in case the conection to the given server was not successful
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
@@ -1283,7 +1283,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) }
}
}
- else if (!strcmp(e, "8")) {
+ else if (!mir_strcmp(e, "8")) {
// FILE_RECV : e='8' : transfer error
if ((p=TlenXmlGetAttrValue(node, "i")) != NULL) {
if ((item=TlenListGetItemPtr(info->proto, LIST_VOICE, p)) != NULL) {
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp index dc1414196d..453b0120c8 100644 --- a/protocols/Tlen/src/tlen_userinfo.cpp +++ b/protocols/Tlen/src/tlen_userinfo.cpp @@ -132,7 +132,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam) MCONTACT hContact = (MCONTACT) lParam;
char *szProto = GetContactProto(hContact);
- if ((szProto != NULL && !strcmp(szProto, m_szModuleName)) || !lParam) {
+ if ((szProto != NULL && !mir_strcmp(szProto, m_szModuleName)) || !lParam) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.flags = ODPF_TCHAR;
diff --git a/protocols/Tlen/src/tlen_xml.cpp b/protocols/Tlen/src/tlen_xml.cpp index 04e6aa79a3..408df2ab3a 100644 --- a/protocols/Tlen/src/tlen_xml.cpp +++ b/protocols/Tlen/src/tlen_xml.cpp @@ -279,7 +279,7 @@ static BOOL TlenXmlProcessElem(XmlState *xmlState, XmlElemType elemType, char *e if (elemText == NULL) return FALSE; - if (elemType == ELEM_OPEN && !strcmp(elemText, "?xml")) { + if (elemType == ELEM_OPEN && !mir_strcmp(elemText, "?xml")) { // TlenLog("XML: skip <?xml> tag"); return TRUE; } @@ -349,7 +349,7 @@ static BOOL TlenXmlProcessElem(XmlState *xmlState, XmlElemType elemType, char *e } break; case ELEM_CLOSE: - if (node->name != NULL && !strcmp(node->name, text)) { + if (node->name != NULL && !mir_strcmp(node->name, text)) { node->state = NODE_CLOSE; int nodeDepth = node->depth; if (nodeDepth == 1 && xmlState->callback1_close != NULL) { @@ -390,7 +390,7 @@ char *TlenXmlGetAttrValue(XmlNode *node, char *key) if (node == NULL || node->numAttr <= 0 || key == NULL || mir_strlen(key) <= 0) return NULL; for (i=0; i<node->numAttr; i++) { - if (node->attr[i]->name && !strcmp(key, node->attr[i]->name)) + if (node->attr[i]->name && !mir_strcmp(key, node->attr[i]->name)) return node->attr[i]->value; } return NULL; @@ -409,7 +409,7 @@ XmlNode *TlenXmlGetNthChild(XmlNode *node, char *tag, int nth) return NULL; num = 1; for (i=0; i<node->numChild; i++) { - if (node->child[i]->name && !strcmp(tag, node->child[i]->name)) { + if (node->child[i]->name && !mir_strcmp(tag, node->child[i]->name)) { if (num == nth) { return node->child[i]; } @@ -427,9 +427,9 @@ XmlNode *TlenXmlGetChildWithGivenAttrValue(XmlNode *node, char *tag, char *attrK if (node == NULL || node->numChild <= 0 || tag == NULL || mir_strlen(tag) <= 0 || attrKey == NULL || mir_strlen(attrKey) <= 0 || attrValue == NULL || mir_strlen(attrValue) <= 0) return NULL; for (i=0; i<node->numChild; i++) { - if (node->child[i]->name && !strcmp(tag, node->child[i]->name)) { + if (node->child[i]->name && !mir_strcmp(tag, node->child[i]->name)) { if ((str=TlenXmlGetAttrValue(node->child[i], attrKey)) != NULL) - if (!strcmp(str, attrValue)) + if (!mir_strcmp(str, attrValue)) return node->child[i]; } } |