From e58823d961a630eb62e60d2ccb443761ba5f1704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Jun 2012 15:51:34 +0000 Subject: - all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs. - massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/useronline/useronline.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/modules/useronline/useronline.cpp') diff --git a/src/modules/useronline/useronline.cpp b/src/modules/useronline/useronline.cpp index 5fec748a17..c3a4562ae4 100644 --- a/src/modules/useronline/useronline.cpp +++ b/src/modules/useronline/useronline.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -24,24 +24,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int uniqueEventId=0; -static int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam) +static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam) { DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; - int newStatus,oldStatus; + int newStatus, oldStatus; - if ((HANDLE)wParam == NULL || strcmp(cws->szSetting,"Status")) return 0; + if ((HANDLE)wParam == NULL || strcmp(cws->szSetting, "Status")) return 0; newStatus=cws->value.wVal; - oldStatus=DBGetContactSettingWord((HANDLE)wParam,"UserOnline","OldStatus",ID_STATUS_OFFLINE); - DBWriteContactSettingWord((HANDLE)wParam,"UserOnline","OldStatus",(WORD)newStatus); - if (CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE)) return 0; - if (DBGetContactSettingByte((HANDLE)wParam,"CList","Hidden",0)) return 0; + oldStatus=DBGetContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE); + DBWriteContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", (WORD)newStatus); + if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0; + if (DBGetContactSettingByte((HANDLE)wParam, "CList", "Hidden", 0)) return 0; if (newStatus == ID_STATUS_OFFLINE&&oldStatus != ID_STATUS_OFFLINE) { // Remove the event from the queue if it exists since they are now offline - int lastEvent = (int)DBGetContactSettingDword((HANDLE)wParam,"UserOnline","LastEvent",0); + int lastEvent = (int)DBGetContactSettingDword((HANDLE)wParam, "UserOnline", "LastEvent", 0); if (lastEvent) { - CallService(MS_CLIST_REMOVEEVENT,wParam,(LPARAM)lastEvent); - DBWriteContactSettingDword((HANDLE)wParam,"UserOnline", "LastEvent", 0); + CallService(MS_CLIST_REMOVEEVENT, wParam, (LPARAM)lastEvent); + DBWriteContactSettingDword((HANDLE)wParam, "UserOnline", "LastEvent", 0); } } if ((newStatus == ID_STATUS_ONLINE || newStatus == ID_STATUS_FREECHAT) && @@ -53,18 +53,18 @@ static int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam) CLISTEVENT cle; TCHAR tooltip[256]; - ZeroMemory(&cle,sizeof(cle)); + ZeroMemory(&cle, sizeof(cle)); cle.cbSize=sizeof(cle); cle.flags=CLEF_ONLYAFEW | CLEF_TCHAR; cle.hContact=(HANDLE)wParam; cle.hDbEvent=(HANDLE)(uniqueEventId++); cle.hIcon = LoadSkinIcon( SKINICON_OTHER_USERONLINE, false ); cle.pszService="UserOnline/Description"; - mir_sntprintf(tooltip,SIZEOF(tooltip),TranslateT("%s is Online"), cli.pfnGetContactDisplayName(( HANDLE )wParam, 0 )); + mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is Online"), cli.pfnGetContactDisplayName(( HANDLE )wParam, 0 )); cle.ptszTooltip=tooltip; - CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle); + CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); IconLib_ReleaseIcon( cle.hIcon, 0 ); - DBWriteContactSettingDword(cle.hContact,"UserOnline", "LastEvent", (DWORD)cle.hDbEvent); + DBWriteContactSettingDword(cle.hContact, "UserOnline", "LastEvent", (DWORD)cle.hDbEvent); SkinPlaySound("UserOnline"); } } @@ -108,10 +108,10 @@ static int UserOnlineAccountsChanged( WPARAM eventCode, LPARAM lParam ) int LoadUserOnlineModule(void) { - HookEvent(ME_DB_CONTACT_SETTINGCHANGED,UserOnlineSettingChanged); + HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UserOnlineSettingChanged); HookEvent(ME_PROTO_ACK, UserOnlineAck); HookEvent(ME_SYSTEM_MODULESLOADED, UserOnlineModulesLoaded); HookEvent(ME_PROTO_ACCLISTCHANGED, UserOnlineAccountsChanged); - SkinAddNewSoundEx("UserOnline","Alerts","Online"); + SkinAddNewSoundEx("UserOnline", "Alerts", "Online"); return 0; } -- cgit v1.2.3