From 30b23a3b901afcdc2a834ae7d4858babc78013b5 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Mon, 6 Apr 2015 19:12:09 +0000 Subject: MyDetails: Minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@12640 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MyDetails/src/data.cpp | 2 +- plugins/MyDetails/src/frame.cpp | 7 +++---- plugins/MyDetails/src/services.cpp | 22 ++++------------------ 3 files changed, 8 insertions(+), 23 deletions(-) (limited to 'plugins/MyDetails/src') diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 5b6a23001e..ff55810448 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -27,7 +27,7 @@ void InitProtocolData() { PROTOACCOUNT **protos; int count; - CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&protos); + ProtoEnumAccounts(&count, &protos); protocols = new ProtocolArray(count); diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index e592404583..a72b2148ad 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -672,8 +672,6 @@ void CalcRectangles(HWND hwnd) LONG height; if (opts.draw_avatar_custom_size) { - rc.right = opts.draw_avatar_custom_size_pixels; - width = opts.draw_avatar_custom_size_pixels; height = opts.draw_avatar_custom_size_pixels; } @@ -2131,9 +2129,10 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_DESTROY: KillTimer(hwnd, ID_FRAME_TIMER); - DeleteTooltipWindows(data); - if (data != NULL) + if (data != NULL) { + DeleteTooltipWindows(data); delete data; + } break; // Custom Messages ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index 80de374451..d4460ea744 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -188,11 +188,7 @@ INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam) char *proto = (char *)wParam; if (proto == NULL) { - if (protocols->default_nick != NULL) - mir_tstrncpy(ret, protocols->default_nick, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE); - else - ret[0] = '\0'; - + mir_tstrncpy(ret, protocols->default_nick, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE); return 0; } else { @@ -267,11 +263,7 @@ INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam) return -1; if (proto == NULL) { - if (protocols->default_avatar_file != NULL) - mir_tstrncpy(ret, protocols->default_avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE); - else - ret[0] = '\0'; - + mir_tstrncpy(ret, protocols->default_avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE); return 0; } @@ -411,7 +403,7 @@ INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam) int proto_num = -1; Protocol *proto = NULL; - if (status != 0 && (status < ID_STATUS_OFFLINE || status > ID_STATUS_OUTTOLUNCH)) + if (status < ID_STATUS_OFFLINE || status > ID_STATUS_OUTTOLUNCH) return -10; if (proto_name != NULL) { @@ -431,13 +423,7 @@ INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam) return -2; } else if (ServiceExists(MS_SIMPLESTATUSMSG_CHANGESTATUSMSG)) { - if (proto == NULL && status == 0) - CallService(MS_SIMPLESTATUSMSG_CHANGESTATUSMSG, protocols->GetGlobalStatus(), NULL); - else if (status == 0) - CallService(MS_SIMPLESTATUSMSG_CHANGESTATUSMSG, proto->status, (LPARAM)proto_name); - else - CallService(MS_SIMPLESTATUSMSG_CHANGESTATUSMSG, status, (LPARAM)proto_name); - + CallService(MS_SIMPLESTATUSMSG_CHANGESTATUSMSG, status, (LPARAM)proto_name); return 0; } -- cgit v1.2.3