Get Sender on custom extension response
Get Sender on custom extension response
I'm building some custom extensions where I need to know which user sent the request. Do I have to return the sender from Java with every extension that needs this or is there a way to get this already?
-
itsmylifesoham
- Posts: 186
- Joined: 16 Oct 2011, 14:33
Re: Get Sender on custom extension response
hi,
you must be having some client request handler defined for the incoming client request in you extension right?
in this handler which basically extends baseclientrequesthandler you can write
so you can get the user who sent the request...is this what you wanted or something else?
you must be having some client request handler defined for the incoming client request in you extension right?
in this handler which basically extends baseclientrequesthandler you can write
Code: Select all
User sender = (SFSUser) event.getParam(sfseventparam.USER) ;Re: Get Sender on custom extension response
i think you have to pass sender through sfsobject in the send command like so,
Code: Select all
public void handleClientRequest(User sender, ISFSObject params)
{
sfsObject.putfString("who invokes this", sender.getName());
send("Hello", sfsObject, getRoom.userList);
}======================================================
Choose a job of your choice and you will never have to work in life !!!
Choose a job of your choice and you will never have to work in life !!!
Re: Get Sender on custom extension response
Thanks secret, that's what I'm doing now. Just wondered if I had to return that myself. I'll probably make an abstract class that sends that by default
Re: Get Sender on custom extension response
Hello.
I didn't understand your problem quite well... So you want to send an extension message to every user on a room and tell them who previously sent an extension request right? If that's the case, so yeah, you have to manually add the sender's name to the response SFSObject. In case that sender is always on the same room as the receivers, you can just send his userId, and save some important bandwidth
I didn't understand your problem quite well... So you want to send an extension message to every user on a room and tell them who previously sent an extension request right? If that's the case, so yeah, you have to manually add the sender's name to the response SFSObject. In case that sender is always on the same room as the receivers, you can just send his userId, and save some important bandwidth
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Get Sender on custom extension response
you welcomehelto wrote:Thanks secret, that's what I'm doing now. Just wondered if I had to return that myself. I'll probably make an abstract class that sends that by default
======================================================
Choose a job of your choice and you will never have to work in life !!!
Choose a job of your choice and you will never have to work in life !!!