[JDEV] jsm mod_example entry point question

Thomas Charron tcharron at ductape.net
Thu Aug 2 10:15:05 CDT 2001

Quoting "Alexander N. Spitzer" <aspitzer at 3plex.com>:
> void mod_transcript(jsmi si)
> {
>   printf("----> TEST: in mod_transcript\n");
>   js_mapi_register(si,e_SERVER,mod_transcript_server,NULL);
> }
> How do I get it so that mod_transcript is instantiated upon all
> message
> arrivals... I thought (and CLEARLY I AM WRONG) that all messages pass
> through all the jsm modules, and each module decides whether or not to
> act
> on it... This does not appear to be the case, because I never see
> "----> TEST: in mod_transcript_server" in any transactions...
> What do I have to do to register mod_transcript with all traffic (or
> at
> least "chat" traffic?)

  Registering with e_SERVER will mean you will only get messages specifically 
targeted AT the server, aka, jabber.org/something, or just plain jabber.org.  
To test it, go ahead and send a message to yourserver/something, and sure 
enough, you'll see it.  I belive, IIRC, that two others are needed to do what 
you need to do:

    js_mapi_register(si,e_DELIVER, mod_filter_handler, NULL);

  Will be called before message delivery (Incoming)

    js_mapi_register(si,e_OFFLINE, mod_filter_handler, NULL);

  Will be called when user is offline.  Offline equiv to e_DELIVER (Incoming)

    js_mapi_register(si,e_SESSION, mod_filter_session, NULL);

  Will be called when logical sessions are created.  In this case, mod_filter 
session then does this:


  This will then call the mod_filter_out function when that session sends an 
outgoing message.

  These examples are taken from mod_filter, simply becouse its the first one I 
saw that I knew related to your question.

Thomas Charron
<< Wanted: One decent sig >>
<< Preferably litle used  >>

More information about the JDev mailing list