diff --git a/telegram-adium/AdiumTelegramAccount.h b/telegram-adium/AdiumTelegramAccount.h index 7d9fe27..3ccde70 100644 --- a/telegram-adium/AdiumTelegramAccount.h +++ b/telegram-adium/AdiumTelegramAccount.h @@ -16,7 +16,7 @@ #import #import +#import -@interface AdiumTelegramAccount : CBPurpleAccount - +@interface AdiumTelegramAccount : CBPurpleAccount @end diff --git a/telegram-adium/AdiumTelegramAccount.m b/telegram-adium/AdiumTelegramAccount.m index 1e84d01..fdd2bca 100644 --- a/telegram-adium/AdiumTelegramAccount.m +++ b/telegram-adium/AdiumTelegramAccount.m @@ -16,6 +16,9 @@ #import "AdiumTelegramAccount.h" #import +#import +#import +#import "tgp-ft.h" @implementation AdiumTelegramAccount @@ -44,4 +47,24 @@ return YES; } +- (void)beginSendOfFileTransfer:(ESFileTransfer *)fileTransfer +{ + [super _beginSendOfFileTransfer:fileTransfer]; +} + +- (void)acceptFileTransferRequest:(ESFileTransfer *)fileTransfer +{ + [super acceptFileTransferRequest:fileTransfer]; +} + +- (void)rejectFileReceiveRequest:(ESFileTransfer *)fileTransfer +{ + [super rejectFileReceiveRequest:fileTransfer]; +} + +- (void)cancelFileTransfer:(ESFileTransfer *)fileTransfer +{ + [super cancelFileTransfer:fileTransfer]; +} + @end diff --git a/telegram-adium/telegram-adium.xcodeproj/project.pbxproj b/telegram-adium/telegram-adium.xcodeproj/project.pbxproj index 7f7704f..50302b5 100644 --- a/telegram-adium/telegram-adium.xcodeproj/project.pbxproj +++ b/telegram-adium/telegram-adium.xcodeproj/project.pbxproj @@ -36,6 +36,7 @@ C49A915819BBC5C5001B3DC0 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = C49A915719BBC5C5001B3DC0 /* libz.dylib */; }; C4D819031A5C85FE0044CBA9 /* lodepng.c in Sources */ = {isa = PBXBuildFile; fileRef = C4D819011A5C85FE0044CBA9 /* lodepng.c */; }; C4D819061A5C862E0044CBA9 /* tgp-structs.c in Sources */ = {isa = PBXBuildFile; fileRef = C4D819041A5C862E0044CBA9 /* tgp-structs.c */; }; + C4E528111A8A907200C4B915 /* tgp-ft.c in Sources */ = {isa = PBXBuildFile; fileRef = C4E5280F1A8A907200C4B915 /* tgp-ft.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -85,6 +86,8 @@ C4D819021A5C85FE0044CBA9 /* lodepng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lodepng.h; sourceTree = ""; }; C4D819041A5C862E0044CBA9 /* tgp-structs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "tgp-structs.c"; path = "../tgp-structs.c"; sourceTree = ""; }; C4D819051A5C862E0044CBA9 /* tgp-structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "tgp-structs.h"; path = "../tgp-structs.h"; sourceTree = ""; }; + C4E5280F1A8A907200C4B915 /* tgp-ft.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "tgp-ft.c"; path = "../tgp-ft.c"; sourceTree = ""; }; + C4E528101A8A907200C4B915 /* tgp-ft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "tgp-ft.h"; path = "../tgp-ft.h"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -203,6 +206,8 @@ C41D58401A16D88E00B22448 /* tgp-2prpl.c */, C431EB7B1A76C737006521CB /* tgp-chat.c */, C431EB7C1A76C737006521CB /* tgp-chat.h */, + C4E5280F1A8A907200C4B915 /* tgp-ft.c */, + C4E528101A8A907200C4B915 /* tgp-ft.h */, ); name = "telegram-purple"; sourceTree = ""; @@ -289,6 +294,7 @@ C438CE331A12C07800E1DA0F /* telegram-base.c in Sources */, C438CE341A12C07800E1DA0F /* telegram-purple.c in Sources */, C4877C1819BB37EA006FA91F /* TelegramService.m in Sources */, + C4E528111A8A907200C4B915 /* tgp-ft.c in Sources */, C438CE361A12C07800E1DA0F /* tgp-timers.c in Sources */, C410949B19BB337A0083BF3F /* TelegramPlugin.m in Sources */, C4877C1E19BB676B006FA91F /* AdiumTelegramAccount.m in Sources */, diff --git a/tgp-ft.c b/tgp-ft.c index 3d0e9da..1776d5b 100644 --- a/tgp-ft.c +++ b/tgp-ft.c @@ -166,6 +166,11 @@ PurpleXfer *tgprpl_new_xfer (PurpleConnection * gc, const char *who) { connection_data *conn = purple_connection_get_protocol_data (gc); PurpleXfer *X = purple_xfer_new (conn->pa, PURPLE_XFER_SEND, who); + if (X) { + purple_xfer_set_init_fnc (X, tgprpl_xfer_send_init); + purple_xfer_set_cancel_send_fnc (X, tgprpl_xfer_canceled); + tgprpl_xfer_init_data (X, purple_connection_get_protocol_data (gc), NULL); + } return (PurpleXfer *)X; } @@ -179,7 +184,6 @@ void tgprpl_recv_file (PurpleConnection * gc, const char *who, struct tgl_docume purple_xfer_set_filename (X, D->caption); purple_xfer_set_init_fnc (X, tgprpl_xfer_recv_init); purple_xfer_set_cancel_recv_fnc (X, tgprpl_xfer_canceled); - tgprpl_xfer_init_data (X, purple_connection_get_protocol_data (gc), D); purple_xfer_request (X); @@ -189,8 +193,6 @@ void tgprpl_send_file (PurpleConnection * gc, const char *who, const char *file) debug ("tgprpl_send_file()"); PurpleXfer *X = tgprpl_new_xfer (gc, who); - purple_xfer_set_init_fnc (X, tgprpl_xfer_send_init); - purple_xfer_set_cancel_send_fnc (X, tgprpl_xfer_canceled); if (file) { purple_xfer_request_accepted (X, file); @@ -198,7 +200,5 @@ void tgprpl_send_file (PurpleConnection * gc, const char *who, const char *file) } else { purple_xfer_request (X); } - - tgprpl_xfer_init_data (X, purple_connection_get_protocol_data (gc), NULL); }