mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 00:07:09 -05:00
Remove nick from anchor names, causes problems
- Nicknames that contain " could break the formatting - Nicknames containing chars like < or > were converted to html entities by the QTextBrowser so the anchor was no longer identical with the anchor stored in the _listMsg list
This commit is contained in:
parent
de92c06f0b
commit
5f81d8efc8
@ -257,9 +257,8 @@ void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime ti
|
|||||||
|
|
||||||
if ((bGetNickName || bFoundTextToNotify || _bCountUnRead)){
|
if ((bGetNickName || bFoundTextToNotify || _bCountUnRead)){
|
||||||
QString strAnchor = time.toString(Qt::ISODate);
|
QString strAnchor = time.toString(Qt::ISODate);
|
||||||
strAnchor.append("_").append(senderName);
|
|
||||||
MsgData msgData;
|
MsgData msgData;
|
||||||
msgData.text=msg;
|
msgData.text=senderName + ": " + msg;
|
||||||
msgData.unread=!(bGetNickName || bFoundTextToNotify);
|
msgData.unread=!(bGetNickName || bFoundTextToNotify);
|
||||||
|
|
||||||
_listMsg[lobby_id][strAnchor]=msgData;
|
_listMsg[lobby_id][strAnchor]=msgData;
|
||||||
|
@ -902,7 +902,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
|||||||
QString formatMsg = chatStyle.formatMessage(type, name, dtTimestamp, formattedMessage, formatFlag);
|
QString formatMsg = chatStyle.formatMessage(type, name, dtTimestamp, formattedMessage, formatFlag);
|
||||||
QString timeStamp = dtTimestamp.toString(Qt::ISODate);
|
QString timeStamp = dtTimestamp.toString(Qt::ISODate);
|
||||||
|
|
||||||
formatMsg.prepend(QString("<a name=\"%1_%2\"/>").arg(timeStamp).arg(name));
|
formatMsg.prepend(QString("<a name=\"%1\"/>").arg(timeStamp));
|
||||||
//To call this anchor do: ui->textBrowser->scrollToAnchor(QString("%1_%2").arg(timeStamp).arg(name));
|
//To call this anchor do: ui->textBrowser->scrollToAnchor(QString("%1_%2").arg(timeStamp).arg(name));
|
||||||
QTextCursor textCursor = QTextCursor(ui->textBrowser->textCursor());
|
QTextCursor textCursor = QTextCursor(ui->textBrowser->textCursor());
|
||||||
textCursor.movePosition(QTextCursor::End);
|
textCursor.movePosition(QTextCursor::End);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user