diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
commit | 83310365c69bd40365ee0ae0e16c99c28e24cd0b (patch) | |
tree | 10ac18bfdc3fcf0fd62a5aba3ccb5dedffa2e410 /protocols/ICQCorp/src/protocol.cpp | |
parent | d68cd04d6f7b997692476b531bdc30f546a50efd (diff) |
- all static protocol services replaced with functions;
- m_protomod.h removed as useless
git-svn-id: http://svn.miranda-ng.org/main/trunk@14260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/ICQCorp/src/protocol.cpp')
-rw-r--r-- | protocols/ICQCorp/src/protocol.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 1325126aa3..8a4967f5f1 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -1155,23 +1155,23 @@ void ICQ::updateContactList() //HANDLE hContact;
ICQUser *u;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto && !mir_strcmp(proto, protoName))
- {
- if ((u = getUserByContact(hContact)) == NULL)
- {
- u = new ICQUser();
- u->hContact = hContact;
- u->uin = db_get_dw(hContact, protoName, "UIN", 0);
- icqUsers.push_back(u);
- }
- if (statusVal <= ID_STATUS_OFFLINE) u->setStatus(ID_STATUS_OFFLINE);
- else u->statusVal = db_get_w(hContact, protoName, "Status", ID_STATUS_OFFLINE);
- }
- }
-
- if (statusVal <= ID_STATUS_OFFLINE) return;
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ proto = GetContactProto(hContact);
+ if (proto && !mir_strcmp(proto, protoName))
+ {
+ if ((u = getUserByContact(hContact)) == NULL)
+ {
+ u = new ICQUser();
+ u->hContact = hContact;
+ u->uin = db_get_dw(hContact, protoName, "UIN", 0);
+ icqUsers.push_back(u);
+ }
+ if (statusVal <= ID_STATUS_OFFLINE) u->setStatus(ID_STATUS_OFFLINE);
+ else u->statusVal = db_get_w(hContact, protoName, "Status", ID_STATUS_OFFLINE);
+ }
+ }
+
+ if (statusVal <= ID_STATUS_OFFLINE) return;
// create user info packet
@@ -1298,40 +1298,40 @@ void ICQ::updateUserList(ICQUser *u, char list, char add) ICQUser *ICQ::addUser(unsigned int uin, bool persistent)
{
- unsigned int i;
- ICQUser *u;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- u = icqUsers[i];
- if (u->uin == uin)
- {
- if (persistent)
- {
- db_unset(u->hContact, "CList", "NotOnList");
- db_unset(u->hContact, "CList", "Hidden");
- }
- return u;
- }
- }
-
- u = new ICQUser();
- u->uin = uin;
+ unsigned int i;
+ ICQUser *u;
+
+ for (i=0; i<icqUsers.size(); i++)
+ {
+ u = icqUsers[i];
+ if (u->uin == uin)
+ {
+ if (persistent)
+ {
+ db_unset(u->hContact, "CList", "NotOnList");
+ db_unset(u->hContact, "CList", "Hidden");
+ }
+ return u;
+ }
+ }
+
+ u = new ICQUser();
+ u->uin = uin;
u->hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- icqUsers.push_back(u);
+ icqUsers.push_back(u);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)u->hContact, (LPARAM)protoName);
- u->setInfo("UIN", uin);
+ Proto_AddToContact(u->hContact, protoName);
+ u->setInfo("UIN", uin);
- if (persistent) getUserInfo(u, true);
- else
- {
- db_set_b(u->hContact, "CList", "NotOnList", 1);
- db_set_b(u->hContact, "CList", "Hidden", 1);
- }
+ if (persistent) getUserInfo(u, true);
+ else
+ {
+ db_set_b(u->hContact, "CList", "NotOnList", 1);
+ db_set_b(u->hContact, "CList", "Hidden", 1);
+ }
- updateContactList();
- return u;
+ updateContactList();
+ return u;
}
///////////////////////////////////////////////////////////////////////////////
@@ -1814,7 +1814,7 @@ void ICQ::authorize(unsigned int uinToAuthorize) void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket)
{
- unsigned int i, checkUin, senderIp, localIp, userStatus, senderPort, junkLong, thePort, theTCPSequence;
+ unsigned int i, checkUin, senderIp, localIp, userStatus, senderPort, junkLong, thePort, theTCPSequence = 0;
unsigned short version, command, junkShort, newCommand, /*messageLen,*/ cicqVersion;
unsigned char cicqChar, junkChar;
char *message = NULL;
@@ -2190,7 +2190,7 @@ void ICQ::addMessage(ICQUser *u, char *m, unsigned short theCmd, unsigned short pre.timestamp = t;
pre.szMessage = (char*)m;
pre.lParam = 0;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2217,7 +2217,7 @@ void ICQ::addUrl(ICQUser *u, char *m, unsigned short theCmd, unsigned short theS pre.timestamp = t;
pre.szMessage = url;
pre.lParam = 0;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
delete [] url;
}
@@ -2239,7 +2239,7 @@ void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned short theCmd, unsigned short pre.timestamp = t;
pre.szMessage = (char*)m;
pre.lParam = theSequence;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2313,7 +2313,7 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un pre.timestamp = t;
pre.szMessage = szBlob;
pre.lParam = theSequence;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
delete [] szBlob;
|