Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
pivavar #1
Member since Feb 2013 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Send a choice
Hello,

I need to extend agsXMPP with some features. One of them - sending a message with a set of options from user1 to user2. And user2 should respond with the selected option(like dropdown box). Could you please show me the way to implement this? I suppose I need XEP-0004. Is it correct?
This post was edited on 2013-03-06, 10:05 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by pivavar:
I suppose I need XEP-0004. Is it correct?

yes this is correct. You have to create a Xdata from and then just add it to a message.
There is also the agsXMPP.ui library which has a parser which renders such a form to a UI, and also creates the result XData Xml when you submit it.

Alex
Avatar
pivavar #3
Member since Feb 2013 · 5 posts
Group memberships: Members
Show profile · Link to this post
Thank you, Alex. You are helpful as usual.

One more question please. User1 needs to request some info from User2 and get a response. He also needs to get a notification if User2 is offline ASAP(after sending request). What is the best way to achieve this? We can't disable offline messages on server.
This post was edited on 2013-03-06, 13:01 by pivavar.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you can send requests with IQs from user to user. Look at the custom packet tutorial how to create your own requests.
Whenever one of your contacts goes offline you immediately get a OnPresence event where type is unavailable
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS