summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_proto.cpp')
-rw-r--r--protocols/Tox/src/tox_proto.cpp105
1 files changed, 0 insertions, 105 deletions
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index e5bb613c8f..1ef5cf629a 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -145,71 +145,6 @@ int __cdecl CToxProto::AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage
HANDLE __cdecl CToxProto::ChangeInfo(int iInfoType, void* pInfoData) { return 0; }
-HANDLE __cdecl CToxProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* tszPath)
-{
- std::string toxId(getStringA(hContact, TOX_SETTINGS_ID));
- std::vector<uint8_t> clientId = HexStringToData(toxId);
-
- uint32_t number = tox_get_friend_number(tox, clientId.data());
- uint8_t fileNumber = (uint8_t)hTransfer;
-
- FileTransferParam *transfer = transfers.at(fileNumber);
- transfer->pfts.tszWorkingDir = mir_tstrdup(tszPath);
-
- //if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)fileNumber, (LPARAM)&transfer->pfts))
- {
- tox_file_send_control(tox, number, 1, fileNumber, TOX_FILECONTROL_ACCEPT, NULL, 0);
- }
-
- return hTransfer;
-}
-
-int __cdecl CToxProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
-{
- std::string toxId(getStringA(hContact, TOX_SETTINGS_ID));
- std::vector<uint8_t> clientId = HexStringToData(toxId);
-
- uint32_t number = tox_get_friend_number(tox, clientId.data());
- int fileNumber = (int)hTransfer;
-
- transfers.erase(fileNumber);
-
- int result = tox_file_send_control(tox, number, 1, fileNumber, TOX_FILECONTROL_KILL, NULL, 0);
-
- return result + 1;
-}
-
-int __cdecl CToxProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR*)
-{
- return FileCancel(hContact, hTransfer);
-}
-
-int __cdecl CToxProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename)
-{
- uint8_t fileNumber = (uint8_t)hTransfer;
- FileTransferParam *transfer = transfers.at(fileNumber);
-
- switch (*action)
- {
- case FILERESUME_SKIP:
- /*if (ft->p2p_appID != 0)
- p2p_sendStatus(ft, 603);
- else
- msnftp_sendAcceptReject (ft, false);*/
- break;
-
- case FILERESUME_RESUME:
- //replaceStrT(ft->std.tszCurrentFile, *szFilename);
- break;
-
- case FILERESUME_RENAME:
- replaceStrT(transfer->pfts.tszCurrentFile, *szFilename);
- break;
- }
-
- return 0;
-}
-
int __cdecl CToxProto::GetInfo(MCONTACT hContact, int infoType) { return 0; }
HANDLE __cdecl CToxProto::SearchBasic(const PROTOCHAR* id) { return 0; }
@@ -294,46 +229,6 @@ int __cdecl CToxProto::RecvUrl(MCONTACT hContact, PROTORECVEVENT*) { return 0; }
int __cdecl CToxProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT* hContactsList) { return 0; }
-HANDLE __cdecl CToxProto::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
-{
- std::string toxId(getStringA(hContact, TOX_SETTINGS_ID));
- std::vector<uint8_t> clientId = HexStringToData(toxId);
-
- uint32_t number = tox_get_friend_number(tox, clientId.data());
-
- TCHAR *fileName = _tcsrchr(ppszFiles[0], '\\') + 1;
-
- size_t fileDirLength = fileName - ppszFiles[0];
- TCHAR *fileDir = (TCHAR*)mir_alloc(sizeof(TCHAR)*fileDirLength);
- _tcsncpy(fileDir, ppszFiles[0], fileDirLength);
- fileDir[fileDirLength] = '\0';
-
- size_t fileSize = 0;
- FILE *file = _tfopen(ppszFiles[0], _T("rb"));
- if (file != NULL)
- {
- fseek(file, 0, SEEK_END);
- fileSize = ftell(file);
- fseek(file, 0, SEEK_SET);
- fclose(file);
- }
-
- int fileNumber = tox_new_file_sender(tox, number, fileSize, (uint8_t*)(char*)ptrA(mir_utf8encodeT(fileName)), _tcslen(fileName));
- if (fileNumber < 0)
- {
- debugLogA("CToxProto::SendFilesAsync: cannot send file");
- return NULL;
- }
-
- FileTransferParam *transfer = new FileTransferParam(fileNumber, fileName, fileSize);
- transfer->pfts.hContact = hContact;
- transfer->pfts.flags |= PFTS_RECEIVING;
- transfer->pfts.tszWorkingDir = fileDir;
- transfers[fileNumber] = transfer;
-
- return (HANDLE)fileNumber;
-}
-
int __cdecl CToxProto::SendMsg(MCONTACT hContact, int flags, const char* msg)
{
std::string toxId(getStringA(hContact, TOX_SETTINGS_ID));