Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
yagami #1
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
use the default Send function, the xml like this

  1. <message to="166666@mobile01.com" type="chat" xmlns="jabber:client">
  2.  <body>YES</body>
  3. </message>
but I want the xml like this

  1. <message id="rA4a7-110" to="1713949@mobile01.com" from="2128809@mobile01.com/Smack" type="chat">
  2.     <body>Very GooD</body>
  3.     <thread>Rwg1t0</thread>
  4.     <x xmlns="jabber:x:event">
  5.         <offline/>
  6.         <delivered/>
  7.         <displayed/>
  8.         <composing/>
  9.     </x>
  10. </message>
How to do this?

Thanks~
This post was edited on 2018-05-02, 11:33 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
XEP-0022: Message Events are obsolete.
You should use XEP-0085: Chat State Notifications instead

For chat states there is a property i the message object.

Example:
  1. msg.Chatstate = Matrix.Xmpp.Chatstates.Chatstate.active;
Avatar
yagami #3
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
If I want to add "id" to the message,like id="rA4a7-110"

  1. <message id="rA4a7-110" to="1713949@mobile01.com" from="2128809@mobile01.com/Smack" type="chat">

How should I do ?

Thanks~~~:D
This post was edited on 2018-05-02, 11:33 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  1. msg.Id = "rA4a7-110";
Avatar
yagami #5
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Quote by Alex on 2012-03-30, 12:41:
XEP-0022: Message Events are obsolete.
You should use XEP-0085: Chat State Notifications instead

For chat states there is a property i the message object.

Example:
  1. msg.Chatstate = Matrix.Xmpp.Chatstates.Chatstate.active;
My Server only supports XEP-0022...How do I send this kind of message?Thanks..:)

  1.     <x xmlns="jabber:x:event">
  2.         <offline/>
  3.         <delivered/>
  4.         <displayed/>
  5.         <composing/>
  6.     </x>
This post was edited on 2018-05-02, 11:33 by Alex.
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by yagami:
My Server only supports XEP-0022
no, every server supports XEP-0085. This is a client side extension and needs no server logic and code at all.

Quote by yagami:
How do I send this kind of message?Thanks..:)

  1.     <x xmlns="jabber:x:event">
  2.         <offline/>
  3.         <delivered/>
  4.         <displayed/>
  5.         <composing/>
  6.     </x>
write an extensions for this and add the packets to your messages.
Here is a tutorial: http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…

Alex
This post was edited on 2018-05-02, 11:33 by Alex.
Avatar
yagami #7
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex:
write an extensions for this and add the packets to your messages.
Here is a tutorial: http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…

Alex
If I add the class, how to add the packets to messages?
I don't know how to add.....

Thanks a lot...^^""
Avatar
Alex #8
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by yagami:
If I add the class, how to add the packets to messages?
I don't know how to add.....

Have you studied the tutorial I linked?

  1. msg.Add(yourCustomPacket);
Avatar
yagami #9
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex:
Quote by yagami:
If I add the class, how to add the packets to messages?
I don't know how to add.....

Have you studied the tutorial I linked?

  1. msg.Add(yourCustomPacket);

ohhhh.....I see that!!!
Thanks for your help~~~~:D
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: MatriX RSS