diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-15 21:47:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-15 21:47:10 +0000 |
commit | 9d482ed81c2a6a3361a5a9b2d0efbfc4b6b815c5 (patch) | |
tree | e5b304c159f7c79ab44926eee439eb93288acec6 /plugins/BuddyExpectator | |
parent | 7fe6e93058f0e9253e2a79d7fc2d7a136784f791 (diff) |
- POPUPDATAT_V2 replaced with POPUPDATAT in all possible cases;
- fix: wrong popup initialization code;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator')
-rw-r--r-- | plugins/BuddyExpectator/src/BuddyExpectator.cpp | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 65c2cbbfbd..3af375bfb7 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -236,7 +236,7 @@ bool isContactGoneFor(HANDLE hContact, int days) TCHAR szInfo[200];
POPUPDATAT_V2 ppd = {0};
- ppd.cbSize = sizeof(POPUPDATAT_V2);
+ ppd.cbSize = sizeof(ppd);
ppd.lchContact = hContact;
ppd.lchIcon = Skin_GetIcon("enabled_icon");
@@ -275,8 +275,7 @@ void ReturnNotify(HANDLE hContact, TCHAR *message) if (options.iShowPopUp > 0) {
// Display PopUp
- POPUPDATAT_V2 ppd = { 0 };
- ppd.cbSize = sizeof(ppd);
+ POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
@@ -288,7 +287,6 @@ void ReturnNotify(HANDLE hContact, TCHAR *message) ppd.PluginWindowProc = PopupDlgProc;
ppd.PluginData = NULL;
ppd.iSeconds = options.iPopUpDelay;
-
PUAddPopUpT(&ppd);
}
@@ -315,9 +313,7 @@ void GoneNotify(HANDLE hContact, TCHAR *message) if (options.iShowPopUp2 > 0) {
// Display PopUp
- POPUPDATAT_V2 ppd = {0};
- ppd.cbSize = sizeof(POPUPDATAT_V2);
-
+ POPUPDATAT ppd = {0};
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
@@ -520,10 +516,8 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) // Last status
db_set_dw(hContact, MODULE_NAME, "LastStatus", prevStatus);
- if (prevStatus == ID_STATUS_OFFLINE)
- {
- if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
- {
+ if (prevStatus == ID_STATUS_OFFLINE) {
+ if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
// Display PopUp
POPUPDATAT_V2 ppd = {0};
ppd.cbSize = sizeof(POPUPDATAT_V2);
@@ -532,8 +526,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) ppd.lchIcon = Skin_GetIcon("enabled_icon");
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
- if (!options.iUsePopupColors)
- {
+ if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopUpColorBack;
ppd.colorText = options.iPopUpColorFore;
}
@@ -551,16 +544,13 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) }
}
- if (currentStatus == ID_STATUS_OFFLINE)
- {
+ if (currentStatus == ID_STATUS_OFFLINE) {
setLastSeen(hContact);
return 0;
}
- if (db_get_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline)
- {
+ if (db_get_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline) {
ReturnNotify(hContact, TranslateT("has gone online for the first time."));
-
setLastSeen(hContact);
}
@@ -568,19 +558,15 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) if (isContactGoneFor(hContact, AbsencePeriod))
{
TCHAR* message = TranslateT("has returned after a long absence.");
- time_t tmpTime;
TCHAR tmpBuf[251] = {0};
- tmpTime = getLastSeen(hContact);
- if (tmpTime != -1)
- {
+ time_t tmpTime = getLastSeen(hContact);
+ if (tmpTime != -1) {
_tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
- else
- {
+ else {
tmpTime = getLastInputMsg(hContact);
- if (tmpTime != -1)
- {
+ if (tmpTime != -1) {
_tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
|