示例#1
0
void CSendHTTPServer::SendThread()
{
	INT_PTR ret;

	if (ServiceExists(MS_HTTP_GET_LINK)) {
		//patched plugin version
		ret = CallService(MS_HTTP_ADD_CHANGE_REMOVE, (WPARAM)m_hContact, (LPARAM)&m_fsi);
		if (!ret) {
			mir_free(m_URL);
			m_URL = (char*)CallService(MS_HTTP_GET_LINK, (WPARAM)m_fsi.pszSrvPath, NULL);
		}
	}
	else {
		//original plugin
		m_fsi.dwOptions = OPT_SEND_LINK;

		//send DATA and wait for reply
		ret = CallService(MS_HTTP_ADD_CHANGE_REMOVE, (WPARAM)m_hContact, (LPARAM)&m_fsi);
	}

	if (ret != 0) {
		Error(LPGENT("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret);
		Exit(ret); return;
	}

	//Share the file by HTTP Server plugin, SendSS does not own the file anymore = auto-delete won't work
	m_bDeleteAfterSend = false;

	if (m_URL && *m_URL) {
		svcSendMsgExit(m_URL); return;
	}
	Exit(ACKRESULT_FAILED);
}
示例#2
0
void CSendFTPFile::SendThread() {

	INT_PTR ret = FTPFileUploadA(m_hContact, FNUM_DEFAULT, FMODE_RAWFILE, &m_pszFileName,1);
	if (ret != 0) {
		Error(LPGENT("%s (%i):\nCould not add a share to the FTP File plugin."),TranslateTS(m_pszSendTyp),ret);
		Exit(ret); return;
	}

	//Can't delete the file since FTP File plugin will use it
	m_bDeleteAfterSend = false;

	if (m_URL && *m_URL) {/// @fixme : m_URL never set
		svcSendMsgExit(m_URL); return;
	}
	Exit(ACKRESULT_FAILED);
}
示例#3
0
void CSendDropbox::SendThread()
{
	/// @todo : SS_DLG_DESCRIPTION and SS_DLG_DELETEAFTERSSEND are of no use as of now since we don't track upload progress

	DropboxUploadInfo ui = { m_pszFile, _T("SendSS") };

	char **test = &m_URL;
	if (CallService(MS_DROPBOX_UPLOAD, (WPARAM)&m_URL, (LPARAM)&ui))
	{
		Error(LPGENT("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0);
		Exit(ACKRESULT_FAILED); return;
	}

	if (m_URL)
		svcSendMsgExit(m_URL);
	else
		Exit(ACKRESULT_FAILED);
}
示例#4
0
void CSendDropbox::SendThread()
{
	/// @todo : SS_DLG_DESCRIPTION and SS_DLG_DELETEAFTERSSEND are of no use as of now since we don't track upload progress

	m_hDropHook = HookEventObj(ME_DROPBOX_SENT, OnDropSend, this);

	if ((m_hDropSend = (HANDLE)CallService(MS_DROPBOX_SEND_FILE, (WPARAM)m_hContact, (LPARAM)m_pszFile)) == NULL)
	{
		Error(LPGENT("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), (INT_PTR)m_hDropSend);
		Exit(ACKRESULT_FAILED); return;
	}

	m_hEvent.Wait();
	UnhookEvent(m_hDropHook);

	if (m_URL)
		svcSendMsgExit(m_URL);
	else
		Exit(ACKRESULT_FAILED);
}