summaryrefslogtreecommitdiff
path: root/Applications/IRCClient/IRCWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Applications/IRCClient/IRCWindow.cpp')
-rw-r--r--Applications/IRCClient/IRCWindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Applications/IRCClient/IRCWindow.cpp b/Applications/IRCClient/IRCWindow.cpp
index e4540986b8..b94fee665f 100644
--- a/Applications/IRCClient/IRCWindow.cpp
+++ b/Applications/IRCClient/IRCWindow.cpp
@@ -61,3 +61,29 @@ void IRCWindow::set_log_buffer(const IRCLogBuffer& log_buffer)
m_log_buffer = &log_buffer;
m_table_view->set_model(OwnPtr<IRCLogBufferModel>((IRCLogBufferModel*)log_buffer.model()));
}
+
+bool IRCWindow::is_active() const
+{
+ return m_client.current_window() == this;
+}
+
+void IRCWindow::did_add_message()
+{
+ if (!is_active()) {
+ ++m_unread_count;
+ m_client.aid_update_window_list();
+ }
+}
+
+void IRCWindow::clear_unread_count()
+{
+ if (!m_unread_count)
+ return;
+ m_unread_count = 0;
+ m_client.aid_update_window_list();
+}
+
+int IRCWindow::unread_count() const
+{
+ return m_unread_count;
+}