Skip to content
Snippets Groups Projects
Commit d81a8e34 authored by Terry Wilson's avatar Terry Wilson
Browse files

Don't add Attendees during copy, replace them

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent a75ba8d1
No related branches found
No related tags found
No related merge requests found
...@@ -637,7 +637,7 @@ static int calendar_event_notify(const void *data) ...@@ -637,7 +637,7 @@ static int calendar_event_notify(const void *data)
tmp++; tmp++;
ast_copy_string(dest, tmp, sizeof(dest)); ast_copy_string(dest, tmp, sizeof(dest));
} else { } else {
ast_log(LOG_WARNING, "Channel should be in form Tech/Dest\n"); ast_log(LOG_WARNING, "Channel should be in form Tech/Dest (was '%s')\n", tech);
goto notify_cleanup; goto notify_cleanup;
} }
...@@ -753,6 +753,12 @@ static void copy_event_data(struct ast_calendar_event *dst, struct ast_calendar_ ...@@ -753,6 +753,12 @@ static void copy_event_data(struct ast_calendar_event *dst, struct ast_calendar_
dst->alarm = src->alarm; dst->alarm = src->alarm;
dst->busy_state = src->busy_state; dst->busy_state = src->busy_state;
/* Delete any existing attendees */
while ((attendee = AST_LIST_REMOVE_HEAD(&dst->attendees, next))) {
ast_free(attendee);
}
/* Copy over the new attendees */
while ((attendee = AST_LIST_REMOVE_HEAD(&src->attendees, next))) { while ((attendee = AST_LIST_REMOVE_HEAD(&src->attendees, next))) {
AST_LIST_INSERT_TAIL(&dst->attendees, attendee, next); AST_LIST_INSERT_TAIL(&dst->attendees, attendee, next);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment