mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-21 05:39:11 -04:00
fixed display of message links in composer window and message window. Still takes several attempts to display correctly.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7352 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a946504bb5
commit
3766449bec
4 changed files with 51 additions and 16 deletions
|
@ -104,7 +104,8 @@ MessageWidget *MessageWidget::openMsg(const std::string &msgId, bool window)
|
|||
}
|
||||
MessageWidget *msgWidget = new MessageWidget(false, parent);
|
||||
msgWidget->isWindow = window;
|
||||
msgWidget->fill(msgId);
|
||||
msgWidget->fill(msgId);
|
||||
|
||||
if (parent) {
|
||||
parent->addWidget(msgWidget);
|
||||
}
|
||||
|
@ -431,12 +432,19 @@ void MessageWidget::showTagLabels()
|
|||
}
|
||||
}
|
||||
|
||||
void MessageWidget::refill()
|
||||
{
|
||||
//uint32_t msg_id = currMsgId ;
|
||||
//currMsgId = 0 ;
|
||||
|
||||
//fill(msg_id) ;
|
||||
}
|
||||
void MessageWidget::fill(const std::string &msgId)
|
||||
{
|
||||
if (currMsgId == msgId) {
|
||||
// message doesn't changed
|
||||
return;
|
||||
}
|
||||
// if (currMsgId == msgId) {
|
||||
// // message doesn't changed
|
||||
// return;
|
||||
// }
|
||||
|
||||
ui.decryptFrame->hide();
|
||||
|
||||
|
@ -540,21 +548,29 @@ void MessageWidget::fill(const std::string &msgId)
|
|||
ui.dateText->setText(DateTime::formatDateTime(msgInfo.ts));
|
||||
|
||||
RsPeerId ownId = rsPeers->getOwnId();
|
||||
QString tooltip_string ;
|
||||
|
||||
RsPeerId srcId;
|
||||
if ((msgInfo.msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX) {
|
||||
// outgoing message are from me
|
||||
srcId = ownId;
|
||||
} else {
|
||||
srcId = msgInfo.rspeerid_srcId;
|
||||
if ((msgInfo.msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX) // outgoing message are from me
|
||||
{
|
||||
tooltip_string = PeerDefs::rsidFromId(ownId) ;
|
||||
link.createMessage(ownId, "");
|
||||
}
|
||||
else if(msgInfo.msgflags & RS_MSG_DECRYPTED || msgInfo.msgflags & RS_MSG_ENCRYPTED) // distant message
|
||||
{
|
||||
tooltip_string = PeerDefs::rsidFromId(msgInfo.rsgxsid_srcId) ;
|
||||
link.createMessage(msgInfo.rsgxsid_srcId, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
tooltip_string = PeerDefs::rsidFromId(msgInfo.rspeerid_srcId) ;
|
||||
link.createMessage(msgInfo.rspeerid_srcId, "");
|
||||
}
|
||||
link.createMessage(srcId, "");
|
||||
|
||||
if ((msgInfo.msgflags & RS_MSG_SYSTEM) && msgInfo.rspeerid_srcId == ownId) {
|
||||
ui.fromText->setText("RetroShare");
|
||||
} else {
|
||||
ui.fromText->setText(link.toHtml());
|
||||
ui.fromText->setToolTip(PeerDefs::rsidFromId(srcId));
|
||||
ui.fromText->setToolTip(tooltip_string) ;
|
||||
}
|
||||
|
||||
if (msgInfo.msgflags & RS_MSG_ENCRYPTED) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue