mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05: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
@ -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:
|
||||
//
|
||||
virtual void updateStatus(const QString &peer_id, int status) ; // needs grouped status. Not yet implemented.
|
||||
virtual void addIncomingChatMsg(const ChatInfo& info) ; //
|
||||
|
||||
protected slots:
|
||||
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()
|
||||
{
|
||||
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);
|
||||
|
@ -76,6 +76,7 @@ protected:
|
||||
|
||||
void insertChatMsgs();
|
||||
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:
|
||||
void pasteLink() ;
|
||||
|
Loading…
Reference in New Issue
Block a user