- CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN);
- CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE);
- CtdlRegisterMessageHook(vcard_upload_aftersave, EVT_AFTERSAVE);
- CtdlRegisterDeleteHook(vcard_delete_remove);
- CtdlRegisterProtoHook(cmd_regi, "REGI", "Enter registration info");
- CtdlRegisterProtoHook(cmd_greg, "GREG", "Get registration info");
- CtdlRegisterProtoHook(cmd_igab, "IGAB",
- "Initialize Global Address Book");
- CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
- CtdlRegisterProtoHook(cmd_gvsn, "GVSN", "Get Valid Screen Names");
- CtdlRegisterProtoHook(cmd_gvea, "GVEA", "Get Valid Email Addresses");
- CtdlRegisterProtoHook(cmd_dvca, "DVCA", "Dump VCard Addresses");
- CtdlRegisterUserHook(vcard_newuser, EVT_NEWUSER);
- CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
- CtdlRegisterNetprocHook(vcard_extract_from_network);
- CtdlRegisterSessionHook(store_harvested_addresses, EVT_TIMER);
- CtdlRegisterFixedOutputHook("text/x-vcard", vcard_fixed_output);
- CtdlRegisterFixedOutputHook("text/vcard", vcard_fixed_output);
-
- /* Create the Global ADdress Book room if necessary */
- create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0, VIEW_ADDRESSBOOK);
+ if (!threading)
+ {
+ CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN);
+ CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE);
+ CtdlRegisterMessageHook(vcard_upload_aftersave, EVT_AFTERSAVE);
+ CtdlRegisterDeleteHook(vcard_delete_remove);
+ CtdlRegisterProtoHook(cmd_regi, "REGI", "Enter registration info");
+ CtdlRegisterProtoHook(cmd_greg, "GREG", "Get registration info");
+ CtdlRegisterProtoHook(cmd_igab, "IGAB", "Initialize Global Address Book");
+ CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
+ CtdlRegisterProtoHook(cmd_gvsn, "GVSN", "Get Valid Screen Names");
+ CtdlRegisterProtoHook(cmd_gvea, "GVEA", "Get Valid Email Addresses");
+ CtdlRegisterProtoHook(cmd_dvca, "DVCA", "Dump VCard Addresses");
+ CtdlRegisterUserHook(vcard_newuser, EVT_NEWUSER);
+ CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
+ CtdlRegisterNetprocHook(vcard_extract_from_network);
+ CtdlRegisterSessionHook(store_harvested_addresses, EVT_TIMER);
+ CtdlRegisterFixedOutputHook("text/x-vcard", vcard_fixed_output);
+ CtdlRegisterFixedOutputHook("text/vcard", vcard_fixed_output);
+
+ /* Create the Global ADdress Book room if necessary */
+ CtdlCreateRoom(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0, VIEW_ADDRESSBOOK);
+
+ /* Set expiration policy to manual; otherwise objects will be lost! */
+ if (!CtdlGetRoomLock(&qr, ADDRESS_BOOK_ROOM)) {
+ qr.QRep.expire_mode = EXPIRE_MANUAL;
+ qr.QRdefaultview = VIEW_ADDRESSBOOK; /* 2 = address book view */
+ CtdlPutRoomLock(&qr);