diff options
Diffstat (limited to 'libical/src')
-rw-r--r-- | libical/src/libical/icalcomponent.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libical/src/libical/icalcomponent.c b/libical/src/libical/icalcomponent.c index c771dc3cf9..6c222f01a9 100644 --- a/libical/src/libical/icalcomponent.c +++ b/libical/src/libical/icalcomponent.c @@ -1458,7 +1458,19 @@ const char* icalcomponent_get_summary(icalcomponent* comp) void icalcomponent_set_comment(icalcomponent* comp, const char* v); const char* icalcomponent_get_comment(icalcomponent* comp); -void icalcomponent_set_uid(icalcomponent* comp, const char* v); +void icalcomponent_set_uid(icalcomponent* comp, const char* v) +{ + icalcomponent *inner = icalcomponent_get_inner (comp); + icalproperty *prop + = icalcomponent_get_first_property (inner, ICAL_UID_PROPERTY); + + if (prop == 0) { + prop = icalproperty_new_uid (v); + icalcomponent_add_property (inner, prop); + } + + icalproperty_set_uid (prop, v); +} const char* icalcomponent_get_uid(icalcomponent* comp) { |