Merge pull request #1257 from ctrlaltca/messageparser

Chatview: split message parser and add "highlight words"
This commit is contained in:
Zach 2015-07-15 20:00:08 -04:00
commit e0b71d3b05
6 changed files with 333 additions and 230 deletions

View file

@ -27,8 +27,10 @@ private:
QString userName;
QString mention;
QTextCharFormat mentionFormat;
QTextCharFormat highlightFormat;
QTextCharFormat mentionFormatOtherUser;
QTextCharFormat defaultFormat;
QStringList highlightedWords;
bool evenNumber;
bool showTimestamps;
HoveredItemType hoveredItemType;
@ -41,9 +43,14 @@ private:
QString getNameFromUserList(QMap<QString, UserListTWI *> &userList, QString &userName);
bool isFullMentionAValidUser(QMap<QString, UserListTWI *> &userList, QString userNameToMatch);
QColor getCustomMentionColor();
QColor getCustomHighlightColor();
bool shouldShowSystemPopup();
void showSystemPopup(QString &sender);
bool isModeratorSendingGlobal(QFlags<ServerInfo_User::UserLevelFlag> userLevelFlag, QString message);
void checkTag(QTextCursor &cursor, QString &message);
void checkMention(QTextCursor &cursor, QString &message, QString &sender, UserLevelFlags userLevel);
void checkWord(QTextCursor &cursor, QString &message);
QString extractNextWord(QString &message, QString &rest);
private slots:
void openLink(const QUrl &link);
void actMessageClicked();