From 0a749321d05905e3d6396b053cbe8b208e7e4aa6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Jun 2013 21:16:39 +0000 Subject: minor code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@5029 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_chat.cpp | 16 ++++++---------- protocols/JabberG/src/jabber_icolib.cpp | 13 ++++++------- protocols/JabberG/src/jabber_menu.cpp | 8 ++++---- protocols/JabberG/src/jabber_thread.cpp | 2 +- 4 files changed, 17 insertions(+), 22 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 6e7a0cc115..450e34bb5c 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -213,19 +213,15 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, JABBER_RESOURCE_ case INFO_STATUS: if (m_options.GcLogStatuses) { - if (user->statusMessage) { + TCHAR *ptszDescr = pcli->pfnGetStatusModeDescription(user->status, 0); + if (user->statusMessage) mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s with message: %s"), - user->resourceName, - CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, user->status, GSMDF_TCHAR), - user->statusMessage); - } - else { - mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s"), - user->resourceName, - CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, user->status, GSMDF_TCHAR)); - } + user->resourceName, ptszDescr, user->statusMessage); + else + mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s"), user->resourceName, ptszDescr); } break; + case INFO_CONFIG: if (m_options.GcLogConfig) mir_sntprintf(buf, SIZEOF(buf), TranslateT("Room configuration was changed.")); diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 698276b8a5..ed7f03efab 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -324,15 +324,14 @@ int CJabberProto::LoadAdvancedIcons(int iID) EnterCriticalSection(&m_csModeMsgMutex); for (int i=0; i < ID_STATUS_ONTHEPHONE-ID_STATUS_OFFLINE; i++) { - HICON hicon; BOOL needFree; - int n=skinStatusToJabberStatus[i]; - TCHAR *descr = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, n+ID_STATUS_OFFLINE, GSMDF_TCHAR); + int n = skinStatusToJabberStatus[i]; + TCHAR *descr = pcli->pfnGetStatusModeDescription(n+ID_STATUS_OFFLINE, 0); mir_snprintf(Uname, SIZEOF(Uname), "%s_Transport_%s_%d", m_szModuleName, proto, n); - hicon=(HICON)LoadTransportIcon(defFile,-skinIconStatusToResourceId[i],Uname,Group,descr,-(n+ID_STATUS_OFFLINE),&needFree); - int index=(m_transportProtoTableStartIndex[iID] == -1)?-1:m_transportProtoTableStartIndex[iID]+n; - int added=ImageList_ReplaceIcon(hAdvancedStatusIcon,index,hicon?hicon:empty); - if (first == -1) first=added; + HICON hicon = LoadTransportIcon(defFile,-skinIconStatusToResourceId[i],Uname,Group,descr,-(n+ID_STATUS_OFFLINE),&needFree); + int index = (m_transportProtoTableStartIndex[iID] == -1)?-1:m_transportProtoTableStartIndex[iID]+n; + int added = ImageList_ReplaceIcon(hAdvancedStatusIcon,index,hicon?hicon:empty); + if (first == -1) first = added; if (hicon && needFree) DestroyIcon(hicon); } diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 27fe6b7b40..5ae47f809b 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -291,12 +291,12 @@ void g_MenuInit(void) mi.icolibItem = g_GetIconHandle(IDI_NOTES); g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi); - mi.flags |= CMIF_ROOTHANDLE; + mi.flags |= CMIF_ROOTHANDLE | CMIF_TCHAR; for (int i = 0; i < SIZEOF(PresenceModeArray); i++) { char buf[] = "Jabber/DirectPresenceX"; buf[SIZEOF(buf)-2] = '0' + i; mi.pszService = buf; - mi.pszName = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, PresenceModeArray[i].mode, 0); + mi.ptszName = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0); mi.position = -1999901000; mi.hParentMenu = g_hMenuDirectPresence[0]; mi.icolibItem = LoadSkinnedIcon(PresenceModeArray[i].icon); @@ -304,7 +304,7 @@ void g_MenuInit(void) CreateServiceFunctionParam(mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode); } - mi.flags &= ~CMIF_ROOTHANDLE; + mi.flags &= ~(CMIF_ROOTHANDLE | CMIF_TCHAR); // Resource selector mi.pszService = "Jabber/ResourceSelectorDummySvc"; @@ -466,7 +466,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) } mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s [%s, %d]"), item->resource[i].resourceName, - (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, item->resource[i].status, GSMDF_TCHAR), + pcli->pfnGetStatusModeDescription(item->resource[i].status, 0), item->resource[i].priority); clmi.ptszName = szTmp; Menu_ModifyItem(m_phMenuResourceItems[i], &clmi); diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 935f3d4e93..49b4e045e4 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1666,7 +1666,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) if (_tcschr(from, '@')==NULL) { UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH); } - Log("%S (%S) online, set contact status to %s", nick, from, CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)status,0)); + Log("%S (%S) online, set contact status to %S", nick, from, pcli->pfnGetStatusModeDescription(status, 0)); mir_free(nick); HXML xNode; -- cgit v1.2.3