diff options
| author | 2013-09-21 03:56:36 +0000 | |
|---|---|---|
| committer | 2013-09-21 03:56:36 +0000 | |
| commit | 1cb83a3ee3d9265107807cffe28d092a0d64c79e (patch) | |
| tree | 3906c104efe1f676be28c0ee2ec149389285eee8 /src | |
| parent | Add .cryptEngine (diff) | |
| download | KVIrc-1cb83a3ee3d9265107807cffe28d092a0d64c79e.tar.gz KVIrc-1cb83a3ee3d9265107807cffe28d092a0d64c79e.tar.bz2 KVIrc-1cb83a3ee3d9265107807cffe28d092a0d64c79e.zip | |
Add a parameter to the PRIVMSG/NOTICE related events specifying that the message was encrypted
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6353 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
| -rw-r--r-- | src/kvirc/kvs/event/KviKvsEventTable.cpp | 20 | ||||
| -rw-r--r-- | src/kvirc/sparser/KviIrcServerParser_literalHandlers.cpp | 13 |
2 files changed, 23 insertions, 10 deletions
diff --git a/src/kvirc/kvs/event/KviKvsEventTable.cpp b/src/kvirc/kvs/event/KviKvsEventTable.cpp index 0cb43e0ac..e32ad1e92 100644 --- a/src/kvirc/kvs/event/KviKvsEventTable.cpp +++ b/src/kvirc/kvs/event/KviKvsEventTable.cpp @@ -1205,6 +1205,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= $2 = source host $3 = message $4 = [target mode prefixes] + $5 = was encrypted @window: Channels window @description: @@ -1212,6 +1213,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= $0!$1@$2 is the source of the message, $3 is the message text and $4 are the eventual mode prefixes added to the target channel (i.e: if the message is only for channel operators then you will get the string @ in $4). + $5 will be 1 if the message was encrypted and 0 otherwise. @seealso: [event:onquerymessage]OnQueryMessage[/event] [event:ondccchatmessage]OnDCCChatMessage[/event] @@ -1221,7 +1223,8 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= "$1 = source username\n" \ "$2 = source hostname\n" \ "$3 = message\n" \ - "$4 = target mode prefixes"), + "$4 = target mode prefixes\n" \ + "$5 = was encrypted"), /* @doc: onchannelnotice @@ -1235,6 +1238,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= $0 = source nick $1 = message $2 = target + $3 = was encrypted @window: Channel window @description: @@ -1243,13 +1247,15 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= For channel op or channel voice notices it will contain also the leading '@' or '+' flag. Please note that this convention is different from the one used in [event:onchannelprivmsg]OnChannelMessage[/event]: the incompatibility is here for historical reasons: it is not a big deal so we're not fighting it :) + $3 will be 1 if the message was encrypted and 0 otherwise. @seealso: [event:onservernotice]OnServerNotice[/event] */ EVENT("OnChannelNotice", \ "$0 = source nick\n" \ "$1 = message\n" \ - "$2 = target"), + "$2 = target\n" \ + "$3 = was encrypted"), // Queries /* @@ -1265,6 +1271,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= $1 = source username $2 = source host $3 = message + $4 = was encrypted @window: Query or console window. @description: @@ -1277,6 +1284,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= Note also that you may not receive this event if the anti-spam option is in use and KVIrc has detected that this might be a spam message. This is usually not an issue but if you care about it then write to pragma at kvirc dot net asking to add a OnSpam event. + $4 will be 1 if the message is encrypted and 0 otherwise. @seealso: [event:onquerywindowrequest]OnQueryWindowRequest[/event] [event:onquerywindowcreated]OnQueryWindowCreated[/event] @@ -1288,7 +1296,8 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= "$0 = source nick\n" \ "$1 = source username\n" \ "$2 = source hostname\n" \ - "$3 = message"), + "$3 = message\n" \ + "$4 = was encrypted"), /* @doc: onquerynotice @@ -1303,11 +1312,13 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= $1 = source username $2 = source host $3 = message + $4 = was encrypted @window: Query window or console @description: Triggered when a private notice is received.[br] If you call [cmd]halt[/cmd] in this event, the message output will be stopped and if the message was going to cause a query window creation, the window will NOT be created + $4 will be 1 if the message is encrypted and 0 otherwise. @seealso: [event:onchannelmessage]OnChannelMessage[/event] [event:onchannelnotice]OnChannelNotice[/event] @@ -1316,7 +1327,8 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]= "$0 = source nick\n" \ "$1 = source username\n" \ "$2 = source host\n" \ - "$3 = message"), + "$3 = message\n" \ + "$4 = was encrypted"), /* @doc: onquerywindowrequest diff --git a/src/kvirc/sparser/KviIrcServerParser_literalHandlers.cpp b/src/kvirc/sparser/KviIrcServerParser_literalHandlers.cpp index 44f123342..bb24e87b0 100644 --- a/src/kvirc/sparser/KviIrcServerParser_literalHandlers.cpp +++ b/src/kvirc/sparser/KviIrcServerParser_literalHandlers.cpp @@ -897,7 +897,7 @@ void KviIrcServerParser::parseLiteralPrivmsg(KviIrcMessage *msg) // trigger the script event and eventually kill the output QString szMsgText = query->decodeText(txtptr); - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryMessage,query,szNick,szUser,szHost,szMsgText)) + if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnQueryMessage,query,szNick,szUser,szHost,szMsgText,(kvs_int_t)(msgtype == KVI_OUT_QUERYPRIVMSGCRYPTED))) msg->setHaltOutput(); if(!KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound).isEmpty() && !query->hasAttention()) @@ -940,7 +940,7 @@ void KviIrcServerParser::parseLiteralPrivmsg(KviIrcMessage *msg) // no query creation: no decryption possible // trigger the query message event in the console QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryMessage,console,szNick,szUser,szHost,szMsgText)) + if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnQueryMessage,console,szNick,szUser,szHost,szMsgText,(kvs_int_t)0)) msg->setHaltOutput(); // we don't have a query here! @@ -1037,7 +1037,7 @@ void KviIrcServerParser::parseLiteralPrivmsg(KviIrcMessage *msg) QString szMsgText = chan->decodeText(txtptr); - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnChannelMessage,chan,szNick,szUser,szHost,szMsgText,szPrefixes)) + if(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnChannelMessage,chan,szNick,szUser,szHost,szMsgText,szPrefixes,(kvs_int_t)(msgtype == KVI_OUT_CHANPRIVMSGCRYPTED))) msg->setHaltOutput(); // if the message is identified (identify-msg CAP) then re-add the +/- char at the beginning @@ -1338,7 +1338,7 @@ output_to_query_window: DECRYPT_IF_NEEDED(query,msg->safeTrailing(),KVI_OUT_QUERYNOTICE,KVI_OUT_QUERYNOTICECRYPTED,szBuffer,txtptr,msgtype) QString szMsgText = query->decodeText(txtptr); // trigger the script event and eventually kill the output - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryNotice,query,szNick,szUser,szHost,szMsgText)) + if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnQueryNotice,query,szNick,szUser,szHost,szMsgText,(kvs_int_t)(msgtype == KVI_OUT_QUERYNOTICECRYPTED))) msg->setHaltOutput(); // spit out the message text if(!msg->haltOutput()) @@ -1369,7 +1369,7 @@ output_to_query_window: QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); // no query creation: no decryption possible // trigger the query message event in the console - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryNotice,console,szNick,szUser,szHost,szMsgText)) + if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnQueryNotice,console,szNick,szUser,szHost,szMsgText,(kvs_int_t)0)) msg->setHaltOutput(); // spit the message text out if(!msg->haltOutput()) @@ -1470,7 +1470,8 @@ output_to_query_window: DECRYPT_IF_NEEDED(chan,msg->safeTrailing(),KVI_OUT_CHANNELNOTICE,KVI_OUT_CHANNELNOTICECRYPTED,szBuffer,txtptr,msgtype) QString szMsgText = chan->decodeText(txtptr); - if(KVS_TRIGGER_EVENT_3_HALTED(KviEvent_OnChannelNotice,chan,szNick,szMsgText,szOriginalTarget))msg->setHaltOutput(); + if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnChannelNotice,chan,szNick,szMsgText,szOriginalTarget,(kvs_int_t)(msgtype == KVI_OUT_CHANNELNOTICECRYPTED))) + msg->setHaltOutput(); if(!msg->haltOutput()) { |
