Skip to content

Commit

Permalink
Merge pull request #701 from meganz/fix/newmsg-invalid-keyxid
Browse files Browse the repository at this point in the history
#12664. Fix invalid keyxid for new messages
  • Loading branch information
sergiohs84 authored Jul 15, 2019
2 parents 05040c4 + d510f7a commit fca7b4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/chatd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3697,6 +3697,7 @@ void Chat::keyConfirm(KeyId keyxid, KeyId keyid)
msg->keyid = keyid;
delete item.keyCmd;
item.keyCmd = NULL;
item.msgCmd->setKeyId(keyid);
count++;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/chatdDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ class ChatdSqliteDb: public chatd::DbInterface
// if message was already encrypted, restore the MsgCommand
if (stmt.hasBlobCol(11))
{
chatd::KeyId chatdKeyid = (keyid < 0xffff0001) ? keyid : CHATD_KEYID_UNCONFIRMED;
chatd::MsgCommand *msgCmd = new chatd::MsgCommand(opcode, mChat.chatId(), userid, msgid, ts, updated, chatdKeyid);
chatd::MsgCommand *msgCmd = new chatd::MsgCommand(opcode, mChat.chatId(), userid, msgid, ts, updated, keyid);
Buffer buf;
stmt.blobCol(11, buf);
msgCmd->setMsg(buf.buf(), buf.dataSize());
Expand Down

0 comments on commit fca7b4c

Please sign in to comment.