summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-07-25 13:11:06 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-07-25 13:11:06 +0300
commit69581b8648e0c2fe96f454455763359ebeeba46a (patch)
tree524a4088b16ad99993b4ca9994ccc55b554c49db /protocols
parent1acef408decb2450ce8cea52b37674f1972b9f82 (diff)
SRMM: automatic RTF log redraw on event's change/removal
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber.cpp3
-rw-r--r--protocols/JabberG/src/jabber_file.cpp17
-rw-r--r--protocols/JabberG/src/stdafx.h2
-rw-r--r--protocols/Telegram/src/avatars.cpp2
-rw-r--r--protocols/Telegram/src/main.cpp2
-rw-r--r--protocols/Telegram/src/stdafx.h2
6 files changed, 10 insertions, 18 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 1c13d97a87..e19f7bc264 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -36,7 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma comment(lib, "Secur32.lib")
HMODULE hMsftedit;
-HANDLE g_hevEventEdited;
CMPlugin g_plugin;
@@ -127,8 +126,6 @@ int CMPlugin::Load()
bPlatform = false;
#endif
- g_hevEventEdited = CreateHookableEvent(ME_DB_EVENT_EDITED);
-
Miranda_GetVersionText(szCoreVersion, _countof(szCoreVersion));
CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&g_cbCountries, (LPARAM)&g_countries);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index aea0b617b1..863874a011 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -31,9 +31,9 @@ INT_PTR __cdecl CJabberProto::OnOfflineFile(WPARAM param, LPARAM)
return 0;
}
-void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
+void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *ofd)
{
- DB::EventInfo dbei(param->hDbEvent);
+ DB::EventInfo dbei(ofd->hDbEvent);
if (m_bJabberOnline && dbei && !strcmp(dbei.szModule, m_szModuleName) && dbei.eventType == EVENTTYPE_FILE) {
DB::FILE_BLOB blob(dbei);
if (const char *url = blob.getUrl()) {
@@ -49,7 +49,7 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
}
else if (ret != 2 || (strcmp(protocol, "https") && strcmp(protocol, "http"))) {
debugLogA("Wrong url");
- delete param;
+ delete ofd;
return;
}
@@ -63,7 +63,7 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
// download the page
NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
if (nlhrReply && nlhrReply->resultCode == 200) {
- FILE *f = _wfopen(param->wszPath, L"wb");
+ FILE *f = _wfopen(ofd->wszPath, L"wb");
size_t written = 0;
if (f) {
if (encrypted) {
@@ -96,17 +96,16 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
if (written) {
DBVARIANT dbv = { DBVT_DWORD };
dbv.dVal = (DWORD)written;
- db_event_setJson(param->hDbEvent, "ft", &dbv);
- db_event_setJson(param->hDbEvent, "fs", &dbv);
- NotifyEventHooks(g_hevEventEdited, 0, param->hDbEvent);
+ db_event_setJson(ofd->hDbEvent, "ft", &dbv);
+ db_event_setJson(ofd->hDbEvent, "fs", &dbv);
- param->Finish();
+ ofd->Finish();
}
}
}
}
- delete param;
+ delete ofd;
}
void CJabberProto::OnCreateOfflineFile(DB::FILE_BLOB &blob, void *pHandle)
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index a96311c6f0..bc16368761 100644
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -508,7 +508,7 @@ extern unsigned int g_nTempFileId;
extern int g_cbCountries;
extern struct CountryListEntry* g_countries;
-extern HANDLE hExtListInit, hDiscoInfoResult, g_hevEventEdited;
+extern HANDLE hExtListInit, hDiscoInfoResult;
/*******************************************************************
* Function declarations
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp
index 4a08866989..48236fd9e7 100644
--- a/protocols/Telegram/src/avatars.cpp
+++ b/protocols/Telegram/src/avatars.cpp
@@ -204,8 +204,6 @@ void CTelegramProto::ProcessFile(TD::updateFile *pObj)
F->ofd->ResetFileName(wszFullName); // resulting ofd->wszPath may differ from wszFullName
MoveFileW(wszExistingFile, F->ofd->wszPath);
- NotifyEventHooks(g_plugin.m_hevEventEdited, 0, F->ofd->hDbEvent);
-
F->ofd->Finish();
}
diff --git a/protocols/Telegram/src/main.cpp b/protocols/Telegram/src/main.cpp
index 9ed452ad48..32206a9b6c 100644
--- a/protocols/Telegram/src/main.cpp
+++ b/protocols/Telegram/src/main.cpp
@@ -49,7 +49,5 @@ int CMPlugin::Load()
registerIcon("Protocols/Telegram", iconList, "tg");
m_hIcon = ExtraIcon_RegisterIcolib("tg_premium", LPGEN("Telegram Premium user"), getIconHandle(IDI_PREMIUM));
-
- m_hevEventEdited = CreateHookableEvent(ME_DB_EVENT_EDITED);
return 0;
}
diff --git a/protocols/Telegram/src/stdafx.h b/protocols/Telegram/src/stdafx.h
index dad748c7cd..f6e7100f53 100644
--- a/protocols/Telegram/src/stdafx.h
+++ b/protocols/Telegram/src/stdafx.h
@@ -49,7 +49,7 @@ struct CMPlugin : public ACCPROTOPLUGIN<CTelegramProto>
{
CMPlugin();
- HANDLE m_hIcon, m_hevEventEdited;
+ HANDLE m_hIcon;
int Load() override;
};