diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-14 16:43:53 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-14 16:43:53 +0300 |
commit | 64b53b1c28ffa353ff2f0c0a01405f9afc2b7bf1 (patch) | |
tree | 09f966d418bd50c8d63b52ec7896462803dc6294 /src/mir_app | |
parent | 29af90eb23768e9eb2c29091fefaaa10c78ff8cd (diff) |
common group chat code moved to mir_app
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/chat.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 26 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 |
4 files changed, 25 insertions, 5 deletions
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 2f620c2e56..60c4af86e0 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_popup.h>
#include <m_fontservice.h>
+#define GC_FAKE_EVENT MEVENT(0xBABABEDA)
+
#define STREAMSTAGE_HEADER 0
#define STREAMSTAGE_EVENTS 1
#define STREAMSTAGE_TAIL 2
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 700e48c14f..507c24895b 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -49,8 +49,7 @@ static int compareModules(const MODULEINFO *p1, const MODULEINFO *p2) static LIST<MODULEINFO> g_arModules(5, compareModules);
/////////////////////////////////////////////////////////////////////////////////////////
-// Session Manager functions
-// Keeps track of all sessions and its windows
+// SESSION_INFO class members
static int CompareEvents(const LOGINFO *p1, const LOGINFO *p2)
{
@@ -98,6 +97,25 @@ const char* SESSION_INFO::SESSION_INFO::getSoundName(int iEventType) const return nullptr;
}
+void SESSION_INFO::markRead(bool bForce)
+{
+ if ((wState & STATE_TALK) || bForce) {
+ wState &= ~STATE_TALK;
+ db_unset(hContact, pszModule, "ApparentMode");
+ }
+
+ if ((wState & GC_EVENT_HIGHLIGHT) || bForce) {
+ wState &= ~GC_EVENT_HIGHLIGHT;
+
+ if (Clist_GetEvent(hContact, 0))
+ Clist_RemoveEvent(hContact, GC_FAKE_EVENT);
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Session Manager functions
+// Keeps track of all sessions and its windows
+
static SESSION_INFO* SM_CreateSession(void)
{
return new SESSION_INFO();
@@ -105,9 +123,7 @@ static SESSION_INFO* SM_CreateSession(void) void SM_FreeSession(SESSION_INFO *si)
{
- if (Clist_GetEvent(si->hContact, 0))
- Clist_RemoveEvent(si->hContact, GC_FAKE_EVENT);
- si->wState &= ~STATE_TALK;
+ si->markRead(true);
db_unset(si->hContact, si->pszModule, "ApparentMode");
if (si->pDlg)
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 505eb60693..0aa5b1fe10 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -989,3 +989,4 @@ _Proto_CanDeleteHistory@8 @1124 NONAME ?bUseGroup@Chat@@3V?$CMOption@_N@@A @1127 NONAME
?isCustom@EventInfo@DB@@QBE_NH@Z @1128 NONAME
?InsertBbcodeString@CSrmmBaseDialog@@IAEXPB_W@Z @1129 NONAME
+?markRead@SESSION_INFO@@QAEX_N@Z @1130 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 990714d090..a5f99bcaf3 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -989,3 +989,4 @@ Proto_CanDeleteHistory @1118 NONAME ?bUseGroup@Chat@@3V?$CMOption@_N@@A @1121 NONAME
?isCustom@EventInfo@DB@@QEBA_NH@Z @1122 NONAME
?InsertBbcodeString@CSrmmBaseDialog@@IEAAXPEB_W@Z @1123 NONAME
+?markRead@SESSION_INFO@@QEAAX_N@Z @1124 NONAME
|