aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urgent.tcl20
1 files changed, 16 insertions, 4 deletions
diff --git a/urgent.tcl b/urgent.tcl
index 4242987..e782bf4 100644
--- a/urgent.tcl
+++ b/urgent.tcl
@@ -36,12 +36,24 @@ namespace eval urgent {
-group Urgent
}
+proc urgent::is_delayed {xml} {
+ foreach xelem $xml {
+ ::jlib::wrapper:splitxml $xelem tag vars isempty chdata children
+ switch -- [::jlib::wrapper:getattr $vars xmlns] {
+ urn:xmpp:delay -
+ jabber:x:delay {
+ return 1
+ }
+ }
+ }
+ return 0
+}
proc urgent::chat_message_notify {chatid from type body extras} {
variable options
if {!$options(enabled)} return
- set delayed [::xmpp::delay::exists $extras]
+ set delayed [is_delayed $extras]
if {$delayed} return
switch -- $type {
@@ -65,10 +77,10 @@ proc urgent::chat_message_notify {chatid from type body extras} {
}
}
chat {
+ # Handle special tag indicating history messages:
foreach xelem $extras {
- ::xmpp::xml::split $xelem tag xmlns attrs cdata subels
- # Don't play sound if this 'empty' tag is present. It indicates
- # messages history in chat window.
+ ::jlib::wrapper:splitxml $xelem tag vars ? ? ?
+ set xmlns [::jlib::wrapper:getattr $vars xmlns]
if {[string equal $tag ""] && \
[string equal $xmlns tkabber:x:nolog]} {
return