Re: [prosody-dev] Modifying Prosody for filtering stanza

2014-03-27 Thread Jiibii Bii
Finally I stay on 8.2 ( I had problems with 9.3.0 maybe because of me? I 
will see later why).

The c2sports works fine. Quite easy finally.
I manage to make a little module based on mod_stanza_counters. Ok

But I sill have problem:
origin.conn:serverport() gives me the server port of  the message source 
session.
For incoming message this is what I want.
But for outgoing messages , I'd like to get the server port of the message 
destination session (not the source !).
How to do this the cleanest way?

The goal of my system is something like this:
people on 5222 have normal behavior
people on 5223 can't send and received messages, but sent and receive 
presence.
So my module must reject all message from (ok for this) and to ( how?) 
 port 5223

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
prosody-dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.


Re: [prosody-dev] Modifying Prosody for filtering stanza

2014-03-27 Thread Jiibii Bii
I could force presence priority to 0 ( or -1) on 5222 sessions, so outgoing 
messages wont be sent through them.  

Le jeudi 27 mars 2014 18:51:52 UTC+1, Jiibii Bii a écrit :

 Finally I stay on 8.2 ( I had problems with 9.3.0 maybe because of me? I 
 will see later why).

 The c2sports works fine. Quite easy finally.
 I manage to make a little module based on mod_stanza_counters. Ok

 But I sill have problem:
 origin.conn:serverport() gives me the server port of  the message source 
 session.
 For incoming message this is what I want.
 But for outgoing messages , I'd like to get the server port of the message 
 destination session (not the source !).
 How to do this the cleanest way?

 The goal of my system is something like this:
 people on 5222 have normal behavior
 people on 5223 can't send and received messages, but sent and receive 
 presence.
 So my module must reject all message from (ok for this) and to ( how?) 
  port 5223

 Thanks



-- 
You received this message because you are subscribed to the Google Groups 
prosody-dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.


Re: [prosody-dev] Modifying Prosody for filtering stanza

2014-03-26 Thread Jiibii Bii

Le mardi 25 mars 2014 19:39:26 UTC+1, Waqas a écrit :

 On Tue, Mar 25, 2014 at 1:35 PM, Jiibii Bii jiib...@gmail.comjavascript: 
 wrote: 
  Hello 
  
  I need to modifiy Prosody in ordre to: 
  - listen on 2 other ports than 5222 
  - filter or modify stanza (up and down)  for sessions on these new ports 
 ( 
  session on 5222 are not filtered) 
  
  I think, the filtering can be done in a 'module' ( maybe there are 
 already 
  modules for do that) 
  
  But can I use a module to make Prosody listen on several ports? 
  or do I need to modify the core of Prosody ( ie xmppclient_listener.lua 
 or 
  session_manager.lua ? ) 
  
  If someone has an idea where I can start, it would be nice to help me. 
  
  Thanks a lot. 
  

 This should all be doable with a custom plugin/module and some config 
 change. You wouldn't need to modify Prosody's core. 

 Set the client ports you need in your Prosody config: c2s_ports = { 
 5222, 6222, 7222 }; 

 I don't see  c2s_ports in the code.
 

 Now you'll write a plugin which listens on stanzas that you are 
 interested in. See mod_stanza_counter in prosody-modules for an 
 example of a plugin which hooks all stanzas. For the best performance 
 in benchmarks, you should generally only hook stanzas that you need :) 

 Stanza handlers get an event object, that contains the stanza and the 
 sending session. You can stop an event by doing a 'return true;' from 
 a handler, or let it continue with a 'return', 'return nil', or not 
 having a return statement (all of which are equivalent for this). You 
 can retrieve the port a session is connected to, and just 'return;' in 
 case it's 5222. See dev docs on the Prosody website for relevant 
 details. 

 Your mention of 'xmppclient_listener.lua' suggests that you are on an 
 old Prosody version. You should consider upgrading (not necessary, but 
 may improve things). You can also join the Prosody chatroom and talk 
 with us there if you need: https://prosody.im/discuss#chatroom 


Ok I add prosody repository to get the 9.3.0
 

 -- 
 Waqas Hussain 


-- 
You received this message because you are subscribed to the Google Groups 
prosody-dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.


[prosody-dev] Modifying Prosody for filtering stanza

2014-03-25 Thread Jiibii Bii
Hello

I need to modifiy Prosody in ordre to:
- listen on 2 other ports than 5222 
- filter or modify stanza (up and down)  for sessions on these new ports ( 
session on 5222 are not filtered)

I think, the filtering can be done in a 'module' ( maybe there are already 
modules for do that)

But can I use a module to make Prosody listen on several ports?
or do I need to modify the core of Prosody ( ie xmppclient_listener.lua or 
session_manager.lua ? )

If someone has an idea where I can start, it would be nice to help me.

Thanks a lot.

-- 
You received this message because you are subscribed to the Google Groups 
prosody-dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.