fixed display of peer nicknames in chat lobby

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4742 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-12-28 09:15:28 +00:00
parent ed395fe061
commit 4236ad59a5
4 changed files with 25 additions and 2 deletions

View file

@ -578,6 +578,16 @@ void PopupChatDialog::onPrivateChatChanged(int list, int type)
}
}
void PopupChatDialog::addIncomingChatMsg(const ChatInfo& info)
{
QDateTime sendTime = QDateTime::fromTime_t(info.sendTime);
QDateTime recvTime = QDateTime::fromTime_t(info.recvTime);
QString message = QString::fromStdWString(info.msg);
QString name = QString::fromUtf8(rsPeers->getPeerName(info.rsid).c_str()) ;
addChatMsg(true, name, sendTime, recvTime, message, TYPE_NORMAL);
}
void PopupChatDialog::insertChatMsgs()
{
std::list<ChatInfo> newchat;
@ -590,14 +600,15 @@ void PopupChatDialog::insertChatMsgs()
}
std::list<ChatInfo>::iterator it;
for(it = newchat.begin(); it != newchat.end(); it++) {
for(it = newchat.begin(); it != newchat.end(); it++)
{
/* are they public? */
if ((it->chatflags & RS_CHAT_PRIVATE) == 0) {
/* this should not happen */
continue;
}
addChatMsg(true, QString::fromUtf8(rsPeers->getPeerName(it->rsid).c_str()), QDateTime::fromTime_t(it->sendTime), QDateTime::fromTime_t(it->recvTime), QString::fromStdWString(it->msg), TYPE_NORMAL);
addIncomingChatMsg(*it) ;
}
rsMsgs->clearPrivateChatQueue(true, dialogId);