summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp14
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp18
2 files changed, 13 insertions, 19 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 350f99f536..4a7dd0e047 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -991,13 +991,15 @@ void InitStatusList()
VOID CALLBACK ConnectionTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
- if (uMsg == WM_TIMER)
- {
- char szProto[256];
- //We've received a timer message: enable the popups for a specified protocol.
+ if (uMsg == WM_TIMER) {
KillTimer(hwnd, idEvent);
- DWORD dwResult = (DWORD)GetAtomNameA((ATOM)idEvent, szProto, sizeof(szProto));
- if (dwResult) db_set_b(0, MODULE, szProto, 1);
+
+ //We've received a timer message: enable the popups for a specified protocol.
+ char szProto[256];
+ if ( GetAtomNameA((ATOM)idEvent, szProto, sizeof(szProto)) > 0) {
+ db_set_b(0, MODULE, szProto, 1);
+ DeleteAtom((ATOM)idEvent);
+ }
}
}
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 706764a81c..75df1bfadd 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -304,8 +304,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo
{
Clear();
- if (filename.empty())
- {
+ if (filename.empty()) {
m_Name = _T("Nothing loaded");
return false;
}
@@ -315,10 +314,8 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo
// Load xep file
int fh = _topen(modpath.c_str(), _O_BINARY | _O_RDONLY);
- if (fh == -1)
- {
- if (!noerr)
- {
+ if (fh == -1) {
+ if (!noerr) {
static const TCHAR errmsg[] = LPGENT("Smiley Pack %s not found.\nSelect correct Smiley Pack in the Miranda Options | Customize | Smileys.");
TCHAR msgtxt[1024];
mir_sntprintf(msgtxt, SIZEOF(msgtxt), TranslateTS(errmsg), modpath.c_str());
@@ -347,17 +344,11 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo
bkstring tbuf;
if (len>2 && *(wchar_t*)buf == 0xfeff)
- {
tbuf = W2T_SM((wchar_t*)buf+1);
- }
else if (len>3 && buf[0]=='\xef' && buf[1]=='\xbb' && buf[2]=='\xbf')
- {
tbuf = W2T_SM(A2W_SM(buf+3, CP_UTF8));
- }
else
- {
tbuf = A2T_SM(buf);
- }
delete[] buf;
@@ -367,7 +358,8 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo
else
res = LoadSmileyFileXEP(tbuf, onlyInfo, modpath);
- if (errorFound) ReportError(TranslateT("There were problems loading smiley pack (it should be corrected).\nSee Network Log for details."));
+ if (errorFound)
+ ReportError(TranslateT("There were problems loading smiley pack (it should be corrected).\nSee Network Log for details."));
return res;
}