Commit 2111b62d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Finished moving file transfer related code from ChatMessage to FileTransferChatMessageModifier

parent f6c4f0f5
......@@ -98,26 +98,6 @@ public:
int downloadFile ();
// -----------------------------------------------------------------------------
// Need to be public to be called from static C callbacks
// -----------------------------------------------------------------------------
void fileTransferOnProgress(belle_sip_body_handler_t *bh, belle_sip_message_t *m, size_t offset, size_t total);
int onSendBody(belle_sip_user_body_handler_t *bh, belle_sip_message_t *m, size_t offset, uint8_t *buffer, size_t *size);
void onSendEnd(belle_sip_user_body_handler_t *bh);
void onRecvBody(belle_sip_user_body_handler_t *bh, belle_sip_message_t *m, size_t offset, uint8_t *buffer, size_t size);
void onRecvEnd(belle_sip_user_body_handler_t *bh);
void fileUploadBackgroundTaskEnded();
void processResponseFromPostFile(const belle_http_response_event_t *event);
void processResponseHeadersFromGetFile(const belle_http_response_event_t *event);
void processAuthRequestedDownload(const belle_sip_auth_event *event);
void processIoErrorUpload(const belle_sip_io_error_event_t *event);
void processAuthRequestedUpload(const belle_sip_auth_event *event);
void processIoErrorDownload(const belle_sip_io_error_event_t *event);
void processResponseFromGetFile(const belle_http_response_event_t *event);
// -----------------------------------------------------------------------------
void sendImdn(Imdn::Type imdnType, LinphoneReason reason);
LinphoneReason receive();
......@@ -143,37 +123,22 @@ private:
bool isReadOnly = false;
std::list<Content* > contents;
Content internalContent;
FileContent *currentFileContentToTransfer;
std::unordered_map<std::string, std::string> customHeaders;
mutable LinphoneErrorInfo * errorInfo = nullptr;
belle_http_request_t *httpRequest = nullptr;
belle_http_request_listener_t *httpListener = nullptr;
SalOp *salOp = nullptr;
SalCustomHeader *salCustomHeaders = nullptr;
unsigned long backgroundTaskId = 0;
unsigned char currentSendStep = Step::None;
bool applyModifiers = true;
FileTransferChatMessageModifier fileTransferChatMessageModifier;
// Cache for returned values, used for compatibility with previous C API
ContentType cContentType;
std::string cText;
// -----------------------------------------------------------------------------
int uploadFile ();
std::string createImdnXml(Imdn::Type imdnType, LinphoneReason reason);
void fileUploadEndBackgroundTask();
void fileUploadBeginBackgroundTask();
bool isFileTransferInProgressAndValid();
int startHttpTransfer(
const std::string &url,
const std::string &action,
belle_http_request_listener_callbacks_t *cbs
);
void releaseHttpRequest();
void createFileTransferInformationsFromVndGsmaRcsFtHttpXml(FileTransferContent* content);
L_DECLARE_PUBLIC(ChatMessage);
};
......
This diff is collapsed.
......@@ -38,8 +38,6 @@ public:
uint32_t getChar () const;
LinphoneCall *getCall () const;
void markAsRead () override;
void onChatMessageReceived (const std::shared_ptr<ChatMessage> &msg) override;
/* ConferenceInterface */
void addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
......
......@@ -34,6 +34,9 @@ public:
Result encode (const std::shared_ptr<ChatMessage> &message, int &errorCode) override;
Result decode (const std::shared_ptr<ChatMessage> &message, int &errorCode) override;
belle_http_request_t *getHttpRequest() const;
void setHttpRequest(belle_http_request_t *request);
int onSendBody (belle_sip_user_body_handler_t *bh, belle_sip_message_t *m, size_t offset, uint8_t *buffer, size_t *size);
void onSendEnd (belle_sip_user_body_handler_t *bh);
......@@ -43,6 +46,17 @@ public:
void processIoErrorUpload (const belle_sip_io_error_event_t *event);
void processAuthRequestedUpload (const belle_sip_auth_event *event);
void onRecvBody(belle_sip_user_body_handler_t *bh, belle_sip_message_t *m, size_t offset, uint8_t *buffer, size_t size);
void onRecvEnd(belle_sip_user_body_handler_t *bh);
void processResponseHeadersFromGetFile(const belle_http_response_event_t *event);
void processAuthRequestedDownload(const belle_sip_auth_event *event);
void processIoErrorDownload(const belle_sip_io_error_event_t *event);
void processResponseFromGetFile(const belle_http_response_event_t *event);
int downloadFile(const std::shared_ptr<ChatMessage> &message, FileTransferContent *fileTransferContent);
void cancelFileTransfer();
bool isFileTransferInProgressAndValid();
private:
std::shared_ptr<ChatRoom> chatRoom;
std::shared_ptr<ChatMessage> chatMessage;
......@@ -56,7 +70,6 @@ private:
void fileUploadBeginBackgroundTask();
void fileUploadEndBackgroundTask();
bool isFileTransferInProgressAndValid();
void releaseHttpRequest();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment