From e270ff3f2f57197a892b1c0db10f2367687c99b1 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 6 Feb 2012 00:46:07 +0100 Subject: [PATCH] QUEUE-Rooms: give it an own view. - give the STMP and the FNBWL room the view type QUEUE - don't schedule QUEUE - rooms for networking - migrate current rooms on upgrade - create them with the QUEUE view. --- citadel/modules/extnotify/extnotify_main.c | 2 +- citadel/modules/network/serv_network.c | 2 ++ citadel/modules/smtp/serv_smtpqueue.c | 2 +- citadel/modules/upgrade/serv_upgrade.c | 16 ++++++++++++++++ libcitadel/lib/libcitadel.h | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 51e4e13e5..8d99f6f1c 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -451,7 +451,7 @@ void do_extnotify_queue(void) void create_extnotify_queue(void) { struct ctdlroom qrbuf; - CtdlCreateRoom(FNBL_QUEUE_ROOM, 3, "", 0, 1, 0, VIEW_MAILBOX); + CtdlCreateRoom(FNBL_QUEUE_ROOM, 3, "", 0, 1, 0, VIEW_QUEUE); CtdlFillSystemContext(&extnotify_queue_CC, "Extnotify"); diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index ba87cca5e..b32535ccb 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -327,6 +327,8 @@ void network_queue_room(struct ctdlroom *qrbuf, void *data) { int i; struct RoomProcList *ptr; + if (qrbuf->QRdefaultview == VIEW_QUEUE) + return; ptr = (struct RoomProcList *) malloc(sizeof (struct RoomProcList)); if (ptr == NULL) return; diff --git a/citadel/modules/smtp/serv_smtpqueue.c b/citadel/modules/smtp/serv_smtpqueue.c index 72e5bc231..485395044 100644 --- a/citadel/modules/smtp/serv_smtpqueue.c +++ b/citadel/modules/smtp/serv_smtpqueue.c @@ -904,7 +904,7 @@ void smtp_init_spoolout(void) { * Create the room. This will silently fail if the room already * exists, and that's perfectly ok, because we want it to exist. */ - CtdlCreateRoom(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0, VIEW_MAILBOX); + CtdlCreateRoom(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0, VIEW_QUEUE); /* * Make sure it's set to be a "system room" so it doesn't show up diff --git a/citadel/modules/upgrade/serv_upgrade.c b/citadel/modules/upgrade/serv_upgrade.c index ebd48a213..e4a527869 100644 --- a/citadel/modules/upgrade/serv_upgrade.c +++ b/citadel/modules/upgrade/serv_upgrade.c @@ -291,6 +291,10 @@ void update_config(void) { config.c_xmpp_s2s_port = 5269; } + if (CitControl.version < 725) { + + + } if (IsEmptyStr(config.c_default_cal_zone)) { guess_time_zone(); } @@ -345,6 +349,18 @@ void check_server_upgrades(void) { if (CitControl.version < 790) { remove_thread_users(); } + if (CitControl.version < 810) { + struct ctdlroom QRoom; + if (!CtdlGetRoom(&QRoom, SMTP_SPOOLOUT_ROOM)) { + QRoom.QRdefaultview = VIEW_QUEUE; + CtdlPutRoom(&QRoom); + } + if (!CtdlGetRoom(&QRoom, FNBL_QUEUE_ROOM)) { + QRoom.QRdefaultview = VIEW_QUEUE; + CtdlPutRoom(&QRoom); + } + } + CitControl.version = REV_LEVEL; /* diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index d28e76621..7f3da262d 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -98,6 +98,7 @@ typedef enum _room_views { VIEW_JOURNAL = 8, /* Journal view */ VIEW_DRAFTS = 9, /* Drafts view */ VIEW_BLOG = 10, /* Blog view */ + VIEW_QUEUE = 11, /* SMTP/... QUEUE rooms */ VIEW_MAX } ROOM_VIEWS; -- 2.30.2