summaryrefslogtreecommitdiff
path: root/src/message.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:15 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:15 +0200
commit0a48c0f1af4b35338d2360f6efa4c467ec60b60d (patch)
tree406a6b1bda002889f8a99be215fcc9847dc0cb7e /src/message.cc
parent656d238d855e3d7640f10c6b0c1dc84380f50e94 (diff)
Refactor messages.cc to use boost::circular_buffer
We might as well delegate the massive implementation complexity and get rid of a ton of legacy code.
Diffstat (limited to 'src/message.cc')
-rw-r--r--src/message.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/message.cc b/src/message.cc
new file mode 100644
index 00000000..a0f46f22
--- /dev/null
+++ b/src/message.cc
@@ -0,0 +1,15 @@
+#include "message.hpp"
+
+#include <fmt/format.h>
+
+std::string message::text_with_count() const
+{
+ if (count > 1)
+ {
+ return fmt::format("{} <{}x>", text, count);
+ }
+ else
+ {
+ return text;
+ }
+}