From e9863f0cbd94f18f9361194ce488655df3b4cdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 20 Nov 2012 17:12:34 +0000 Subject: xFire: Removed extra icon slots from options and some fix. git-svn-id: http://svn.miranda-ng.org/main/trunk@2397 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/main.cpp | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) (limited to 'protocols/Xfire/src/main.cpp') diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index abebbf6341..679b671fab 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -2837,31 +2837,17 @@ void setBuddyStatusMsg(BuddyListEntry *entry,string statusmsg) if(IsContactMySelf(entry->username)) return; - - if(strlen(entry->statusmsg.c_str())>5) - { - char* away=(char*)entry->statusmsg.c_str(); - if( - (*(away)=='(' - && *(away+1)=='A' - && *(away+2)=='F' - && *(away+3)=='K' - && *(away+4)==')') - || - (*(away)=='(' - &&*(away+1)=='A' - && *(away+2)=='B' - && *(away+3)=='S' - && *(away+4)==')') - ) - { + + if (entry->statusmsg.length() > 5) { + string afk = entry->statusmsg.substr(0,5); + if (afk == "(AFK)" || afk == "(ABS)") mystatus=ID_STATUS_AWAY; - } } - + //statusmsg umwandeln - char * temp = mir_utf8decode((char*)entry->statusmsg.c_str(),NULL); - if(temp==NULL) temp=(char*)entry->statusmsg.c_str(); + char *temp = mir_utf8decode((char*)entry->statusmsg.c_str(),NULL); + if (temp==NULL) + temp=(char*)entry->statusmsg.c_str(); //DBDeleteContactSetting(hContact, "CList", "StatusMsg"); DBWriteContactSettingWord(entry->hcontact, protocolname, "Status", mystatus); @@ -2901,18 +2887,18 @@ void setBuddyStatusMsg(BuddyListEntry *entry,string statusmsg) strncpy(status,temp2,97); - if(strlen(entry->statusmsg.c_str())>0) + if(!entry->statusmsg.empty()) { strcat(status," - "); strcat(status,temp); } - DBWriteContactSettingString(entry->hcontact, "CList", "StatusMsg", status ); - DBWriteContactSettingString(entry->hcontact, protocolname, "XStatusMsg", status ); + DBWriteContactSettingString(entry->hcontact, "CList", "StatusMsg", status); + DBWriteContactSettingString(entry->hcontact, protocolname, "XStatusMsg", status); } else { - DBWriteContactSettingString(entry->hcontact, "CList", "StatusMsg", temp ); - DBWriteContactSettingString(entry->hcontact, protocolname, "XStatusMsg", temp ); + DBWriteContactSettingString(entry->hcontact, "CList", "StatusMsg", temp); + DBWriteContactSettingString(entry->hcontact, protocolname, "XStatusMsg", temp); DBWriteContactSettingByte(entry->hcontact, protocolname, "XStatusId", 1); DBWriteContactSettingString(entry->hcontact, protocolname, "XStatusName", ""); } -- cgit v1.2.3