diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2020-08-21 12:42:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-21 12:42:45 -0500 |
| commit | 2c6a690d47ca0c48bef84b3d28d58064365a9934 (patch) | |
| tree | cdc2a42b51e4bbe3c008adab296ac306d6dbdfd7 /src/chatlogpiece.cpp | |
| parent | ec1c95bdb33dd063880c4cb6c3c9c3cf5d0ed454 (diff) | |
| parent | af1e76022568af1f146e2b49e96af85eb06521b9 (diff) | |
Merge pull request #246 from AttorneyOnline/2.8
Merges 2.8.5, which is a patch release for 2.8 with no substantially new features.
This commit is release-ready.
Diffstat (limited to 'src/chatlogpiece.cpp')
| -rw-r--r-- | src/chatlogpiece.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/chatlogpiece.cpp b/src/chatlogpiece.cpp index 2a041f13..05a924ca 100644 --- a/src/chatlogpiece.cpp +++ b/src/chatlogpiece.cpp @@ -6,29 +6,29 @@ chatlogpiece::chatlogpiece() showname = tr("UNKNOWN"); message = tr("UNKNOWN"); color = 0; - p_is_song = false; + action = ""; datetime = QDateTime::currentDateTime().toUTC(); } chatlogpiece::chatlogpiece(QString p_name, QString p_showname, - QString p_message, bool p_song, int p_color) + QString p_message, QString p_action, int p_color) { name = p_name; showname = p_showname; message = p_message; - p_is_song = p_song; + action = p_action; color = p_color; datetime = QDateTime::currentDateTime().toUTC(); } chatlogpiece::chatlogpiece(QString p_name, QString p_showname, - QString p_message, bool p_song, int p_color, + QString p_message, QString p_action, int p_color, QDateTime p_datetime) { name = p_name; showname = p_showname; message = p_message; - p_is_song = p_song; + action = p_action; color = p_color; datetime = p_datetime.toUTC(); } @@ -41,7 +41,7 @@ QString chatlogpiece::get_message() { return message; } QDateTime chatlogpiece::get_datetime() { return datetime; } -bool chatlogpiece::is_song() { return p_is_song; } +QString chatlogpiece::get_action() { return action; } QString chatlogpiece::get_datetime_as_string() { return datetime.toString(); } @@ -54,13 +54,15 @@ QString chatlogpiece::get_full() full.append(get_datetime_as_string()); full.append("] "); full.append(get_showname()); - full.append(" ("); - full.append(get_name()); - full.append(")"); - if (p_is_song) - full.append(tr(" has played a song: ")); - else - full.append(": "); + if (get_showname() != get_name()) + { + full.append(" ("); + full.append(get_name()); + full.append(")"); + } + if (!get_action().isEmpty()) + full.append(" " + get_action()); + full.append(": "); full.append(get_message()); return full; |
