mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-13 00:53:14 -04:00
Fixed History Browser for group chat and private chat.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3758 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6783e63ce0
commit
4751295a3f
3 changed files with 11 additions and 10 deletions
|
@ -187,12 +187,15 @@ PeersDialog::PeersDialog(QWidget *parent)
|
||||||
if (Settings->valueFromGroup("Chat", QString::fromUtf8("GroupChat_History"), true).toBool()) {
|
if (Settings->valueFromGroup("Chat", QString::fromUtf8("GroupChat_History"), true).toBool()) {
|
||||||
historyKeeper.init(QString::fromStdString(RsInit::RsProfileConfigDirectory()) + "/chatPublic.xml");
|
historyKeeper.init(QString::fromStdString(RsInit::RsProfileConfigDirectory()) + "/chatPublic.xml");
|
||||||
|
|
||||||
|
int messageCount = Settings->getPublicChatHistoryCount();
|
||||||
|
if (messageCount > 0) {
|
||||||
QList<IMHistoryItem> historyItems;
|
QList<IMHistoryItem> historyItems;
|
||||||
historyKeeper.getMessages(historyItems, Settings->getPublicChatHistoryCount());
|
historyKeeper.getMessages(historyItems, messageCount);
|
||||||
foreach(IMHistoryItem item, historyItems) {
|
foreach(IMHistoryItem item, historyItems) {
|
||||||
addChatMsg(item.incoming, true, item.name, item.recvTime, item.messageText);
|
addChatMsg(item.incoming, true, item.name, item.recvTime, item.messageText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QMenu * grpchatmenu = new QMenu();
|
QMenu * grpchatmenu = new QMenu();
|
||||||
grpchatmenu->addAction(ui.actionClearChat);
|
grpchatmenu->addAction(ui.actionClearChat);
|
||||||
|
|
|
@ -210,7 +210,10 @@ PopupChatDialog::PopupChatDialog(std::string id, const QString name, QWidget *pa
|
||||||
rsMsgs->getPrivateChatQueueCount(false) && rsMsgs->getPrivateChatQueue(false, dialogId, offlineChat);
|
rsMsgs->getPrivateChatQueueCount(false) && rsMsgs->getPrivateChatQueue(false, dialogId, offlineChat);
|
||||||
|
|
||||||
QList<IMHistoryItem> historyItems;
|
QList<IMHistoryItem> historyItems;
|
||||||
historyKeeper.getMessages(historyItems, Settings->getPrivateChatHistoryCount());
|
int messageCount = Settings->getPrivateChatHistoryCount();
|
||||||
|
if (messageCount > 0) {
|
||||||
|
historyKeeper.getMessages(historyItems, messageCount);
|
||||||
|
}
|
||||||
foreach(IMHistoryItem item, historyItems) {
|
foreach(IMHistoryItem item, historyItems) {
|
||||||
for(offineChatIt = offlineChat.begin(); offineChatIt != offlineChat.end(); offineChatIt++) {
|
for(offineChatIt = offlineChat.begin(); offineChatIt != offlineChat.end(); offineChatIt++) {
|
||||||
/* are they public? */
|
/* are they public? */
|
||||||
|
|
|
@ -132,11 +132,6 @@ bool IMHistoryKeeper::getMessages(QList<IMHistoryItem> &historyItems, const int
|
||||||
|
|
||||||
historyItems.clear();
|
historyItems.clear();
|
||||||
|
|
||||||
if (messagesCount == 0) {
|
|
||||||
/* nothing to do */
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QListIterator<IMHistoryItem> hii(hitems);
|
QListIterator<IMHistoryItem> hii(hitems);
|
||||||
hii.toBack();
|
hii.toBack();
|
||||||
while (hii.hasPrevious()) {
|
while (hii.hasPrevious()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue