changeset 453:39e173645f9c

External command is called for MUC messages
author Mikael Berthe <mikael@lilotux.net>
date Mon, 26 Sep 2005 22:36:18 +0200
parents dfd9c62b3a39
children d647b92e541f
files mcabber/mcabberrc.example mcabber/src/hooks.c
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabberrc.example	Mon Sep 26 22:08:48 2005 +0200
+++ b/mcabber/mcabberrc.example	Mon Sep 26 22:36:18 2005 +0200
@@ -59,6 +59,7 @@
 # The command is called the following way:
 #   $events_command MSG IN jabber@id        (when receiving a message)
 #   $events_command MSG OUT jabber@id       (when sending a message)
+#   $events_command MSG MUC room_id         (when receiving a MUC message)
 #   $events_command STATUS X jabber@id      (new buddy status is X)
 # See sample script in contrib/ directory.
 #set events_command = /home/mikael/.mcabber/eventcmd
--- a/mcabber/src/hooks.c	Mon Sep 26 22:08:48 2005 +0200
+++ b/mcabber/src/hooks.c	Mon Sep 26 22:36:18 2005 +0200
@@ -80,8 +80,8 @@
     hlog_write_message(jid, timestamp, FALSE, wmsg);
 
   // External command
-  if (!is_groupchat)
-    hk_ext_cmd(jid, 'M', 'R', NULL);
+  // XXX We should avoid calling the function for history lines in MUC
+  hk_ext_cmd(jid, (is_groupchat ? 'G' : 'M'), 'R', NULL);
 
   // We need to rebuild the list if the sender is unknown or
   // if the sender is offline/invisible and hide_offline_buddies is set
@@ -170,7 +170,10 @@
           arg_info = "IN";
         else if (info == 'S')
           arg_info = "OUT";
-
+        break;
+    case 'G':
+        arg_type = "MSG";
+        arg_info = "MUC";
         break;
     case 'S':
         arg_type = "STATUS";