aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep')
-rw-r--r--xmpp-vala/src/module/xep/0045_muc/module.vala6
-rw-r--r--xmpp-vala/src/module/xep/0353_call_invite_message.vala13
2 files changed, 15 insertions, 4 deletions
diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala
index 9969f507..56d50210 100644
--- a/xmpp-vala/src/module/xep/0045_muc/module.vala
+++ b/xmpp-vala/src/module/xep/0045_muc/module.vala
@@ -345,6 +345,12 @@ public class Module : XmppStreamModule {
if (status_codes.contains(StatusCode.SELF_PRESENCE)) {
Jid bare_jid = presence.from.bare_jid;
if (flag.get_enter_id(bare_jid) != null) {
+
+ // TODO only query that if we actually have the rights to
+ query_affiliation.begin(stream, bare_jid, "member");
+ query_affiliation.begin(stream, bare_jid, "admin");
+ query_affiliation.begin(stream, bare_jid, "owner");
+
flag.finish_muc_enter(bare_jid);
var join_result = new JoinResult() { nick=presence.from.resourcepart, newly_created=status_codes.contains(StatusCode.NEW_ROOM_CREATED) };
flag.enter_futures[bare_jid].set_value(join_result);
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;