summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/m_chat.h7
-rw-r--r--include/m_srmm_int.h12
2 files changed, 18 insertions, 1 deletions
diff --git a/include/m_chat.h b/include/m_chat.h
index 446124f1b2..06a16ebd84 100644
--- a/include/m_chat.h
+++ b/include/m_chat.h
@@ -330,6 +330,11 @@ EXTERN_C MIR_APP_DLL(struct SESSION_INFO*) Chat_NewSession(
// registered with GC_EVENT_ADDGROUP. Ex "Voice" in IRC
#define GC_EVENT_REMOVESTATUS 0x0800
+// GC_EVENT_TYPING - sets typing status for contact
+// pszUID - Unique identifier of the one who's typing
+// dwItemData - ON/OFF
+#define GC_EVENT_TYPING 0x1001
+
// GC_EVENT_SETCONTACTSTATUS - sets status icon for contact
// pszUID - Unique identifier of the one who receives a new status
// dwItemData - (DWORD)ID_STATUS_* or zero to remove status icon
@@ -469,7 +474,7 @@ EXTERN_C MIR_APP_DLL(int) Chat_GetInfo(GC_INFO*);
#define GC_USER_CHANMGR 2 // user clicked the settings button in a chat room
#define GC_USER_LOGMENU 3 // user has selected a message log menu item, dwData is valid. See ME_GC_BUILDMENU
#define GC_USER_NICKLISTMENU 4 // user has selected a userlist menu item, valid members: dwData. See ME_GC_BUILDMENU
-#define GC_USER_TYPNOTIFY 5 // NOT IMPLEMENTED YET! user is typing
+#define GC_USER_TYPNOTIFY 5 // user is typing
#define GC_USER_PRIVMESS 6 // user requests to send a private message to a user. pszUID is valid
#define GC_SESSION_TERMINATE 7 // the session is about to be terminated, the "user defined data" is passed in dwData, which can be good free'ing any allocated memory.
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h
index 9fbfed7d24..62d0b2d689 100644
--- a/include/m_srmm_int.h
+++ b/include/m_srmm_int.h
@@ -195,6 +195,7 @@ protected:
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ bool AllowTyping() const;
int NotifyEvent(int code);
bool ProcessFileDrop(HDROP hDrop, MCONTACT hContact);
bool PasteFilesAsURL(HDROP hDrop);
@@ -209,6 +210,12 @@ protected:
COLORREF m_clrInputBG, m_clrInputFG;
time_t m_iLastEnterTime;
+ // user typing support;
+ DWORD m_nLastTyping = 0;
+ BYTE m_bShowTyping = 0;
+ int m_nTypeSecs = 0, m_nTypeMode = 0;
+ const USERINFO* m_pUserTyping = nullptr;
+
CCtrlListBox m_nickList;
CCtrlButton m_btnColor, m_btnBkColor;
CCtrlButton m_btnBold, m_btnItalic, m_btnUnderline;
@@ -253,6 +260,11 @@ public:
__forceinline bool isChat() const { return m_si != nullptr; }
__forceinline SESSION_INFO *getChat() const { return m_si; }
__forceinline CSrmmLogWindow *log() const { return m_pLog; }
+
+ __forceinline void setTyping(int nSecs, const USERINFO* pUser = nullptr) {
+ m_pUserTyping = pUser;
+ m_nTypeSecs = nSecs;
+ }
__inline void* operator new(size_t size) { return calloc(1, size); }
__inline void operator delete(void *p) { free(p); }