From 99460dd367af9cfc622e749d6671b9945d08e4a8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jun 2014 14:18:22 +0000 Subject: useless metacontact sub's priorities wiped out git-svn-id: http://svn.miranda-ng.org/main/trunk@9562 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_utils.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/modules/metacontacts/meta_utils.cpp') diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index b917fce527..e63e3579d2 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -230,6 +230,22 @@ MCONTACT Meta_GetMostOnline(DBCachedContact *cc) * @return HANDLE to a contact */ +static int GetStatusPriority(int status) +{ + switch (status) { + case ID_STATUS_OFFLINE: return 8; + case ID_STATUS_AWAY: return 4; + case ID_STATUS_DND: return 7; + case ID_STATUS_NA: return 6; + case ID_STATUS_OCCUPIED: return 5; + case ID_STATUS_FREECHAT: return 1; + case ID_STATUS_ONTHEPHONE: return 2; + case ID_STATUS_OUTTOLUNCH: return 3; + } + + return 0; +} + MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigned long capability) { if (cc == NULL || cc->nDefault == -1) @@ -279,7 +295,7 @@ MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigne if (status <= ID_STATUS_OFFLINE) // status below ID_STATUS_OFFLINE is a connecting status continue; - if (GetRealPriority(szProto, status) < GetRealPriority(most_online_proto, most_online_status)) { + if (GetStatusPriority(status) < GetStatusPriority(most_online_status)) { most_online_status = status; most_online_contact = hContact; most_online_proto = szProto; -- cgit v1.2.3