summaryrefslogtreecommitdiff
path: root/init.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-10-11 23:37:54 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-10-11 23:37:54 +0300
commitf0bca208f1d668f0ad3d51afdafbb9d30ec8555b (patch)
tree19354a120aa15c7b204a0061b03e1d6f340d0760 /init.cpp
parenta5086db857e474538a24df4b05e5aab831d4c2fe (diff)
encrypted filetransfers //two paralell threads of more than one file will fail, miranda api lack of documentation, and ghaza does not
remember how to edentify thread )
Diffstat (limited to 'init.cpp')
-rw-r--r--init.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/init.cpp b/init.cpp
index 1530f82..768736c 100644
--- a/init.cpp
+++ b/init.cpp
@@ -136,6 +136,10 @@ int AddContact(WPARAM w, LPARAM l)
return 0;
}
+void temp_cleaner_thread();
+boost::thread cleaner(boost::bind(temp_cleaner_thread));
+
+
static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
{
@@ -152,6 +156,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
int onExtraImageListRebuilding(WPARAM, LPARAM);
int onExtraImageApplying(WPARAM wParam, LPARAM);
int onProtoAck(WPARAM, LPARAM);
+ int onSendFile(WPARAM, LPARAM);
void InitIconLib();
void InitCheck();
@@ -192,7 +197,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
if(bJabberAPI && bIsMiranda09)
HookEvent(ME_PROTO_ACCLISTCHANGED, GetJabberInterface);
-// HookEvent(ME_PROTO_ACK, onProtoAck); //filetransfer unimplemented now
+ HookEvent(ME_PROTO_ACK, onProtoAck); //filetransfer unimplemented now
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPreBuildContactMenu);
@@ -210,10 +215,13 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
pd.type=PROTOTYPE_ENCRYPTION;
CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
- CreateProtoServiceFunction(szGPGModuleName,PSR_MESSAGE,RecvMsgSvc);
- CreateProtoServiceFunction(szGPGModuleName,PSS_MESSAGE,SendMsgSvc);
- CreateProtoServiceFunction(szGPGModuleName,PSR_MESSAGE"W",RecvMsgSvc);
- CreateProtoServiceFunction(szGPGModuleName,PSS_MESSAGE"W",SendMsgSvc);
+ CreateProtoServiceFunction(szGPGModuleName, PSR_MESSAGE, RecvMsgSvc);
+ CreateProtoServiceFunction(szGPGModuleName, PSS_MESSAGE, SendMsgSvc);
+ CreateProtoServiceFunction(szGPGModuleName, PSR_MESSAGE"W", RecvMsgSvc);
+ CreateProtoServiceFunction(szGPGModuleName, PSS_MESSAGE"W", SendMsgSvc);
+
+ CreateProtoServiceFunction(szGPGModuleName, PSS_FILE, onSendFile);
+ CreateProtoServiceFunction(szGPGModuleName, PSS_FILE"W", onSendFile);
for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)szGPGModuleName))
@@ -221,6 +229,8 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
HookEvent(ME_DB_CONTACT_ADDED,AddContact);
+ cleaner.detach();
+
return 0;
@@ -237,5 +247,6 @@ extern "C" int __declspec(dllexport) Unload(void)
mir_free(outclosetag);
if(password)
delete [] password;
+ cleaner.~thread();
return 0;
}