Skip to content

Commit

Permalink
presence: test if event is dialog to avoid unnecessary xml parsing
Browse files Browse the repository at this point in the history
(cherry picked from commit 6d0f899)
(cherry picked from commit 4ffe23d)
  • Loading branch information
Claudiu Boriga authored and miconda committed Apr 3, 2019
1 parent e01a1b7 commit d0d4ba7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/modules/presence/presentity.c
Expand Up @@ -691,17 +691,18 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
goto error;
}
}
if (presentity->event->evp->type == EVENT_DIALOG) {
check_if_dialog(*body, &is_dialog, &dialog_id);
if (dialog_id) {
if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) {
free(dialog_id);
dialog_id = NULL;
goto error;
}

check_if_dialog(*body, &is_dialog, &dialog_id);
if ( dialog_id ) {
if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) {
free(dialog_id);
dialog_id = NULL;
goto error;
}

free(dialog_id);
dialog_id = NULL;
}
LM_DBG("inserting %d cols into table\n",n_query_cols);

Expand Down

0 comments on commit d0d4ba7

Please sign in to comment.