summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-13 14:40:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-13 14:40:09 +0300
commit338b214ae6675a565abc546f3f31c253d78b1dd2 (patch)
tree9c33528db9eca27672e707a692852031c1132074
parent0775cb103604d76f614e417eac1c52fd3233221b (diff)
code cleaning
-rw-r--r--src/core/stdfile/src/file.cpp45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 90fe7b112e..4d007ec3ed 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -93,29 +93,6 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam)
return 0;
}
-static void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)
-{
- CLISTEVENT cle = {};
- cle.hContact = hContact;
- cle.hDbEvent = hdbe;
- cle.lParam = lParam;
- if (g_plugin.bAutoAccept && Contact::OnList(hContact)) {
- LaunchRecvDialog(&cle);
- }
- else {
- Skin_PlaySound("RecvFile");
-
- wchar_t szTooltip[256];
- mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(hContact));
- cle.szTooltip.w = szTooltip;
-
- cle.flags |= CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
- cle.pszService = "SRFile/RecvFile";
- g_clistApi.pfnAddEvent(&cle);
- }
-}
-
int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput)
{
HKEY hKey;
@@ -375,7 +352,27 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
}
MEVENT hdbe = db_event_add(ccs->hContact, &dbei);
- PushFileEvent(ccs->hContact, hdbe, pre->lParam);
+
+ CLISTEVENT cle = {};
+ cle.hContact = ccs->hContact;
+ cle.hDbEvent = hdbe;
+ cle.lParam = pre->lParam;
+
+ if (g_plugin.bAutoAccept && Contact::OnList(ccs->hContact))
+ LaunchRecvDialog(&cle);
+ else {
+ Skin_PlaySound("RecvFile");
+
+ wchar_t szTooltip[256];
+ mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(ccs->hContact));
+ cle.szTooltip.w = szTooltip;
+
+ cle.flags |= CLEF_UNICODE;
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
+ cle.pszService = "SRFile/RecvFile";
+ g_clistApi.pfnAddEvent(&cle);
+ }
+
return hdbe;
}