mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-30 11:24:24 -04:00
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:
parent
ed395fe061
commit
4236ad59a5
4 changed files with 25 additions and 2 deletions
|
@ -77,3 +77,13 @@ void ChatLobbyDialog::updateStatus(const QString &peer_id, int status)
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatLobbyDialog::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(info.peer_nickname.c_str()) ;
|
||||||
|
|
||||||
|
addChatMsg(true, name, sendTime, recvTime, message, TYPE_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ class ChatLobbyDialog: public PopupChatDialog
|
||||||
// The following methods are differentfrom those of the parent:
|
// The following methods are differentfrom those of the parent:
|
||||||
//
|
//
|
||||||
virtual void updateStatus(const QString &peer_id, int status) ; // needs grouped status. Not yet implemented.
|
virtual void updateStatus(const QString &peer_id, int status) ; // needs grouped status. Not yet implemented.
|
||||||
|
virtual void addIncomingChatMsg(const ChatInfo& info) ; //
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void setNickName(const QString&) ;
|
void setNickName(const QString&) ;
|
||||||
|
|
|
@ -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()
|
void PopupChatDialog::insertChatMsgs()
|
||||||
{
|
{
|
||||||
std::list<ChatInfo> newchat;
|
std::list<ChatInfo> newchat;
|
||||||
|
@ -590,14 +600,15 @@ void PopupChatDialog::insertChatMsgs()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<ChatInfo>::iterator it;
|
std::list<ChatInfo>::iterator it;
|
||||||
for(it = newchat.begin(); it != newchat.end(); it++) {
|
for(it = newchat.begin(); it != newchat.end(); it++)
|
||||||
|
{
|
||||||
/* are they public? */
|
/* are they public? */
|
||||||
if ((it->chatflags & RS_CHAT_PRIVATE) == 0) {
|
if ((it->chatflags & RS_CHAT_PRIVATE) == 0) {
|
||||||
/* this should not happen */
|
/* this should not happen */
|
||||||
continue;
|
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);
|
rsMsgs->clearPrivateChatQueue(true, dialogId);
|
||||||
|
|
|
@ -76,6 +76,7 @@ protected:
|
||||||
|
|
||||||
void insertChatMsgs();
|
void insertChatMsgs();
|
||||||
void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
|
void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
|
||||||
|
virtual void addIncomingChatMsg(const ChatInfo& info) ; // derived in ChatLobbyDialog.
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void pasteLink() ;
|
void pasteLink() ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue