Skip to content

Commit

Permalink
Fix preserving messages in chats
Browse files Browse the repository at this point in the history
  • Loading branch information
ksiazkowicz committed Sep 26, 2014
1 parent a2676d2 commit 16884ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion platforms/symbian/qml/Pages/ConversationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Page {
sendMessage()
}
}
Component.onCompleted: text = xmppConnectivity.getPreservedMsg(contactJid);
Component.onCompleted: text = xmppConnectivity.getPreservedMsg(accountId,contactJid);
}

// toolbar
Expand Down
2 changes: 1 addition & 1 deletion src/UpdateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void UpdateManager::compareVersions() {
}

// compare release date (remember to update this every build)
if (getUpdateDate() > QDateTime::fromString("06-09-2014","dd-MM-yyyy"))
if (getUpdateDate() > QDateTime::fromString("26-09-2014","dd-MM-yyyy"))
updateAvailable = true;

// emit signal
Expand Down
6 changes: 3 additions & 3 deletions src/xmpp/XmppConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ QString XmppConnectivity::getPropertyByJid(QString account,QString property,QStr
return contacts->getPropertyByJid(account,jid,property);
}

QString XmppConnectivity::getPreservedMsg(QString jid) { //this poorly written piece of shit should take care of account id one day
ChatsItemModel* chat = (ChatsItemModel*)chats->find(jid);
QString XmppConnectivity::getPreservedMsg(QString accountId, QString jid) {
ChatsItemModel* chat = (ChatsItemModel*)chats->find(accountId + ";" + jid);
return chat !=0 ? chat->msg() : "";
}

void XmppConnectivity::preserveMsg(QString accountId,QString jid,QString message) { //this poorly written piece of shit should take care of account id one day
void XmppConnectivity::preserveMsg(QString accountId,QString jid,QString message) {
ChatsItemModel* chat = (ChatsItemModel*)chats->find(accountId + ";" + jid);
if (chat != 0) chat->setChatMsg(message);
chat = 0; delete chat;
Expand Down
2 changes: 1 addition & 1 deletion src/xmpp/XmppConnectivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public slots:
// handling chats list

Q_INVOKABLE QString getPropertyByJid(QString account,QString property,QString jid);
Q_INVOKABLE QString getPreservedMsg(QString jid);
Q_INVOKABLE QString getPreservedMsg(QString accountId,QString jid);
Q_INVOKABLE void preserveMsg(QString accountId,QString jid,QString message);
Q_INVOKABLE void openChat(QString accountId, QString bareJid);
Q_INVOKABLE void closeChat(QString accountId, QString bareJid);
Expand Down

0 comments on commit 16884ba

Please sign in to comment.