Skip to content

Commit a490217

Browse files
committed
fix msi for 2 friends calling each other at the same time
1 parent 050bd77 commit a490217

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

toxav/msi.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,21 @@ static void handle_init(MSICall *call, const MSIMessage *msg)
826826
/* Call starting */
827827
LOGGER_API_INFO(call->session->tox,"MSI_CALL_REQUESTING:Friend sent an invite, but we are waiting for an call answer to our call");
828828

829-
/* if 2 friends call each other at the same time, ignore for now */
830-
#if 0
829+
/* if 2 friends call each other at the same time */
830+
#if 1
831831
call->peer_capabilities = msg->capabilities.value;
832832
call->state = MSI_CALL_ACTIVE;
833833

834834
if (invoke_callback(call, MSI_ON_START) == -1) {
835835
goto FAILURE;
836836
}
837+
838+
// send the correct answer to the other friend
839+
MSIMessage out_msg;
840+
msg_init(&out_msg, REQU_PUSH);
841+
out_msg.capabilities.exists = true;
842+
out_msg.capabilities.value = call->self_capabilities;
843+
send_message(call->session->tox, call->friend_number, &out_msg);
837844
#endif
838845
}
839846
break;

0 commit comments

Comments
 (0)