mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-17 01:24:15 -05:00
fixed GUI update of avatars and status for distant chat. Updated backend for new model. Fixed a few bugs in serialisation
This commit is contained in:
parent
6951d730a5
commit
81ab43beb9
27 changed files with 515 additions and 289 deletions
|
|
@ -93,11 +93,10 @@ void ChatDialog::init(ChatId id, const QString &title)
|
|||
|
||||
/* see if it already exists */
|
||||
ChatDialog *cd = getExistingChat(id);
|
||||
DistantChatPeerInfo pinfo ;
|
||||
|
||||
if (cd == NULL) {
|
||||
|
||||
if(id.isGxsId())
|
||||
if(id.isDistantChatId())
|
||||
chatflags = RS_CHAT_OPEN | RS_CHAT_FOCUS; // force open for distant chat
|
||||
|
||||
if (chatflags & RS_CHAT_OPEN) {
|
||||
|
|
@ -106,10 +105,11 @@ void ChatDialog::init(ChatId id, const QString &title)
|
|||
cld->init();
|
||||
cd = cld;
|
||||
}
|
||||
else if(id.isPeerId() && rsMsgs->getDistantChatStatus(id.toPeerId(),pinfo))
|
||||
else if(id.isDistantChatId())
|
||||
{
|
||||
PopupDistantChatDialog* pdcd = new PopupDistantChatDialog(id.toPeerId());
|
||||
pdcd->init(pinfo.peer_id, QString("This is a distant chat")) ;
|
||||
PopupDistantChatDialog* pdcd = new PopupDistantChatDialog(id.toDistantChatId());
|
||||
|
||||
pdcd->init(id.toDistantChatId());
|
||||
cd = pdcd;
|
||||
}
|
||||
else
|
||||
|
|
@ -172,7 +172,7 @@ void ChatDialog::init(ChatId id, const QString &title)
|
|||
if(msg.chat_id.isBroadcast())
|
||||
return; // broadcast is not handled by a chat dialog
|
||||
|
||||
if(msg.incoming && (msg.chat_id.isPeerId() || msg.chat_id.isGxsId()))
|
||||
if(msg.incoming && (msg.chat_id.isPeerId() || msg.chat_id.isDistantChatId()))
|
||||
// play sound when recv a message
|
||||
SoundManager::play(SOUND_NEW_CHAT_MESSAGE);
|
||||
|
||||
|
|
@ -338,8 +338,8 @@ void ChatDialog::setPeerStatus(uint32_t status)
|
|||
RsPeerId vpid;
|
||||
if(mChatId.isPeerId())
|
||||
vpid = mChatId.toPeerId();
|
||||
if(mChatId.isGxsId())
|
||||
vpid = RsPeerId(mChatId.toGxsId());
|
||||
if(mChatId.isDistantChatId())
|
||||
vpid = RsPeerId(mChatId.toDistantChatId());
|
||||
cw->updateStatus(QString::fromStdString(vpid.toStdString()), status);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue