diff options
Diffstat (limited to 'xmpp-vala/src/module/xep/0353_call_invite_message.vala')
-rw-r--r-- | xmpp-vala/src/module/xep/0353_call_invite_message.vala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/xmpp-vala/src/module/xep/0353_call_invite_message.vala b/xmpp-vala/src/module/xep/0353_call_invite_message.vala index bc74ba2c..38d87f43 100644 --- a/xmpp-vala/src/module/xep/0353_call_invite_message.vala +++ b/xmpp-vala/src/module/xep/0353_call_invite_message.vala @@ -12,10 +12,10 @@ namespace Xmpp.Xep.CallInvites { public signal void call_rejected(Jid from, Jid to, string call_id, string message_type); public signal void call_left(Jid from, Jid to, string call_id, string message_type); - public string send_jingle_propose(XmppStream stream, Jid invitee, string sid, bool video) { + public void send_jingle_propose(XmppStream stream, string call_id, Jid invitee, string sid, bool video) { StanzaNode jingle_node = new StanzaNode.build("jingle", CallInvites.NS_URI) .put_attribute("sid", sid); - return send_propose(stream, sid, invitee, jingle_node, video, false, MessageStanza.TYPE_CHAT); + send_propose(stream, call_id, invitee, jingle_node, video, false, MessageStanza.TYPE_CHAT); } public void send_muji_propose(XmppStream stream, string call_id, Jid invitee, Jid muc_jid, bool video, string message_type) { @@ -24,7 +24,7 @@ namespace Xmpp.Xep.CallInvites { send_propose(stream, call_id, invitee, muji_node, video, true, message_type); } - private string send_propose(XmppStream stream, string call_id, Jid invitee, StanzaNode inner_node, bool video, bool multiparty, string message_type) { + private void send_propose(XmppStream stream, string call_id, Jid invitee, StanzaNode inner_node, bool video, bool multiparty, string message_type) { StanzaNode invite_node = new StanzaNode.build("propose", NS_URI).add_self_xmlns() .put_attribute("id", call_id) .put_attribute("video", video.to_string()) @@ -34,7 +34,6 @@ namespace Xmpp.Xep.CallInvites { MessageProcessingHints.set_message_hint(invite_message, MessageProcessingHints.HINT_STORE); invite_message.stanza.put_node(invite_node); stream.get_module(MessageModule.IDENTITY).send_message.begin(stream, invite_message); - return invite_message.id; } public void send_retract(XmppStream stream, Jid to, string call_id, string message_type) { @@ -81,6 +80,12 @@ namespace Xmpp.Xep.CallInvites { if (relevant_node.name == "propose") { if (relevant_node.sub_nodes.is_empty) return; + + // If there's also a JMI node, just use that one instead. + foreach (StanzaNode node in message.stanza.sub_nodes) { + if (node.ns_uri == JingleMessageInitiation.NS_URI) return; + } + bool video = relevant_node.get_attribute_bool("video", false); call_proposed(message.from, message.to, call_id, video, relevant_node.sub_nodes, message); return; |