275b4a8d04d95cc6a45634757df139f47b837916
[citadel.git] / citadel / serv_vcard.c
1 /*
2  * $Id$
3  * 
4  * A server-side module for Citadel which supports address book information
5  * using the standard vCard format.
6  * 
7  * Copyright (c) 1999-2001 / released under the GNU General Public License
8  */
9
10 /*
11  * Where we keep messages containing the vCards that source our directory.  It
12  * makes no sense to change this, because you'd have to change it on every
13  * system on the network.  That would be stupid.
14  */
15 #define ADDRESS_BOOK_ROOM       "Global Address Book"
16
17 /*
18  * Format of the "Extended ID" field of the message containing a user's
19  * vCard.  Doesn't matter what it really looks like as long as it's both
20  * unique and consistent (because we use it for replication checking to
21  * delete the old vCard network-wide when the user enters a new one).
22  */
23 #define VCARD_EXT_FORMAT        "Citadel vCard: personal card for %s at %s"
24
25
26 #include "sysdep.h"
27 #include <stdlib.h>
28 #include <unistd.h>
29 #include <stdio.h>
30 #include <fcntl.h>
31 #include <signal.h>
32 #include <pwd.h>
33 #include <errno.h>
34 #include <sys/types.h>
35
36 #if TIME_WITH_SYS_TIME
37 # include <sys/time.h>
38 # include <time.h>
39 #else
40 # if HAVE_SYS_TIME_H
41 #  include <sys/time.h>
42 # else
43 #  include <time.h>
44 # endif
45 #endif
46
47 #include <sys/wait.h>
48 #include <string.h>
49 #include <limits.h>
50 #include "citadel.h"
51 #include "server.h"
52 #include "sysdep_decls.h"
53 #include "citserver.h"
54 #include "support.h"
55 #include "config.h"
56 #include "control.h"
57 #include "dynloader.h"
58 #include "room_ops.h"
59 #include "user_ops.h"
60 #include "policy.h"
61 #include "database.h"
62 #include "msgbase.h"
63 #include "internet_addressing.h"
64 #include "tools.h"
65 #include "vcard.h"
66
67 struct vcard_internal_info {
68         long msgnum;
69 };
70
71 /* Message number symbol used internally by these functions */
72 unsigned long SYM_VCARD;
73 #define VC ((struct vcard_internal_info *)CtdlGetUserData(SYM_VCARD))
74
75
76 /*
77  * Extract Internet e-mail addresses from a message containing a vCard, and
78  * perform a callback for any found.
79  */
80 void vcard_extract_internet_addresses(struct CtdlMessage *msg,
81                                 void (*callback)(char *, char *) ) {
82         struct vCard *v;
83         char *s;
84         char *addr;
85         char citadel_address[SIZ];
86         int instance = 0;
87         int found_something = 0;
88
89         if (msg->cm_fields['A'] == NULL) return;
90         if (msg->cm_fields['N'] == NULL) return;
91         sprintf(citadel_address, "%s @ %s",
92                 msg->cm_fields['A'], msg->cm_fields['N']);
93
94         v = vcard_load(msg->cm_fields['M']);
95         if (v == NULL) return;
96
97         /* Go through the vCard searching for *all* instances of
98          * the "email;internet" key
99          */
100         do {
101                 s = vcard_get_prop(v, "email;internet", 0, instance++);
102                 if (s != NULL) {
103                         addr = strdoop(s);
104                         striplt(addr);
105                         if (strlen(addr) > 0) {
106                                 if (callback != NULL) {
107                                         callback(addr, citadel_address);
108                                 }
109                         }
110                         phree(addr);
111                         found_something = 1;
112                 }
113                 else {
114                         found_something = 0;
115                 }
116         } while(found_something);
117
118         vcard_free(v);
119 }
120
121 /*
122  * Back end function for cmd_igab()
123  */
124 void vcard_add_to_directory(long msgnum, void *data) {
125         struct CtdlMessage *msg;
126
127         msg = CtdlFetchMessage(msgnum);
128         if (msg != NULL) {
129                 vcard_extract_internet_addresses(msg, CtdlDirectoryAddUser);
130         }
131
132         CtdlFreeMessage(msg);
133 }
134
135
136 /*
137  * Initialize Global Adress Book
138  */
139 void cmd_igab(char *argbuf) {
140         char hold_rm[ROOMNAMELEN];
141
142         if (CtdlAccessCheck(ac_aide)) return;
143
144         strcpy(hold_rm, CC->quickroom.QRname);  /* save current room */
145
146         if (getroom(&CC->quickroom, ADDRESS_BOOK_ROOM) != 0) {
147                 getroom(&CC->quickroom, hold_rm);
148                 cprintf("%d cannot get address book room\n", ERROR);
149                 return;
150         }
151
152         /* Empty the existing database first.
153          */
154         CtdlDirectoryInit();
155
156         /* We want the last (and probably only) vcard in this room */
157         CtdlForEachMessage(MSGS_ALL, 0, (-127), "text/x-vcard",
158                 NULL, vcard_add_to_directory, NULL);
159
160         getroom(&CC->quickroom, hold_rm);       /* return to saved room */
161         cprintf("%d Directory has been rebuilt.\n", OK);
162 }
163
164
165
166
167 /*
168  * See if there is a valid Internet address in a vCard to use for outbound
169  * Interet messages.  If there is, stick it in CC->cs_inet_email.
170  */
171 void vcard_populate_cs_inet_email(struct vCard *v) {
172         char *s, *addr;
173         int continue_searching = 1;
174         int instance = 0;
175
176         /* 
177          * Clear whatever was in there previously.
178          */
179         if (CC->cs_inet_email != NULL) {
180                 phree(CC->cs_inet_email);
181                 CC->cs_inet_email = NULL;
182         }
183
184         /* Go through the vCard searching for *all* instances of
185          * the "email;internet" key
186          */
187         do {
188                 s = vcard_get_prop(v, "email;internet", 0, instance++);
189                 if (s != NULL) {
190                         continue_searching = 1;
191                         addr = strdoop(s);
192                         striplt(addr);
193                         if (strlen(addr) > 0) {
194                                 if (IsDirectory(addr)) {
195                                         continue_searching = 0;
196                                         CC->cs_inet_email = strdoop(addr);
197                                 }
198                         }
199                         phree(addr);
200                 }
201                 else {
202                         continue_searching = 0;
203                 }
204         } while(continue_searching);
205 }
206
207
208
209 /*
210  * This handler detects whether the user is attempting to save a new
211  * vCard as part of his/her personal configuration, and handles the replace
212  * function accordingly (delete the user's existing vCard in the config room
213  * and in the global address book).
214  */
215 int vcard_upload_beforesave(struct CtdlMessage *msg) {
216         char *ptr;
217         int linelen;
218         char config_rm[ROOMNAMELEN];
219         char buf[SIZ];
220
221         if (!CC->logged_in) return(0);  /* Only do this if logged in. */
222
223         /* If this isn't the configuration room, or if this isn't a MIME
224          * message, don't bother.  (Check for NULL room first, otherwise
225          * some messages will cause it to crash!!)
226          */
227         if (msg->cm_fields['O'] == NULL) return(0);
228         if (strcasecmp(msg->cm_fields['O'], USERCONFIGROOM)) return(0);
229         if (msg->cm_format_type != 4) return(0);
230
231         ptr = msg->cm_fields['M'];
232         if (ptr == NULL) return(0);
233         while (ptr != NULL) {
234         
235                 linelen = strcspn(ptr, "\n");
236                 if (linelen == 0) return(0);    /* end of headers */    
237                 
238                 if (!strncasecmp(ptr, "Content-type: text/x-vcard", 26)) {
239                         /* Bingo!  The user is uploading a new vCard, so
240                          * delete the old one.
241                          */
242
243                         /* Delete the user's old vCard.  This would probably
244                          * get taken care of by the replication check, but we
245                          * want to make sure there is absolutely only one
246                          * vCard in the user's config room at all times.
247                          * 
248                          * FIXME ... this needs to be tweaked to allow an admin
249                          * to make changes to another user's vCard instead of
250                          * assuming that it's always the user saving his own.
251                          */
252                         MailboxName(config_rm, &CC->usersupp, USERCONFIGROOM);
253                         CtdlDeleteMessages(config_rm, 0L, "text/x-vcard");
254
255                         /* Set the Extended-ID to a standardized one so the
256                          * replication always works correctly
257                          */
258                         if (msg->cm_fields['E'] != NULL)
259                                 phree(msg->cm_fields['E']);
260
261                         sprintf(buf, VCARD_EXT_FORMAT,
262                                 msg->cm_fields['A'], NODENAME);
263                         msg->cm_fields['E'] = strdoop(buf);
264
265                         /* Now allow the save to complete. */
266                         return(0);
267                 }
268
269                 ptr = strchr((char *)ptr, '\n');
270                 if (ptr != NULL) ++ptr;
271         }
272
273         return(0);
274 }
275
276
277
278 /*
279  * This handler detects whether the user is attempting to save a new
280  * vCard as part of his/her personal configuration, and handles the replace
281  * function accordingly (copy the vCard from the config room to the global
282  * address book).
283  */
284 int vcard_upload_aftersave(struct CtdlMessage *msg) {
285         char *ptr;
286         int linelen;
287         long I;
288         struct vCard *v;
289
290         if (!CC->logged_in) return(0);  /* Only do this if logged in. */
291
292         /* If this isn't the configuration room, or if this isn't a MIME
293          * message, don't bother.
294          */
295         if (msg->cm_fields['O'] == NULL) return(0);
296         if (strcasecmp(msg->cm_fields['O'], USERCONFIGROOM)) return(0);
297         if (msg->cm_format_type != 4) return(0);
298
299         ptr = msg->cm_fields['M'];
300         if (ptr == NULL) return(0);
301         while (ptr != NULL) {
302         
303                 linelen = strcspn(ptr, "\n");
304                 if (linelen == 0) return(0);    /* end of headers */    
305                 
306                 if (!strncasecmp(ptr, "Content-type: text/x-vcard", 26)) {
307                         /* Bingo!  The user is uploading a new vCard, so
308                          * copy it to the Global Address Book room.
309                          */
310
311                         I = atol(msg->cm_fields['I']);
312                         if (I < 0L) return(0);
313
314                         /* Put it in the Global Address Book room... */
315                         CtdlSaveMsgPointerInRoom(ADDRESS_BOOK_ROOM, I,
316                                 (SM_VERIFY_GOODNESS | SM_DO_REPL_CHECK) );
317
318                         /* ...and also in the directory database. */
319                         vcard_add_to_directory(I, NULL);
320
321                         /* Store our Internet return address in memory */
322                         v = vcard_load(msg->cm_fields['M']);
323                         vcard_populate_cs_inet_email(v);
324                         vcard_free(v);
325
326                         return(0);
327                 }
328
329                 ptr = strchr((char *)ptr, '\n');
330                 if (ptr != NULL) ++ptr;
331         }
332
333         return(0);
334 }
335
336
337
338 /*
339  * back end function used for callbacks
340  */
341 void vcard_gu_backend(long msgnum, void *userdata) {
342         VC->msgnum = msgnum;
343 }
344
345
346 /*
347  * If this user has a vcard on disk, read it into memory, otherwise allocate
348  * and return an empty vCard.
349  */
350 struct vCard *vcard_get_user(struct usersupp *u) {
351         char hold_rm[ROOMNAMELEN];
352         char config_rm[ROOMNAMELEN];
353         struct CtdlMessage *msg;
354         struct vCard *v;
355
356         strcpy(hold_rm, CC->quickroom.QRname);  /* save current room */
357         MailboxName(config_rm, u, USERCONFIGROOM);
358
359         if (getroom(&CC->quickroom, config_rm) != 0) {
360                 getroom(&CC->quickroom, hold_rm);
361                 return vcard_new();
362         }
363
364         /* We want the last (and probably only) vcard in this room */
365         VC->msgnum = (-1);
366         CtdlForEachMessage(MSGS_LAST, 1, (-127), "text/x-vcard",
367                 NULL, vcard_gu_backend, NULL);
368         getroom(&CC->quickroom, hold_rm);       /* return to saved room */
369
370         if (VC->msgnum < 0L) return vcard_new();
371
372         msg = CtdlFetchMessage(VC->msgnum);
373         if (msg == NULL) return vcard_new();
374
375         v = vcard_load(msg->cm_fields['M']);
376         CtdlFreeMessage(msg);
377         return v;
378 }
379
380
381 /*
382  * Store this user's vCard in the appropriate place
383  */
384 /*
385  * Write our config to disk
386  */
387 void vcard_write_user(struct usersupp *u, struct vCard *v) {
388         char temp[PATH_MAX];
389         FILE *fp;
390         char *ser;
391
392         strcpy(temp, tmpnam(NULL));
393         ser = vcard_serialize(v);
394
395         fp = fopen(temp, "w");
396         if (fp == NULL) return;
397         if (ser == NULL) {
398                 fprintf(fp, "begin:vcard\r\nend:vcard\r\n");
399         } else {
400                 fwrite(ser, strlen(ser), 1, fp);
401                 phree(ser);
402         }
403         fclose(fp);
404
405         /* This handy API function does all the work for us.
406          * NOTE: normally we would want to set that last argument to 1, to
407          * force the system to delete the user's old vCard.  But it doesn't
408          * have to, because the vcard_upload_beforesave() hook above
409          * is going to notice what we're trying to do, and delete the old vCard.
410          */
411         CtdlWriteObject(USERCONFIGROOM, /* which room */
412                         "text/x-vcard", /* MIME type */
413                         temp,           /* temp file */
414                         u,              /* which user */
415                         0,              /* not binary */
416                         0,              /* don't delete others of this type */
417                         0);             /* no flags */
418
419         unlink(temp);
420 }
421
422
423
424 /*
425  * Old style "enter registration info" command.  This function simply honors
426  * the REGI protocol command, translates the entered parameters into a vCard,
427  * and enters the vCard into the user's configuration.
428  */
429 void cmd_regi(char *argbuf) {
430         int a,b,c;
431         char buf[SIZ];
432         struct vCard *my_vcard;
433
434         char tmpaddr[SIZ];
435         char tmpcity[SIZ];
436         char tmpstate[SIZ];
437         char tmpzip[SIZ];
438         char tmpaddress[SIZ];
439         char tmpcountry[SIZ];
440
441         if (!(CC->logged_in)) {
442                 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
443                 return;
444         }
445
446         my_vcard = vcard_get_user(&CC->usersupp);
447         strcpy(tmpaddr, "");
448         strcpy(tmpcity, "");
449         strcpy(tmpstate, "");
450         strcpy(tmpzip, "");
451         strcpy(tmpcountry, "USA");
452
453         cprintf("%d Send registration...\n", SEND_LISTING);
454         a=0;
455         while (client_gets(buf), strcmp(buf,"000")) {
456                 if (a==0) vcard_set_prop(my_vcard, "n", buf, 0);
457                 if (a==1) strcpy(tmpaddr, buf);
458                 if (a==2) strcpy(tmpcity, buf);
459                 if (a==3) strcpy(tmpstate, buf);
460                 if (a==4) {
461                         for (c=0; c<strlen(buf); ++c) {
462                                 if ((buf[c]>='0') && (buf[c]<='9')) {
463                                         b = strlen(tmpzip);
464                                         tmpzip[b] = buf[c];
465                                         tmpzip[b+1] = 0;
466                                 }
467                         }
468                 }
469                 if (a==5) vcard_set_prop(my_vcard, "tel;home", buf, 0);
470                 if (a==6) vcard_set_prop(my_vcard, "email;internet", buf, 0);
471                 if (a==7) strcpy(tmpcountry, buf);
472                 ++a;
473         }
474
475         sprintf(tmpaddress, ";;%s;%s;%s;%s;%s",
476                 tmpaddr, tmpcity, tmpstate, tmpzip, tmpcountry);
477         vcard_set_prop(my_vcard, "adr", tmpaddress, 0);
478         vcard_write_user(&CC->usersupp, my_vcard);
479         vcard_free(my_vcard);
480
481         lgetuser(&CC->usersupp, CC->curr_user);
482         CC->usersupp.flags=(CC->usersupp.flags|US_REGIS|US_NEEDVALID);
483         lputuser(&CC->usersupp);
484
485         /* set global flag calling for validation */
486         begin_critical_section(S_CONTROL);
487         get_control();
488         CitControl.MMflags = CitControl.MMflags | MM_VALID ;
489         put_control();
490         end_critical_section(S_CONTROL);
491 }
492
493
494
495 /*
496  * Protocol command to fetch registration info for a user
497  */
498 void cmd_greg(char *argbuf)
499 {
500         struct usersupp usbuf;
501         struct vCard *v;
502         char *s;
503         char who[SIZ];
504         char adr[SIZ];
505         char buf[SIZ];
506
507         extract(who, argbuf, 0);
508
509         if (!(CC->logged_in)) {
510                 cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
511                 return;
512         }
513
514         if (!strcasecmp(who,"_SELF_")) strcpy(who,CC->curr_user);
515
516         if ((CC->usersupp.axlevel < 6) && (strcasecmp(who,CC->curr_user))) {
517                 cprintf("%d Higher access required.\n",
518                         ERROR+HIGHER_ACCESS_REQUIRED);
519                 return;
520         }
521
522         if (getuser(&usbuf, who) != 0) {
523                 cprintf("%d '%s' not found.\n", ERROR+NO_SUCH_USER, who);
524                 return;
525         }
526
527         v = vcard_get_user(&usbuf);
528
529         cprintf("%d %s\n", LISTING_FOLLOWS, usbuf.fullname);
530         cprintf("%ld\n", usbuf.usernum);
531         cprintf("%s\n", usbuf.password);
532         s = vcard_get_prop(v, "n", 0, 0);
533         cprintf("%s\n", s ? s : " ");   /* name */
534
535         s = vcard_get_prop(v, "adr", 0, 0);
536         sprintf(adr, "%s", s ? s : " ");/* address... */
537
538         extract_token(buf, adr, 2, ';');
539         cprintf("%s\n", buf);                           /* street */
540         extract_token(buf, adr, 3, ';');
541         cprintf("%s\n", buf);                           /* city */
542         extract_token(buf, adr, 4, ';');
543         cprintf("%s\n", buf);                           /* state */
544         extract_token(buf, adr, 5, ';');
545         cprintf("%s\n", buf);                           /* zip */
546
547         s = vcard_get_prop(v, "tel;home", 0, 0);
548         if (s == NULL) s = vcard_get_prop(v, "tel", 1, 0);
549         if (s != NULL) {
550                 cprintf("%s\n", s);
551         }
552         else {
553                 cprintf(" \n");
554         }
555
556         cprintf("%d\n", usbuf.axlevel);
557
558         s = vcard_get_prop(v, "email;internet", 0, 0);
559         cprintf("%s\n", s ? s : " ");
560         s = vcard_get_prop(v, "adr", 0, 0);
561         sprintf(adr, "%s", s ? s : " ");/* address... */
562
563         extract_token(buf, adr, 6, ';');
564         cprintf("%s\n", buf);                           /* country */
565         cprintf("000\n");
566 }
567
568
569 /*
570  * When a user is being deleted, we have to remove his/her vCard.
571  * This is accomplished by issuing a message with 'CANCEL' in the S (special)
572  * field, and the same Extended ID as the existing card.
573  */
574 void vcard_purge(char *username, long usernum) {
575         struct CtdlMessage *msg;
576         char buf[SIZ];
577
578         msg = (struct CtdlMessage *) mallok(sizeof(struct CtdlMessage));
579         if (msg == NULL) return;
580         memset(msg, 0, sizeof(struct CtdlMessage));
581
582         msg->cm_magic = CTDLMESSAGE_MAGIC;
583         msg->cm_anon_type = MES_NORMAL;
584         msg->cm_format_type = 0;
585         msg->cm_fields['A'] = strdoop(username);
586         msg->cm_fields['O'] = strdoop(ADDRESS_BOOK_ROOM);
587         msg->cm_fields['N'] = strdoop(NODENAME);
588         msg->cm_fields['M'] = strdoop("Purge this vCard\n");
589
590         sprintf(buf, VCARD_EXT_FORMAT, msg->cm_fields['A'], NODENAME);
591         msg->cm_fields['E'] = strdoop(buf);
592
593         msg->cm_fields['S'] = strdoop("CANCEL");
594
595         CtdlSubmitMsg(msg, NULL, ADDRESS_BOOK_ROOM);
596         CtdlFreeMessage(msg);
597 }
598
599
600 /*
601  * Grab vCard directory stuff out of incoming network messages
602  */
603 int vcard_extract_from_network(struct CtdlMessage *msg, char *target_room) {
604         char *ptr;
605         int linelen;
606
607         if (msg == NULL) return(0);
608
609         if (strcasecmp(target_room, ADDRESS_BOOK_ROOM)) {
610                 return(0);
611         }
612
613         if (msg->cm_format_type != 4) return(0);
614
615         ptr = msg->cm_fields['M'];
616         if (ptr == NULL) return(0);
617         while (ptr != NULL) {
618         
619                 linelen = strcspn(ptr, "\n");
620                 if (linelen == 0) return(0);    /* end of headers */    
621                 
622                 if (!strncasecmp(ptr, "Content-type: text/x-vcard", 26)) {
623                          /* It's a vCard.  Add it to the directory. */
624                         vcard_extract_internet_addresses(msg,
625                                                         CtdlDirectoryAddUser);
626                         return(0);
627                 }
628
629                 ptr = strchr((char *)ptr, '\n');
630                 if (ptr != NULL) ++ptr;
631         }
632
633         return(0);
634 }
635
636
637
638 /* 
639  * When a vCard is being removed from the Global Address Book room, remove it
640  * from the directory as well.
641  */
642 void vcard_delete_remove(char *room, long msgnum) {
643         struct CtdlMessage *msg;
644
645         if (msgnum <= 0L) return;
646
647         if (strcasecmp(room, ADDRESS_BOOK_ROOM)) {
648                 return;
649         }
650
651         msg = CtdlFetchMessage(msgnum);
652         if (msg != NULL) {
653                 vcard_extract_internet_addresses(msg, CtdlDirectoryDelUser);
654         }
655
656         CtdlFreeMessage(msg);
657 }
658
659
660 /*
661  * Query Directory
662  */
663 void cmd_qdir(char *argbuf) {
664         char citadel_addr[SIZ];
665         char internet_addr[SIZ];
666
667         if (CtdlAccessCheck(ac_logged_in)) return;
668
669         extract(internet_addr, argbuf, 0);
670
671         if (CtdlDirectoryLookup(citadel_addr, internet_addr) != 0) {
672                 cprintf("%d %s was not found.\n",
673                         ERROR+NO_SUCH_USER, internet_addr);
674                 return;
675         }
676
677         cprintf("%d %s\n", OK, citadel_addr);
678 }
679
680
681
682
683 /*
684  * Session startup, allocate some per-session data
685  */
686 void vcard_session_startup_hook(void) {
687         CtdlAllocUserData(SYM_VCARD, sizeof(struct vcard_internal_info));
688 }
689
690
691 /*
692  * When a user logs in...
693  */
694 void vcard_session_login_hook(void) {
695         struct vCard *v;
696
697         v = vcard_get_user(&CC->usersupp);
698         vcard_populate_cs_inet_email(v);
699
700         vcard_free(v);
701 }
702
703
704 /*
705  * When a user logs out...
706  */
707 void vcard_session_logout_hook(void) {
708         if (CC->cs_inet_email != NULL) {
709                 phree(CC->cs_inet_email);
710                 CC->cs_inet_email = NULL;
711         }
712 }
713
714
715 char *Dynamic_Module_Init(void)
716 {
717         SYM_VCARD = CtdlGetDynamicSymbol();
718         CtdlRegisterSessionHook(vcard_session_startup_hook, EVT_START);
719         CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN);
720         CtdlRegisterSessionHook(vcard_session_logout_hook, EVT_LOGOUT);
721         CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE);
722         CtdlRegisterMessageHook(vcard_upload_aftersave, EVT_AFTERSAVE);
723         CtdlRegisterDeleteHook(vcard_delete_remove);
724         CtdlRegisterProtoHook(cmd_regi, "REGI", "Enter registration info");
725         CtdlRegisterProtoHook(cmd_greg, "GREG", "Get registration info");
726         CtdlRegisterProtoHook(cmd_igab, "IGAB",
727                                         "Initialize Global Address Book");
728         CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
729         CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
730         CtdlRegisterNetprocHook(vcard_extract_from_network);
731         create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1);
732         return "$Id$";
733 }