summaryrefslogtreecommitdiffabout
path: root/gammu
authorzautrix <zautrix>2004-10-15 14:26:07 (UTC)
committer zautrix <zautrix>2004-10-15 14:26:07 (UTC)
commit4f276d80bd977401d656851515474cc00c661e5b (patch) (unidiff)
tree0d3a747bef0431ef791b69876f5bda554f9ca83f /gammu
parentc2fb960297c4b08980921c818a4d347057732390 (diff)
downloadkdepimpi-4f276d80bd977401d656851515474cc00c661e5b.zip
kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.gz
kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.bz2
many phone and sync fixes
Diffstat (limited to 'gammu') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmcal.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gammu/emb/common/service/gsmcal.c b/gammu/emb/common/service/gsmcal.c
index 0375fee..7310755 100644
--- a/gammu/emb/common/service/gsmcal.c
+++ b/gammu/emb/common/service/gsmcal.c
@@ -111,7 +111,7 @@ GSM_Error GSM_EncodeVCALENDAR(char *Buffer, int *Length, GSM_CalendarEntry *note
111 *Length+=sprintf(Buffer+(*Length), "Phone Call%c%c",13,10); 111 *Length+=sprintf(Buffer+(*Length), "Phone Call%c%c",13,10);
112 break; 112 break;
113 case GSM_CAL_BIRTHDAY: 113 case GSM_CAL_BIRTHDAY:
114 *Length+=sprintf(Buffer+(*Length), "Special Occasion%c%c",13,10); 114 *Length+=sprintf(Buffer+(*Length), "Birthday%c%c",13,10);
115 break; 115 break;
116 case GSM_CAL_MEETING: 116 case GSM_CAL_MEETING:
117 default: 117 default:
@@ -150,12 +150,12 @@ GSM_Error GSM_EncodeVCALENDAR(char *Buffer, int *Length, GSM_CalendarEntry *note
150 } 150 }
151 151
152 /* Birthday is known to be recurranced */ 152 /* Birthday is known to be recurranced */
153 if (Recurrance != -1 && note->Type != GSM_CAL_BIRTHDAY) { 153 if (Recurrance != -1 ) {
154 switch(note->Entries[Recurrance].Number/24) { 154 switch(note->Entries[Recurrance].Number/24) {
155 case 1 : *Length+=sprintf(Buffer+(*Length), "RRULE:D1 #0%c%c",13,10); break; 155 case 1 : *Length+=sprintf(Buffer+(*Length), "RRULE:D1 #0%c%c",13,10); break;
156 case 7 : *Length+=sprintf(Buffer+(*Length), "RRULE:W1 #0%c%c",13,10); break; 156 case 7 : *Length+=sprintf(Buffer+(*Length), "RRULE:W1 #0%c%c",13,10); break;
157 case 14 : *Length+=sprintf(Buffer+(*Length), "RRULE:W2 #0%c%c",13,10); break; 157 case 14 : *Length+=sprintf(Buffer+(*Length), "RRULE:W2 #0%c%c",13,10); break;
158 case 365 : *Length+=sprintf(Buffer+(*Length), "RRULE:YD1 #0%c%c",13,10); break; 158 case 365 : *Length+=sprintf(Buffer+(*Length), "RRULE:YM1 #0%c%c",13,10); break;
159 } 159 }
160 } 160 }
161 } else if (Version == Siemens_VCalendar) { 161 } else if (Version == Siemens_VCalendar) {
@@ -168,7 +168,7 @@ GSM_Error GSM_EncodeVCALENDAR(char *Buffer, int *Length, GSM_CalendarEntry *note
168 *Length+=sprintf(Buffer+(*Length), "Phone Call%c%c",13,10); 168 *Length+=sprintf(Buffer+(*Length), "Phone Call%c%c",13,10);
169 break; 169 break;
170 case GSM_CAL_BIRTHDAY: 170 case GSM_CAL_BIRTHDAY:
171 *Length+=sprintf(Buffer+(*Length), "Anniversary%c%c",13,10); 171 *Length+=sprintf(Buffer+(*Length), "Birthday%c%c",13,10);
172 break; 172 break;
173 case GSM_CAL_MEMO: 173 case GSM_CAL_MEMO:
174 default: 174 default:
@@ -188,7 +188,7 @@ GSM_Error GSM_EncodeVCALENDAR(char *Buffer, int *Length, GSM_CalendarEntry *note
188 case 1 : *Length+=sprintf(Buffer+(*Length), "RRULE:D1%c%c",13,10);break; 188 case 1 : *Length+=sprintf(Buffer+(*Length), "RRULE:D1%c%c",13,10);break;
189 case 7 : *Length+=sprintf(Buffer+(*Length), "RRULE:D7%c%c",13,10);break; 189 case 7 : *Length+=sprintf(Buffer+(*Length), "RRULE:D7%c%c",13,10);break;
190 case 30 : *Length+=sprintf(Buffer+(*Length), "RRULE:MD1%c%c",13,10);break; 190 case 30 : *Length+=sprintf(Buffer+(*Length), "RRULE:MD1%c%c",13,10);break;
191 case 365 : *Length+=sprintf(Buffer+(*Length), "RRULE:YD1%c%c",13,10);break; 191 case 365 : *Length+=sprintf(Buffer+(*Length), "RRULE:YM1%c%c",13,10);break;
192 } 192 }
193 } 193 }
194 194
@@ -220,7 +220,7 @@ GSM_Error GSM_EncodeVCALENDAR(char *Buffer, int *Length, GSM_CalendarEntry *note
220 *Length+=sprintf(Buffer+(*Length), "Vacation%c%c",13,10); 220 *Length+=sprintf(Buffer+(*Length), "Vacation%c%c",13,10);
221 break; 221 break;
222 case GSM_CAL_BIRTHDAY: 222 case GSM_CAL_BIRTHDAY:
223 *Length+=sprintf(Buffer+(*Length), "Anninversary%c%c",13,10); 223 *Length+=sprintf(Buffer+(*Length), "Birthday%c%c",13,10);
224 break; 224 break;
225 case GSM_CAL_MEMO: 225 case GSM_CAL_MEMO:
226 default: 226 default:
@@ -390,8 +390,8 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
390 if (strstr(Line,"CATEGORIES:Vacation")) Calendar->Type = GSM_CAL_VACATION;//SE 390 if (strstr(Line,"CATEGORIES:Vacation")) Calendar->Type = GSM_CAL_VACATION;//SE
391 if (strstr(Line,"CATEGORIES:Miscellaneous")) Calendar->Type = GSM_CAL_MEMO; 391 if (strstr(Line,"CATEGORIES:Miscellaneous")) Calendar->Type = GSM_CAL_MEMO;
392 if (strstr(Line,"CATEGORIES:Phone Call")) Calendar->Type = GSM_CAL_CALL; 392 if (strstr(Line,"CATEGORIES:Phone Call")) Calendar->Type = GSM_CAL_CALL;
393 if (strstr(Line,"CATEGORIES:Special Occasion")) Calendar->Type = GSM_CAL_BIRTHDAY;
394 if (strstr(Line,"CATEGORIES:Anniversary")) Calendar->Type = GSM_CAL_BIRTHDAY; 393 if (strstr(Line,"CATEGORIES:Anniversary")) Calendar->Type = GSM_CAL_BIRTHDAY;
394 if (strstr(Line,"CATEGORIES:Birthday")) Calendar->Type = GSM_CAL_BIRTHDAY;
395 if (strstr(Line,"CATEGORIES:Meeting")) Calendar->Type = GSM_CAL_MEETING; 395 if (strstr(Line,"CATEGORIES:Meeting")) Calendar->Type = GSM_CAL_MEETING;
396 if (strstr(Line,"CATEGORIES:Appointment")) Calendar->Type = GSM_CAL_MEETING; 396 if (strstr(Line,"CATEGORIES:Appointment")) Calendar->Type = GSM_CAL_MEETING;
397 if (strstr(Line,"RRULE:D1")) { 397 if (strstr(Line,"RRULE:D1")) {
@@ -420,6 +420,12 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
420 Calendar->EntriesNum++; 420 Calendar->EntriesNum++;
421 } 421 }
422 // LR 422 // LR
423 if (strstr(Line,"RRULE:YM1")) {
424 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_RECURRANCE;
425 Calendar->Entries[Calendar->EntriesNum].Number = 365*24;
426 Calendar->EntriesNum++;
427 }
428 // LR
423 if ((ReadVCALText(Line, "SUMMARY", Buff)) ) { 429 if ((ReadVCALText(Line, "SUMMARY", Buff)) ) {
424 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_TEXT; 430 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_TEXT;
425 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff); 431 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff);