[ejabberd] More logging from mod_muc

Jesse Thompson jesse.thompson at doit.wisc.edu
Wed Sep 22 00:11:53 MSD 2010


May I offer a simpler solution?

We just patched mod_muc so that it logs when users login (tying the JID 
to the Nick) and logs when users change their Nick.

Here is the diff.  I haven't verified yet if it works with any version 
past ejabberd 2.0.5.

--- src/ejabberd-2.0.4/src/mod_muc/mod_muc_room.erl.ORIG        Thu May 
14 10:50:07 2009
+++ src/ejabberd-2.0.4/src/mod_muc/mod_muc_room.erl     Thu May 14 
11:09:56 2009
@@ -1310,6 +1310,8 @@
                         StateData#state.users),
      add_to_log(join, Nick, StateData),
      tab_add_online_user(JID, StateData),
+    ?INFO_MSG("User joined MUC. JID=~s nickname=~s",
+              [jlib:jid_to_string(JID),Nick]),
      StateData#state{users = Users}.

  remove_online_user(JID, StateData) ->
@@ -1806,6 +1808,8 @@
      NewStateData = StateData#state{users = Users},
      send_nick_changing(JID, OldNick, NewStateData),
      add_to_log(nickchange, {OldNick, Nick}, StateData),
+    ?INFO_MSG("MUC user JID=~s changed nickname from=~s to=~s",
+              [jlib:jid_to_string(JID),OldNick,Nick]),
      NewStateData.

  send_nick_changing(JID, OldNick, StateData) ->


On 09/21/2010 01:03 PM, Aaron Brashears wrote:
> Hello all.
>
> I have written a new muc implementation based on ejabberd 2.1.5 and a
> with little help from modular_muc. One of our needs is to scrape
> connect/disconnect information which can be tied to a uniquely
> identified user. For this, I rewrote the message passing to include
> the user JID when available.
>
> http://github.com/aaronbrashears/ejabberd-muc-extensions/tree/real_jid
>
> It can be enabled with some simple configuration change:
>
> -    {mod_muc,  [
> +    {mod_muc_ext,  [
>
> and
>
> -    {mod_muc_log,  [
> +    {mod_muc_log_ext,  [
>
> Everything seems to work and there is one little thing that bothers me
> about something I found in ejabberd_admin.erl. Around line 422, there
> is the line:
>
> module_tables(mod_muc) ->  [muc_room, muc_registered];
>
> Do I need to do something in my module to declare usage of those
> tables? Was it a band idea to rename the module to mod_muc_ext?
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3403 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20100921/44143835/attachment.bin>


More information about the ejabberd mailing list