Send JMI retract

This commit is contained in:
fiaxh 2021-04-11 14:33:51 +02:00
parent 0707fd9ac4
commit 369755781e
2 changed files with 14 additions and 0 deletions

View file

@ -136,6 +136,7 @@ namespace Dino {
sessions[call].terminate(Xep.Jingle.ReasonElement.CANCEL, null, "cancel"); sessions[call].terminate(Xep.Jingle.ReasonElement.CANCEL, null, "cancel");
} else { } else {
// Only a JMI so far // Only a JMI so far
stream.get_module(Xep.JingleMessageInitiation.Module.IDENTITY).send_session_retract_to_peer(stream, call.counterpart, jmi_sid[call.account]);
} }
call.state = Call.State.MISSED; call.state = Call.State.MISSED;
} else { } else {
@ -207,6 +208,11 @@ namespace Dino {
public void mute_own_video(Call call, bool mute) { public void mute_own_video(Call call, bool mute) {
we_should_send_video[call] = !mute; we_should_send_video[call] = !mute;
if (!sessions.has_key(call)) {
// Call hasn't been established yet
return;
}
Xep.JingleRtp.Module rtp_module = stream_interactor.module_manager.get_module(call.account, Xep.JingleRtp.Module.IDENTITY); Xep.JingleRtp.Module rtp_module = stream_interactor.module_manager.get_module(call.account, Xep.JingleRtp.Module.IDENTITY);
if (video_content_parameter.has_key(call) && if (video_content_parameter.has_key(call) &&

View file

@ -22,6 +22,14 @@ namespace Xmpp.Xep.JingleMessageInitiation {
stream.get_module(MessageModule.IDENTITY).send_message.begin(stream, accepted_message); stream.get_module(MessageModule.IDENTITY).send_message.begin(stream, accepted_message);
} }
public void send_session_retract_to_peer(XmppStream stream, Jid to, string sid) {
MessageStanza retract_message = new MessageStanza() { to=to };
retract_message.stanza.put_node(
new StanzaNode.build("retract", NS_URI).add_self_xmlns()
.put_attribute("id", sid, NS_URI));
stream.get_module(MessageModule.IDENTITY).send_message.begin(stream, retract_message);
}
public void send_session_accept_to_self(XmppStream stream, string sid) { public void send_session_accept_to_self(XmppStream stream, string sid) {
MessageStanza accepted_message = new MessageStanza() { to=Bind.Flag.get_my_jid(stream).bare_jid }; MessageStanza accepted_message = new MessageStanza() { to=Bind.Flag.get_my_jid(stream).bare_jid };
accepted_message.stanza.put_node( accepted_message.stanza.put_node(