Skip to content

Commit

Permalink
Use XEP-0482 for multi-party call invites
Browse files Browse the repository at this point in the history
  • Loading branch information
fiaxh committed Oct 18, 2024
1 parent 3abe9fd commit 1e9a45f
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 138 deletions.
13 changes: 4 additions & 9 deletions libdino/src/service/call_state.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,12 @@ public class Dino.CallState : Object {
if (use_cim) {
XmppStream stream = stream_interactor.get_stream(call.account);
if (stream == null) return;
StanzaNode? inner_node = null;
if (group_call != null) {
inner_node = new StanzaNode.build("muji", Xep.Muji.NS_URI).add_self_xmlns()
.put_attribute("room", group_call.muc_jid.to_string());
stream.get_module(Xep.CallInvites.Module.IDENTITY).send_muji_accept(stream, cim_counterpart, cim_call_id, group_call.muc_jid, cim_message_type);
} else if (peers.size == 1) {
foreach (PeerState peer in peers.values) {
inner_node = new StanzaNode.build("jingle", Xep.CallInvites.NS_URI)
.put_attribute("sid", peer.sid);
}
string sid = peers.values.to_array()[0].sid;
stream.get_module(Xep.CallInvites.Module.IDENTITY).send_jingle_accept(stream, cim_counterpart, cim_call_id, sid, cim_message_type);
}
stream.get_module(Xep.CallInvites.Module.IDENTITY).send_accept(stream, cim_counterpart, cim_call_id, inner_node, cim_message_type);
} else {
foreach (PeerState peer in peers.values) {
peer.accept();
Expand Down Expand Up @@ -156,7 +151,7 @@ public class Dino.CallState : Object {
if (use_cim) {
XmppStream stream = stream_interactor.get_stream(call.account);
if (stream == null) return;
stream.get_module(Xep.CallInvites.Module.IDENTITY).send_finish(stream, cim_counterpart, cim_call_id, cim_message_type);
stream.get_module(Xep.CallInvites.Module.IDENTITY).send_left(stream, cim_counterpart, cim_call_id, cim_message_type);
}
call.state = Call.State.ENDED;
} else if (call.state == Call.State.RINGING) {
Expand Down
2 changes: 1 addition & 1 deletion xmpp-vala/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ SOURCES
"src/module/xep/0333_chat_markers.vala"
"src/module/xep/0334_message_processing_hints.vala"
"src/module/xep/0353_jingle_message_initiation.vala"
"src/module/xep/0353_call_invite_message.vala"
"src/module/xep/0359_unique_stable_stanza_ids.vala"
"src/module/xep/0363_http_file_upload.vala"
"src/module/xep/0380_explicit_encryption.vala"
Expand All @@ -145,6 +144,7 @@ SOURCES
"src/module/xep/0428_fallback_indication.vala"
"src/module/xep/0444_reactions.vala"
"src/module/xep/0461_replies.vala"
"src/module/xep/0482_call_invites.vala"
"src/module/xep/pixbuf_storage.vala"

"src/util.vala"
Expand Down
2 changes: 1 addition & 1 deletion xmpp-vala/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ sources = files(
'src/module/xep/0313_message_archive_management.vala',
'src/module/xep/0333_chat_markers.vala',
'src/module/xep/0334_message_processing_hints.vala',
'src/module/xep/0353_call_invite_message.vala',
'src/module/xep/0353_jingle_message_initiation.vala',
'src/module/xep/0359_unique_stable_stanza_ids.vala',
'src/module/xep/0363_http_file_upload.vala',
Expand All @@ -124,6 +123,7 @@ sources = files(
'src/module/xep/0428_fallback_indication.vala',
'src/module/xep/0444_reactions.vala',
'src/module/xep/0461_replies.vala',
'src/module/xep/0482_call_invites.vala',
'src/module/xep/pixbuf_storage.vala',
'src/util.vala',
)
Expand Down
127 changes: 0 additions & 127 deletions xmpp-vala/src/module/xep/0353_call_invite_message.vala

This file was deleted.

Loading

0 comments on commit 1e9a45f

Please sign in to comment.