aboutsummaryrefslogtreecommitdiff
path: root/src/chatlogpiece.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chatlogpiece.cpp')
-rw-r--r--src/chatlogpiece.cpp28
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;