* Test if there are any chat messages to display. * @param show_all Set if all messages should be included, instead of unexpired only. * @return True iff there are chat messages to display. */
| 65 | * @return True iff there are chat messages to display. |
| 66 | */ |
| 67 | static inline bool HaveChatMessages(bool show_all) |
| 68 | { |
| 69 | if (show_all) return !_chatmsg_list.empty(); |
| 70 | |
| 71 | auto now = std::chrono::steady_clock::now(); |
| 72 | for (auto &cmsg : _chatmsg_list) { |
| 73 | if (cmsg.remove_time >= now) return true; |
| 74 | } |
| 75 | |
| 76 | return false; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Add a text message to the 'chat window' to be shown |
no test coverage detected