fixed unread chat cound in FriendsDialog, fix display of status in distant chat (Patch from electron)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7832 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-01-10 13:13:41 +00:00
parent 0e2c4266fa
commit 4d26726a88
8 changed files with 131 additions and 52 deletions

View file

@ -239,16 +239,6 @@ void FriendsDialog::processSettings(bool bLoad)
void FriendsDialog::showEvent(QShowEvent *event)
{
static bool first = true;
if (first) {
// Workaround: now the scroll position is correct calculated
first = false;
/* remove
QScrollBar *scrollbar = ui.msgText->verticalScrollBar();
scrollbar->setValue(scrollbar->maximum());
*/
}
RsAutoUpdatePage::showEvent(event);
}
@ -262,6 +252,13 @@ void FriendsDialog::chatMessageReceived(const ChatMessage &msg)
QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str());
ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL);
if(ui.chatWidget->isActive())
{
// clear the chat notify when control returns to the Qt event loop
// we have to do this later, because we don't know if we or the notify receives the chat message first
QMetaObject::invokeMethod(this, "clearChatNotify", Qt::QueuedConnection);
}
}
}
@ -319,6 +316,11 @@ void FriendsDialog::loadmypersonalstatus()
}
}
void FriendsDialog::clearChatNotify()
{
ChatUserNotify::clearWaitingChat(ChatId::makeBroadcastId());
}
void FriendsDialog::statusmessage()
{
StatusMessage statusmsgdialog (this);