xmpp-php icon indicating copy to clipboard operation
xmpp-php copied to clipboard

can't seem to send message to a groupchat.

Open jacksnodgrass opened this issue 6 years ago • 7 comments

I can do: $client->message->send($message, $recipient,$msg_type); where $msg_type = 'chat' and send the specified message to the specified recipient.

changing $msg_type to 'groupchat' does not get the message sent to a chat group.

You have to FIRST do something like: $client->presence->subscribe("[email protected]/resource_name");

BUT xmpp-php sends:

<presence from='[email protected]' to='[email protected]' 
 type='subscribe' />

and that does not work for my openchat chat server. I don't get an error but when I do the send() I get a 406 error.

<error code="406" type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error>

If we send: <presence from='[email protected]' to='[email protected]' /> instead... then the send() to the chat room works.

  • jack

jacksnodgrass avatar Jun 28 '19 14:06 jacksnodgrass

Thanks Jack for these comments and improvements. Do you have a server test account somewhere readily available so I can test it out as well?

Norgul avatar Jun 29 '19 10:06 Norgul

I'll see if I can get something setup on Monday that you can access. Do you use docker at all?

jacksnodgrass avatar Jun 30 '19 13:06 jacksnodgrass

Thanks.

Regarding Docker yes, but not here because this is meant to be the core library, and if I would get Docker container it would make much more sense to make a container with Ratchet which runs a WS server which calls the library.

Norgul avatar Jun 30 '19 13:06 Norgul

I was asking about docker because I have a pretty good docker-compose setup for openfire ( a xmpp based chat server ) could be used for localized testing. - jack

jacksnodgrass avatar Jun 30 '19 13:06 jacksnodgrass

That would be great!

Norgul avatar Jun 30 '19 13:06 Norgul

Hello @jacksnodgrass, is there anything new in setting me up the access for the server or maybe merging a openfire Docker env?

Thanks

Norgul avatar Jul 09 '19 05:07 Norgul

no.. sorry.. busy with work. will try and get something setup soon.

jacksnodgrass avatar Jul 10 '19 12:07 jacksnodgrass