Intercept commands

5 views
Skip to first unread message

Beldar

unread,
Feb 7, 2012, 8:04:29 AM2/7/12
to APE Project
Hi,

I'm creating something from the Chat demo, and I noticed when you
submit a message it just makes a pipe.send(msg) , but at the same time
it's declared this.onCmd('send', this.cmdSend), where the method
cmdSend writes the message to the chat window.

Ok so there're my questions:

1. The onCmd event occurs before the data is sent or after?

2. If the answer to the first question is before, it's possible to add
additional data to the message or modify it?

Thanks!

Beldar

unread,
Feb 16, 2012, 2:43:59 PM2/16/12
to APE Project
Anyone have any thoughts about this?

ma liang

unread,
Feb 16, 2012, 10:31:16 PM2/16/12
to ape-p...@googlegroups.com
2012/2/17 Beldar <belda...@gmail.com>
Anyone have any thoughts about this?

On 7 feb, 14:04, Beldar <beldar....@gmail.com> wrote:
> Hi,
>
> I'm creating something from the Chat demo, and I noticed when you
> submit a message it just makes a pipe.send(msg) , but at the same time
> it's declared this.onCmd('send', this.cmdSend), where the method
> cmdSend writes the message to the chat window.
>
> Ok so there're my questions:
>
> 1. The onCmd event occurs before the data is sent or after?
 
 Accord Request/Request.js's function send(), onCmd event fired before that data is sent.
 


> 2. If the answer to the first question is before, it's possible to add
> additional data to the message or modify it?
>
> Thanks!

 
Accord Request/Request.js's function parseCmd(),
message is passed to onCmd() by copied to evParams, so, you can't modify it.
But you can modify Request.js to do this.
 
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
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 all
Reply to author
Forward
0 new messages