diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-11 23:37:54 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-11 23:37:54 +0300 |
commit | f0bca208f1d668f0ad3d51afdafbb9d30ec8555b (patch) | |
tree | 19354a120aa15c7b204a0061b03e1d6f340d0760 /init.cpp | |
parent | a5086db857e474538a24df4b05e5aab831d4c2fe (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.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -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; } |