diff options
author | George Hazan <george.hazan@gmail.com> | 2015-12-17 15:58:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-12-17 15:58:24 +0000 |
commit | 1852979843c66eaa1e96983827c42b3b83bb7b42 (patch) | |
tree | f3fc5496b804de9b3955cee111061fb520baf0fd /plugins | |
parent | 60ca92e4e4f5bd5193f942a84789cbe3f11c5d1d (diff) |
warning fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@15883 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/SimpleStatusMsg/src/awaymsg.cpp | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 9d37a4cd08..f373904675 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -336,39 +336,35 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM) static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
{
- TCHAR str[128];
+ Menu_ShowItem(hCopyMsgMenuItem, false);
+ Menu_ShowItem(hGoToURLMenuItem, false);
+ Menu_ShowItem(hAwayMsgMenuItem, false);
+
char *szProto = GetContactProto(hContact);
- int iHidden = szProto ? db_get_b(hContact, szProto, "ChatRoom", 0) : 0;
- int iStatus;
-
- if (!iHidden) {
- iHidden = 1;
- iStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
- iHidden = 0;
- HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
- mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
- Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
- IcoLib_ReleaseIcon(hIcon);
+ if (szProto == NULL || db_get_b(hContact, szProto, "ChatRoom", 0))
+ return 0;
+
+ TCHAR str[128];
+ int iStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
+ HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
+ mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
+ IcoLib_ReleaseIcon(hIcon);
+
+ ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
+ if (szMsg != NULL) {
+ mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ Menu_ModifyItem(hCopyMsgMenuItem, str);
+
+ if (StrFindURL(szMsg) != NULL) {
+ mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ Menu_ModifyItem(hGoToURLMenuItem, str);
+ }
}
}
}
- else Menu_ShowItem(hAwayMsgMenuItem, false);
-
- ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
-
- if (!iHidden && szMsg != NULL) {
- mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
- Menu_ModifyItem(hCopyMsgMenuItem, str);
- }
- else Menu_ShowItem(hCopyMsgMenuItem, false);
-
- if (!iHidden && szMsg != NULL && StrFindURL(szMsg) != NULL) {
- mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
- Menu_ModifyItem(hGoToURLMenuItem, str);
- }
- else Menu_ShowItem(hGoToURLMenuItem, false);
return 0;
}
|