| 1 |
namespace Xmpp.Xep.MucSelfPing { |
| 2 |
|
| 3 |
public static async bool is_joined(XmppStream stream, Jid jid) { |
| 4 |
Iq.Stanza iq_result = yield stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, jid); |
| 5 |
|
| 6 |
if (!iq_result.is_error()) { |
| 7 |
return true; |
| 8 |
} else { |
| 9 |
var error_stanza = iq_result.get_error(); |
| 10 |
if (error_stanza.condition in new string[] {ErrorStanza.CONDITION_SERVICE_UNAVAILABLE, ErrorStanza.CONDITION_FEATURE_NOT_IMPLEMENTED}) { |
| 11 |
// the client is joined, but the pinged client does not implement XMPP Ping |
| 12 |
return true; |
| 13 |
} |
| 14 |
} |
| 15 |
return false; |
| 16 |
} |
| 17 |
|
| 18 |
} |