Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions src/wcall/wcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,29 +600,44 @@ static void icall_start_handler(struct icall *icall,
}

if (inst->processing_notifications && inst->incomingh) {
struct incoming_event *prev_ie;
struct incoming_event *ie;

ie = find_pending_event(&inst->pending_eventl, userid_sender);
if (ie) {
list_unlink(&ie->le);
}
ie = mem_zalloc(sizeof(*ie), ie_destructor);
if (ie) {
str_dup(&ie->convid, wcall->convid);
ie->msg_time = msg_time;
str_dup(&ie->userid, userid_sender);
str_dup(&ie->clientid, clientid_sender);
ie->video_call = video;
ie->should_ring = should_ring;
ie->conv_type = conv_type;
ie->arg = inst;

list_append(&inst->pending_eventl, &ie->le, ie);
if (!ie) {
warning("wcall(%p): incomingh: cannot allocate ie\n",
wcall);
Comment thread
z-dule marked this conversation as resolved.
return;
}

prev_ie = find_pending_event(&inst->pending_eventl,
userid_sender);
if (prev_ie) {
list_unlink(&prev_ie->le);
}

str_dup(&ie->convid, wcall->convid);
ie->msg_time = msg_time;
str_dup(&ie->userid,
prev_ie ? prev_ie->userid : userid_sender);
str_dup(&ie->clientid,
prev_ie ? prev_ie->clientid : clientid_sender);
ie->video_call = prev_ie ? prev_ie->video_call : video;
ie->should_ring =
prev_ie ? prev_ie->should_ring : should_ring;
ie->conv_type =
prev_ie ? prev_ie->conv_type : conv_type;
ie->arg = inst;

list_append(&inst->pending_eventl, &ie->le, ie);

if (prev_ie) {
mem_deref(prev_ie);
}

return;
}

if (inst->incomingh) {
if (inst->mm) {
mediamgr_invoke_incomingh(inst->mm,
Expand Down