summaryrefslogtreecommitdiff
path: root/protocols/EmLanProto/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-09 21:40:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-09 21:40:22 +0000
commit3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch)
treeefee912ee654baafeb98efcd117921db6b7489bc /protocols/EmLanProto/src
parentbcb27264ba737778e5d3edad36088bacf74f0236 (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/EmLanProto/src')
-rw-r--r--protocols/EmLanProto/src/mlan.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp
index b17b7ef7c9..653557e160 100644
--- a/protocols/EmLanProto/src/mlan.cpp
+++ b/protocols/EmLanProto/src/mlan.cpp
@@ -127,12 +127,9 @@ void CMLan::SetMirandaStatus(u_int status)
void CMLan::SetAllOffline()
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- char *svc = GetContactProto(hContact);
- if (svc != NULL && lstrcmp(PROTONAME,svc) == 0) {
- db_set_w(hContact,PROTONAME,"Status",ID_STATUS_OFFLINE);
- db_unset(hContact, PROTONAME, "IP");
- }
+ for (HANDLE hContact = db_find_first(PROTONAME); hContact; hContact = db_find_next(hContact, PROTONAME)) {
+ db_set_w(hContact, PROTONAME, "Status", ID_STATUS_OFFLINE);
+ db_unset(hContact, PROTONAME, "IP");
}
DeleteCache();
}
@@ -241,18 +238,15 @@ void CMLan::SendPacketExt(TPacket& pak, u_long addr)
HANDLE CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status)
{
- for (HANDLE res = db_find_first(); res; res = db_find_next(res)) {
- char *szProto = GetContactProto(res);
- if (szProto!=NULL && !lstrcmp(PROTONAME, szProto)) {
- u_long caddr = db_get_dw(res, PROTONAME, "ipaddr", -1);
- if (caddr==addr.S_un.S_addr) {
- if (make_permanent)
- db_unset(res,"CList","NotOnList");
- if (make_visible)
- db_unset(res,"CList","Hidden");
- return res;
- }
- }
+ for (HANDLE res = db_find_first(PROTONAME); res; res = db_find_next(res, PROTONAME)) {
+ u_long caddr = db_get_dw(res, PROTONAME, "ipaddr", -1);
+ if (caddr==addr.S_un.S_addr) {
+ if (make_permanent)
+ db_unset(res,"CList","NotOnList");
+ if (make_visible)
+ db_unset(res,"CList","Hidden");
+ return res;
+ }
}
if (add_to_list) {