Ok, i see you use the INLINE command to "silence" a user but i meant the 
command you use to send regular messages to the APE Server. In order to 
block an action you must target it first. By default when a user sends a 
message in a channel it is send with a 'SEND' command to the server. For my 
suggestion i will i assume this is true in your application too. So to 
block a user from sending messages you would have to hook the 'SEND' 
command.

So to silence a user you can add a private property in the user object on 
the server side and just check for it in a SEND hook:

Ape.registerHookCmd ("SEND", function(params, info) {
    if(!!info.user.silenced) return 0;
    return 1;
});

Prior to this you would have set the user.silenced property to *true *or *
false*. Since you said you use the an INLINE command to do this you would 
modify your command like so:

Ape.registerCmd("INLINE", true, function(params, info){ 
var user = Ape.getUserByPubid(params.user);
if (user) {
//assuming that 'user' is the user's object you want to silence
user.silenced = true;

//And i guess this should let the user know that its been silenced
user.pipe.sendRaw("inline", {"silence": params.silence});
}
return 1;
});


On Saturday, September 29, 2012 4:44:57 AM UTC-4, apeman wrote:
>
> as u can see on example its command ... so I use 
>
> pipe.request.send('INLINE'   it goes to server with params about silence and 
> user pipe,
> and inline send raw to direct user about silencing or not ... i made it this 
> way ... 
>
>

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to