aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0166_jingle.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep/0166_jingle.vala')
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmpp-vala/src/module/xep/0166_jingle.vala b/xmpp-vala/src/module/xep/0166_jingle.vala
index 7fc6c929..ca368f00 100644
--- a/xmpp-vala/src/module/xep/0166_jingle.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle.vala
@@ -572,13 +572,15 @@ public class Session {
}
void handle_session_accept(XmppStream stream, ContentNode content, StanzaNode jingle, Iq.Stanza iq) throws IqError {
string? responder_str = jingle.get_attribute("responder");
- Jid responder;
+ Jid responder = iq.from;
if (responder_str != null) {
- responder = Jid.parse(responder_str) ?? iq.from;
- } else {
- responder = iq.from; // TODO(hrxi): and above, can we assume iq.from != null
- // TODO(hrxi): more sanity checking, perhaps replace who we're talking to
+ try {
+ responder = new Jid(responder_str);
+ } catch (InvalidJidError e) {
+ warning("Received invalid session accept: %s", e.message);
+ }
}
+ // TODO(hrxi): more sanity checking, perhaps replace who we're talking to
if (!responder.is_full()) {
throw new IqError.BAD_REQUEST("invalid responder JID");
}