summaryrefslogtreecommitdiffabout
path: root/libical/src/libicalss/icalmessage.c
Unidiff
Diffstat (limited to 'libical/src/libicalss/icalmessage.c') (more/less context) (show whitespace changes)
-rw-r--r--libical/src/libicalss/icalmessage.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libical/src/libicalss/icalmessage.c b/libical/src/libicalss/icalmessage.c
index d5c57c1..731a2c7 100644
--- a/libical/src/libicalss/icalmessage.c
+++ b/libical/src/libicalss/icalmessage.c
@@ -31,25 +31,25 @@
31#include <ctype.h> /* for tolower()*/ 31#include <ctype.h> /* for tolower()*/
32#include <string.h> /* for strstr */ 32#include <string.h> /* for strstr */
33#include <stdlib.h> /* for free(), malloc() */ 33#include <stdlib.h> /* for free(), malloc() */
34icalcomponent* icalmessage_get_inner(icalcomponent* comp) 34icalcomponent* icalmessage_get_inner(icalcomponent* comp)
35{ 35{
36 if (icalcomponent_isa(comp) == ICAL_VCALENDAR_COMPONENT){ 36 if (icalcomponent_isa(comp) == ICAL_VCALENDAR_COMPONENT){
37 return icalcomponent_get_first_real_component(comp); 37 return icalcomponent_get_first_real_component(comp);
38 } else { 38 } else {
39 return comp; 39 return comp;
40 } 40 }
41} 41}
42 42
43char* lowercase(const char* str) 43static char* lowercase(const char* str)
44{ 44{
45 char* p = 0; 45 char* p = 0;
46 char* n = icalmemory_strdup(str); 46 char* n = icalmemory_strdup(str);
47 47
48 if(str ==0){ 48 if(str ==0){
49 return 0; 49 return 0;
50 } 50 }
51 51
52 for(p = n; *p!=0; p++){ 52 for(p = n; *p!=0; p++){
53 *p = tolower(*p); 53 *p = tolower(*p);
54 } 54 }
55 55
@@ -149,26 +149,31 @@ icalcomponent *icalmessage_new_reply_base(icalcomponent* c,
149 if (attendee == 0){ 149 if (attendee == 0){
150 icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); 150 icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
151 icalcomponent_free(reply); 151 icalcomponent_free(reply);
152 return 0; 152 return 0;
153 } 153 }
154 154
155 icalcomponent_add_property(inner,icalproperty_new_clone(attendee)); 155 icalcomponent_add_property(inner,icalproperty_new_clone(attendee));
156 156
157 /* Add PRODID and VERSION */ 157 /* Add PRODID and VERSION */
158 158
159 icalcomponent_add_property(reply,icalproperty_new_version("2.0")); 159 icalcomponent_add_property(reply,icalproperty_new_version("2.0"));
160 160
161#ifndef WIN32
161 sprintf(tmp, 162 sprintf(tmp,
162 "-//SoftwareStudio//NONSGML %s %s //EN",PACKAGE,VERSION); 163 "-//SoftwareStudio//NONSGML %s %s //EN",PACKAGE,VERSION);
164#else
165 sprintf(tmp,
166 "-//SoftwareStudio//NONSGML %s %s //EN",ICAL_PACKAGE,ICAL_VERSION);
167#endif
163 icalcomponent_add_property(reply,icalproperty_new_prodid(tmp)); 168 icalcomponent_add_property(reply,icalproperty_new_prodid(tmp));
164 169
165 return reply; 170 return reply;
166 171
167} 172}
168 173
169icalcomponent* icalmessage_new_accept_reply(icalcomponent* c, 174icalcomponent* icalmessage_new_accept_reply(icalcomponent* c,
170 const char* user, 175 const char* user,
171 const char* msg) 176 const char* msg)
172{ 177{
173 178
174 icalcomponent *reply; 179 icalcomponent *reply;
@@ -221,29 +226,29 @@ icalcomponent* icalmessage_new_decline_reply(icalcomponent* c,
221 226
222/* New is modified version of old */ 227/* New is modified version of old */
223icalcomponent* icalmessage_new_counterpropose_reply(icalcomponent* oldc, 228icalcomponent* icalmessage_new_counterpropose_reply(icalcomponent* oldc,
224 icalcomponent* newc, 229 icalcomponent* newc,
225 const char* user, 230 const char* user,
226 const char* msg) 231 const char* msg)
227{ 232{
228 icalcomponent *reply; 233 icalcomponent *reply;
229 234
230 icalerror_check_arg_rz(oldc,"oldc"); 235 icalerror_check_arg_rz(oldc,"oldc");
231 icalerror_check_arg_rz(newc,"newc"); 236 icalerror_check_arg_rz(newc,"newc");
232 237
233 reply = icalcomponent_new_clone(newc); 238 reply = icalmessage_new_reply_base(newc,user,msg);
234 239
235 icalcomponent_set_method(reply,ICAL_METHOD_COUNTER); 240 icalcomponent_set_method(reply,ICAL_METHOD_COUNTER);
236 241
237 return newc; 242 return reply;
238 243
239} 244}
240 245
241 246
242icalcomponent* icalmessage_new_delegate_reply(icalcomponent* c, 247icalcomponent* icalmessage_new_delegate_reply(icalcomponent* c,
243 const char* user, 248 const char* user,
244 const char* delegatee, 249 const char* delegatee,
245 const char* msg) 250 const char* msg)
246{ 251{
247 252
248 icalcomponent *reply; 253 icalcomponent *reply;
249 icalproperty *attendee; 254 icalproperty *attendee;