diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
commit | 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch) | |
tree | efee912ee654baafeb98efcd117921db6b7489bc /protocols/Tlen/src/jabber_thread.cpp | |
parent | bcb27264ba737778e5d3edad36088bacf74f0236 (diff) |
- the kernel filters out contacts by proto names much faster than a plugin;
- database cycles simplified
git-svn-id: http://svn.miranda-ng.org/main/trunk@4404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/jabber_thread.cpp')
-rw-r--r-- | protocols/Tlen/src/jabber_thread.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/protocols/Tlen/src/jabber_thread.cpp b/protocols/Tlen/src/jabber_thread.cpp index 896bf29016..0cc09e86c4 100644 --- a/protocols/Tlen/src/jabber_thread.cpp +++ b/protocols/Tlen/src/jabber_thread.cpp @@ -274,18 +274,6 @@ void __cdecl JabberServerThread(ThreadData *info) return;
}
- // Determine local IP
- /*
- socket = CallService(MS_NETLIB_GETSOCKET, (WPARAM) proto, 0);
- struct sockaddr_in saddr;
- int len;
-
- len = sizeof(saddr);
- getsockname(socket, (struct sockaddr *) &saddr, &len);
- jabberLocalIP = saddr.sin_addr.S_un.S_addr;
- JabberLog("Local IP = %s", inet_ntoa(saddr.sin_addr));
- */
-
// User may change status to OFFLINE while we are connecting above
if (info->proto->m_iDesiredStatus != ID_STATUS_OFFLINE) {
@@ -357,19 +345,15 @@ void __cdecl JabberServerThread(ThreadData *info) Menu_ModifyItem(info->proto->hMenuChats, &mi);
// Set status to offline
+ char *szProto = info->proto->m_szModuleName;
oldStatus = info->proto->m_iStatus;
info->proto->m_iStatus = ID_STATUS_OFFLINE;
- ProtoBroadcastAck(info->proto->m_szModuleName, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, info->proto->m_iStatus);
+ ProtoBroadcastAck(szProto, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, info->proto->m_iStatus);
// Set all contacts to offline
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- str = GetContactProto(hContact);
- if (str != NULL && !strcmp(str, info->proto->m_szModuleName)) {
- 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);
- }
- }
- }
+ for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
+ if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
JabberListWipeSpecial(info->proto);
}
|