diff options
| author | 2010-01-04 22:19:15 +0000 | |
|---|---|---|
| committer | 2010-01-04 22:19:15 +0000 | |
| commit | e8d8d8167285a053552504c74a142aa67821361c (patch) | |
| tree | 66ad35a9f7c50ecda6b34c06a4d12322ade97a09 /src/modules/dcc/chat.cpp | |
| parent | fixed doc (diff) | |
| download | KVIrc-e8d8d8167285a053552504c74a142aa67821361c.tar.gz KVIrc-e8d8d8167285a053552504c74a142aa67821361c.tar.bz2 KVIrc-e8d8d8167285a053552504c74a142aa67821361c.zip | |
implemented #668
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3794 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/chat.cpp')
| -rw-r--r-- | src/modules/dcc/chat.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp index a25a3a528..81e1471ba 100644 --- a/src/modules/dcc/chat.cpp +++ b/src/modules/dcc/chat.cpp @@ -61,6 +61,7 @@ #include <QEvent> #include <QResizeEvent> #include <QByteArray> +#include <QTextDocument> //for Qt::escape #ifdef COMPILE_CRYPT_SUPPORT #include "kvi_crypt.h" @@ -421,6 +422,22 @@ bool KviDccChat::event(QEvent *e) if(kvi_strEqualCIN("ACTION",d.ptr(),6))d.cutLeft(6); d.stripLeftWhiteSpace(); output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szNick),d.ptr()); + if(!hasAttention()) + { + if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) + { + demandAttention(); + } + if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewDccChatMessages)) + { + QString szMsg = "<b>"; + szMsg += m_pDescriptor->szNick; + szMsg += "</b> "; + szMsg += Qt::escape(QString(d.ptr())); + //debug("kvi_sp_ctcp.cpp:975 debug: %s",szMsg.data()); + g_pApp->notifierMessage(this,KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(),szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + } + } } else { #ifdef COMPILE_CRYPT_SUPPORT @@ -458,9 +475,23 @@ bool KviDccChat::event(QEvent *e) #endif // FIXME! if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(d.ptr()),m_pDescriptor->idString())) + { m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), m_pDescriptor->szHost.toUtf8().data(),d.ptr()); + if(!hasAttention()) + { + if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) + { + demandAttention(); + } + if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewDccChatMessages)) + { + QString szMsg = Qt::escape(QString(d.ptr())); + g_pApp->notifierMessage(this,KVI_SMALLICON_DCCCHATMSG,szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + } + } + } #ifdef COMPILE_CRYPT_SUPPORT } #endif |
