Closed guybrushbr closed 3 years ago
Hello @pardinijr
it's been a while since I did any work on this library as I am engaged on other fronts. I wanted to refactor everything, but I have no time currently.
$client->getResponse()
fetches the raw response. For message, try $client->message->receive()
as specified here.
Regarding checking user presence, you should check that part in XMPP protocol documentation. I never had the need to do it so I can't really tell. There is a $client->iq->ping()
method, but I doubt it is what you want. On the other hand, I'm not sure how auto-replies work. Only way this makes sense is if auto-reply is on XMPP server, so that it knows to return that response when user is disconnected. In your case I see a service-unavailable
so I'm not sure if everything is configured correctly.
Hello @Norgul
Thank you so much for your reply!
You are right, I was following the instructions inside Example.php and didn't notice the method $client->message->receive()
in README.
I will research XMPP protocol documentation on how to get user presence and try to implement it. If I have sucess I will send you the code.
Best regards!
Hi! Sorry, I am very new in this XMPP world and english is not my native language.
I am trying to send/receive messages using a Prosody xmpp server, following your basic example:
admin01 can connect to the xmppserver.com and send the message without issues.
user01 is configured to auto-reply with a "pong" every time it receives a "ping" message.
When user01 is offline (disconnected) I receive the following response:
Here is the log:
When user01 is online (connected) I receive the following response:
Here is the log:
Please, I'd like to know how to check for user presence before send the message and also how to parse the message to only receive what is in the body.
Thank you very much!