mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
/me style is defined in chat styles
This commit is contained in:
parent
77804bbf16
commit
33b3eb7284
18 changed files with 32 additions and 19 deletions
|
@ -367,12 +367,17 @@ QString ChatStyle::formatMessage(enumFormatMessage type, const QString &name, co
|
|||
QString strShortName = RsHtml::plainText(name.left(bi)).prepend(QString("<a name=\"name\">")).append(QString("</a>"));
|
||||
|
||||
//handle /me
|
||||
//%nome% and %me% for including formatting conditionally
|
||||
//meName class for modifying the style of the name in the palce of /me
|
||||
if(me){
|
||||
messageBody = messageBody.replace(messageBody.indexOf("/me "), 3, strShortName); //replace only the first /me
|
||||
strName = "*";
|
||||
messageBody = messageBody.replace(messageBody.indexOf("/me "), 3, strShortName.prepend(QString("<span class=\"meName\">")).append(QString("</span>"))); //replace only the first /me
|
||||
style = style.remove(QRegExp("%nome%.*%/nome%")).remove("%me%").remove("%/me%");
|
||||
} else {
|
||||
style = style.remove(QRegExp("%me%.*%/me%")).remove("%nome%").remove("%/nome%");
|
||||
}
|
||||
|
||||
QString formatMsg = style.replace("%name%", strName)
|
||||
.replace("%shortname%", strShortName)
|
||||
.replace("%date%", strDate)
|
||||
.replace("%time%", strTime)
|
||||
#ifdef COLORED_NICKNAMES
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue