Commit 6c48e906 authored by Martin Straka's avatar Martin Straka

Fixed download message task - mark as read only received messages

parent f4b15ea9
......@@ -81,7 +81,8 @@ void TaskDownloadMessage::run(void)
enum TaskDownloadMessage::Result TaskDownloadMessage::downloadMessage(
IsdsSession::IsdsContext &ctx, NetLayer *netLayer, DbWrapper *dbWrapper,
qint64 msgId, enum Messages::MessageType msgDirect, MessageListModel *messageModel)
qint64 msgId, enum Messages::MessageType msgDirect,
MessageListModel *messageModel)
{
if (ctx.username.isEmpty()) {
Q_ASSERT(0);
......@@ -124,7 +125,7 @@ enum TaskDownloadMessage::Result TaskDownloadMessage::downloadMessage(
/*
* Following functions don't have to check return values
* because they are complementary actions for message download
* (not required).
* (not required for success complete message download).
*/
/* Send SOAP request to download message author info */
......@@ -139,10 +140,12 @@ enum TaskDownloadMessage::Result TaskDownloadMessage::downloadMessage(
dbWrapper->updateAuthorInfo(ctx.username, userType, authorName,
msgId, ctx.last_isds_msg);
/* Send SOAP request mark message as read */
netLayer->sendSoapRequest(ctx, MESSAGE_SERVICE,
XmlLayer::xmlCreateMarkMessageAsDownloadedSoapRequest(msgId),
xmlDataOut);
/* Send SOAP request mark message as read (only for received message) */
if (Messages::TYPE_RECEIVED == msgDirect) {
netLayer->sendSoapRequest(ctx, MESSAGE_SERVICE,
XmlLayer::xmlCreateMarkMessageAsDownloadedSoapRequest(msgId),
xmlDataOut);
}
return DL_SUCCESS;
}
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