Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
choquito #1
Member since Mar 2013 · 21 posts · Location: Spain
Group memberships: Members
Show profile · Link to this post
Subject: Send groupchat message from component
Hi again Alex,

I need send a groupchat message to a MUC using a component. I test this code but not works:

  1. var msg = new Matrix.Xmpp.Component.Message
  2.     {
  3.        Id = System.DateTime.Now.Ticks.ToString(),
  4.        From = "mp.test.com",
  5.        To ="rl_10000000@muc.im.test.com",
  6.        Type = MessageType.groupchat,
  7.        Body = "test"
  8.      };
  9.  xmppComponent.Send(msg);


The component domain is "mp.test.com".

Thanks.
This post was edited on 2014-07-17, 21:49 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4295 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
have you joined the room with the component before?
Can you post the complete Xml log?

Alex
Avatar
choquito #3
Member since Mar 2013 · 21 posts · Location: Spain
Group memberships: Members
Show profile · Link to this post
log:

  1. 17-07-2014 21:00:32
  2. COMP SEND:
  3. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:component:accept" to="mp.ttutti.com" version="1.0" >
  4.  
  5. 17-07-2014 21:00:32
  6. COMP RECV:
  7. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:component:accept" from="mp.ttutti.com" id="011e4489-03eb-44b7-963e-310ccc951e5a" >
  8.  
  9. 17-07-2014 21:00:32
  10. COMP SEND:
  11. <handshake xmlns="jabber:component:accept">edb5a550e3099664c8eb000474815546ec958c31</handshake>
  12.  
  13. 17-07-2014 21:00:32
  14. COMP RECV:
  15. <handshake xmlns="jabber:component:accept" />
  16.  
  17. 17-07-2014 21:00:37
  18. COMP SEND:
  19. <message id="635412276354679760" from="mp.ttutti.com" to="rl_10000000@muc.im.ttutti.com" type="groupchat" xmlns="jabber:component:accept">
  20.  <body>test</body>
  21. </message>
  22.  
  23. 17-07-2014 21:00:37
  24. COMP RECV:
  25. <message id="635412276354679760" type="error" from="rl_10000000@muc.im.ttutti.com" to="mp.ttutti.com" xmlns="jabber:component:accept">
  26.  <body>Prueba a pelo</body>
  27.  <error code="403" type="auth">
  28.     <forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  29.  </error>
  30. </message>


joined with component?. No.
This post was edited 2 times, last on 2014-07-18, 07:59 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4295 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you are allowed to send messages to a muc only only after you have joined the room, and have voice in the room.
This means you have to join the room first with your component and then send a message to the room.

I don't know what your use is for that. But for me it makes not much sense to send messages to a chat room from a component. It would be much easier when you do that from a normal client connection. You can create a bot client for this.

Alex
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