summaryrefslogtreecommitdiff
path: root/plugins/BuddyExpectator/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-15 21:51:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-15 21:51:28 +0000
commitd5d85efcecd6fa2f2efd84b369a642f47a511169 (patch)
tree48ba1d4b12bd71aebe9ebe2faa996b5344065e5d /plugins/BuddyExpectator/src
parent9d482ed81c2a6a3361a5a9b2d0efbfc4b6b815c5 (diff)
oops
git-svn-id: http://svn.miranda-ng.org/main/trunk@4058 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator/src')
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp55
1 files changed, 26 insertions, 29 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 3af375bfb7..fdc2161c2f 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -230,37 +230,34 @@ bool isContactGoneFor(HANDLE hContact, int days)
int daysSinceMessage = -1;
if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg)/(60*60*24));
- if (options.hideInactive) {
- if (daysSinceMessage >= options.iSilencePeriod)
- if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULE_NAME, "NeverHide", 0)) {
- TCHAR szInfo[200];
-
- POPUPDATAT_V2 ppd = {0};
- ppd.cbSize = sizeof(ppd);
-
- ppd.lchContact = hContact;
- ppd.lchIcon = Skin_GetIcon("enabled_icon");
-
- mir_sntprintf(szInfo, 200, TranslateT("Hiding %s (%S)"), (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), GetContactProto(hContact));
- _tcsncpy(ppd.lptzContactName, szInfo, MAX_CONTACTNAME);
- mir_sntprintf(szInfo, 200, TranslateT("%d days since last message"), daysSinceMessage);
- _tcsncpy(ppd.lptzText, szInfo, MAX_SECONDLINE);
- if (!options.iUsePopupColors) {
- ppd.colorBack = options.iPopUpColorBack;
- ppd.colorText = options.iPopUpColorFore;
- }
- ppd.PluginWindowProc = HidePopupDlgProc;
- ppd.PluginData = NULL;
- ppd.iSeconds = -1;
+ if (options.hideInactive)
+ if (daysSinceMessage >= options.iSilencePeriod)
+ if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULE_NAME, "NeverHide", 0)) {
+ POPUPDATAT_V2 ppd = {0};
+ ppd.cbSize = sizeof(ppd);
+ ppd.lchContact = hContact;
+ ppd.lchIcon = Skin_GetIcon("enabled_icon");
- hideactions[0].flags = hideactions[1].flags = PAF_ENABLED;
- ppd.lpActions = hideactions;
- ppd.actionCount = 2;
+ mir_sntprintf(ppd.lptzContactName, MAX_CONTACTNAME, TranslateT("Hiding %s (%S)"),
+ CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR),
+ GetContactProto(hContact));
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NEWDATA);
+ mir_sntprintf(ppd.lptzText, MAX_SECONDLINE, TranslateT("%d days since last message"), daysSinceMessage);
- SkinPlaySound("buddyExpectatorHide");
- }
+ if (!options.iUsePopupColors) {
+ ppd.colorBack = options.iPopUpColorBack;
+ ppd.colorText = options.iPopUpColorFore;
+ }
+ ppd.PluginWindowProc = HidePopupDlgProc;
+ ppd.iSeconds = -1;
+
+ hideactions[0].flags = hideactions[1].flags = PAF_ENABLED;
+ ppd.lpActions = hideactions;
+ ppd.actionCount = 2;
+
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
+
+ SkinPlaySound("buddyExpectatorHide");
}
return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
@@ -520,7 +517,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
// Display PopUp
POPUPDATAT_V2 ppd = {0};
- ppd.cbSize = sizeof(POPUPDATAT_V2);
+ ppd.cbSize = sizeof(ppd);
ppd.lchContact = hContact;
ppd.lchIcon = Skin_GetIcon("enabled_icon");