xmppo / xmpp-php

PHP client library for XMPP (Jabber) protocol
https://github.com/xmppo/xmpp-php
MIT License
45 stars 23 forks source link

can't seem to send message to a groupchat. #8

Open jacksnodgrass opened 5 years ago

jacksnodgrass commented 5 years ago

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("chatroom@conference.chat.server/resource_name");

BUT xmpp-php sends:

<presence from='testuser@spark.example.com' to='groupchat@conference.spark.example.com' 
 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='testuser@spark.example.com' to='groupchat@conference.spark.example.com' /> instead... then the send() to the chat room works.

Norgul commented 5 years ago

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?

jacksnodgrass commented 5 years ago

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

Norgul commented 5 years ago

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.

jacksnodgrass commented 5 years ago

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

Norgul commented 5 years ago

That would be great!

Norgul commented 5 years ago

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

Thanks

jacksnodgrass commented 5 years ago

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