# HG changeset patch # User Mikael Berthe # Date 1127766978 -7200 # Node ID 39e173645f9c10cf9fbda180339b4e97d04f6d68 # Parent dfd9c62b3a39d36d19bd4c0083d02e7ba6aa8214 External command is called for MUC messages diff -r dfd9c62b3a39 -r 39e173645f9c mcabber/mcabberrc.example --- 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 diff -r dfd9c62b3a39 -r 39e173645f9c mcabber/src/hooks.c --- 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";