Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OF-2760: Adds option to retire a MUC room name on deletion #2630

Merged
merged 14 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion distribution/src/database/openfire_db2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ CREATE TABLE ofMucRoom (
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
preserveHistOnDel INTEGER NOT NULL,
retireOnDeletion INTEGER NOT NULL,
subject VARCHAR(100),
rolesToBroadcast INTEGER NOT NULL,
useReservedNick INTEGER NOT NULL,
Expand All @@ -234,6 +235,14 @@ CREATE TABLE ofMucRoomProp (
CONSTRAINT ofMucRoomProp_pk PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucRoomRetiree (
serviceID INTEGER NOT NULL,
name VARCHAR(50) NOT NULL,
guusdk marked this conversation as resolved.
Show resolved Hide resolved
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

CREATE TABLE ofMucAffiliation (
roomID INTEGER NOT NULL,
Expand Down Expand Up @@ -393,7 +402,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_hsqldb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ CREATE TABLE ofMucRoom (
roomPassword VARCHAR(50) NULL,
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
retireOnDeletion INTEGER NOT NULL,
preserveHistOnDel INTEGER NOT NULL,
subject VARCHAR(100) NULL,
rolesToBroadcast INTEGER NOT NULL,
Expand All @@ -229,6 +230,15 @@ CREATE TABLE ofMucRoomProp (
CONSTRAINT ofMucRoomProp_pk PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucRoomRetiree (
serviceID BIGINT NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

CREATE TABLE ofMucAffiliation (
roomID BIGINT NOT NULL,
jid VARCHAR(1024) NOT NULL,
Expand Down Expand Up @@ -379,7 +389,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36);

// Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ CREATE TABLE ofMucRoom (
roomPassword VARCHAR(50) NULL,
canDiscoverJID TINYINT NOT NULL,
logEnabled TINYINT NOT NULL,
retireOnDeletion TINYINT NOT NULL,
preserveHistOnDel TINYINT NOT NULL,
subject VARCHAR(100) NULL,
rolesToBroadcast TINYINT NOT NULL,
Expand All @@ -219,6 +220,15 @@ CREATE TABLE ofMucRoomProp (
PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucRoomRetiree (
serviceID BIGINT NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (serviceID,name)
);

CREATE TABLE ofMucAffiliation (
roomID BIGINT NOT NULL,
jid TEXT NOT NULL,
Expand Down Expand Up @@ -369,7 +379,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36);

# Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ CREATE TABLE ofMucRoom(
roomPassword VARCHAR2(50) NULL,
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
retireOnDeletion INTEGER NOT NULL,
preserveHistOnDel INTEGER NOT NULL,
subject VARCHAR2(100) NULL,
rolesToBroadcast INTEGER NOT NULL,
Expand All @@ -226,6 +227,15 @@ CREATE TABLE ofMucRoomProp (
CONSTRAINT ofMucRoomProp_pk PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucRoomRetiree(
serviceID INT NOT NULL,
name VARCHAR2(50) NOT NULL,
alternateJID VARCHAR2(2000),
reason VARCHAR2(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

CREATE TABLE ofMucAffiliation (
roomID INT NOT NULL,
jid VARCHAR2(1024) NOT NULL,
Expand Down Expand Up @@ -377,7 +387,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ CREATE TABLE ofMucRoom (
roomPassword VARCHAR(50) NULL,
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
retireOnDeletion INTEGER NOT NULL,
preserveHistOnDel INTEGER NOT NULL,
subject VARCHAR(100) NULL,
rolesToBroadcast INTEGER NOT NULL,
Expand All @@ -234,6 +235,15 @@ CREATE TABLE ofMucRoomProp (
CONSTRAINT ofMucRoomProp_pk PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucRoomRetiree (
serviceID INTEGER NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

CREATE TABLE ofMucAffiliation (
roomID INTEGER NOT NULL,
jid VARCHAR(1024) NOT NULL,
Expand Down Expand Up @@ -385,7 +395,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_sqlserver.sql
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ CREATE TABLE ofMucRoom (
roomPassword NVARCHAR(50) NULL,
canDiscoverJID INT NOT NULL,
logEnabled INT NOT NULL,
retireOnDeletion INT NOT NULL,
preserveHistOnDel INT NOT NULL,
subject NVARCHAR(100) NULL,
rolesToBroadcast INT NOT NULL,
Expand All @@ -232,6 +233,15 @@ CREATE TABLE ofMucRoomProp (
CONSTRAINT ofMucRoomProp_pk PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucRoomRetiree (
serviceID INT NOT NULL,
name NVARCHAR(50) NOT NULL,
alternateJID NVARCHAR(2000),
reason NVARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

CREATE TABLE ofMucAffiliation (
roomID INT NOT NULL,
jid NVARCHAR(424) NOT NULL,
Expand Down Expand Up @@ -382,7 +392,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36);

/* Entry for admin user */
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_sybase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ CREATE TABLE ofMucRoom (
roomPassword NVARCHAR(50) NULL,
canDiscoverJID INT NOT NULL,
logEnabled INT NOT NULL,
retireOnDeletion INT NOT NULL,
preserveHistOnDel INT NOT NULL,
subject NVARCHAR(100) NULL,
rolesToBroadcast INT NOT NULL,
Expand All @@ -231,6 +232,15 @@ CREATE TABLE ofMucRoomProp (
CONSTRAINT ofMucRoomProp_pk PRIMARY KEY (roomID, name)
)

CREATE TABLE ofMucRoomRetiree (
serviceID INT NOT NULL,
name NVARCHAR(50) NOT NULL,
alternateJID NVARCHAR(2000),
reason NVARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
)

CREATE TABLE ofMucAffiliation (
roomID INT NOT NULL,
jid VARCHAR(255) NOT NULL,
Expand Down Expand Up @@ -382,7 +392,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1)
INSERT INTO ofID (idType, id) VALUES (26, 2)
INSERT INTO ofID (idType, id) VALUES (27, 1)

INSERT INTO ofVersion (name, version) VALUES ('openfire', 35)
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36)

/* Entry for admin user */
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_db2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD COLUMN retireOnDeletion INTEGER DEFAULT 0 NOT NULL;

CREATE TABLE ofMucRoomRetiree (
serviceID INTEGER NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_hsqldb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD COLUMN retireOnDeletion INTEGER DEFAULT 0 NOT NULL;

CREATE TABLE ofMucRoomRetiree (
serviceID BIGINT NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD COLUMN retireOnDeletion TINYINT NOT NULL DEFAULT 0;

CREATE TABLE ofMucRoomRetiree (
serviceID BIGINT NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (serviceID,name)
);

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_oracle.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD retireOnDeletion INTEGER DEFAULT 0 NOT NULL;

CREATE TABLE ofMucRoomRetiree(
serviceID INT NOT NULL,
name VARCHAR2(50) NOT NULL,
alternateJID VARCHAR2(2000),
reason VARCHAR2(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_postgresql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD COLUMN retireOnDeletion INTEGER DEFAULT 0 NOT NULL;

CREATE TABLE ofMucRoomRetiree (
serviceID INTEGER NOT NULL,
name VARCHAR(50) NOT NULL,
alternateJID VARCHAR(2000),
reason VARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_sqlserver.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD retireOnDeletion INT DEFAULT 0 NOT NULL;

CREATE TABLE ofMucRoomRetiree (
serviceID INT NOT NULL,
name NVARCHAR(50) NOT NULL,
alternateJID NVARCHAR(2000),
reason NVARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
);

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/36/openfire_sybase.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE ofMucRoom ADD retireOnDeletion INT DEFAULT 0 NOT NULL;

CREATE TABLE ofMucRoomRetiree (
serviceID INT NOT NULL,
name NVARCHAR(50) NOT NULL,
alternateJID NVARCHAR(2000),
reason NVARCHAR(1024),
retiredAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT ofMucRoomRetiree_pk PRIMARY KEY (serviceID, name)
)

UPDATE ofVersion SET version = 36 WHERE name = 'openfire';
52 changes: 52 additions & 0 deletions documentation/database-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ <h2>Database Tables</h2>
<li><a href="#ofMucRoom">ofMucRoom</a></li>

<li><a href="#ofMucRoomProp">ofMucRoomProp</a></li>
<li><a href="#ofMucRoomRetiree">ofMucRoomRetiree</a></li>
<li><a href="#ofMucAffiliation">ofMucAffiliation</a></li>
<li><a href="#ofMucMember">ofMucMember</a></li>
<li><a href="#ofMucConversationLog">ofMucConversationLog</a></li>
Expand Down Expand Up @@ -983,6 +984,12 @@ <h2>Database Tables</h2>
<td>n/a</td>
<td>Flag indicating whether room conversations are logged or not</td>
</tr>
<tr>
<td>retireOnDeletion</td>
<td>NUMBER</td>
<td>n/a</td>
<td>Flag indicating whether room name should be retired on deletion (prevented from future use)</td>
</tr>
<tr>
<td>subject</td>
<td>VARCHAR</td>
Expand Down Expand Up @@ -1050,6 +1057,51 @@ <h2>Database Tables</h2>
</table>
&nbsp;<a href="#top" class="top">top of page</a>

<table id="ofMucRoomRetiree" class="dbtable">
<tbody>
<tr>
<th colspan="4">ofMucRoomRetiree (Retired Groupchat room names)</th>
</tr>
<tr>
<th>Column Name</th>
<th>Type</th>
<th>Length</th>
<th>Description</th>
</tr>
<tr class="primary-key">
<td>serviceID</td>
<td>NUMBER</td>
<td>n/a</td>
<td>ID of associated MUC service (Primary Key)</td>
</tr>
<tr class="primary-key">
<td>name</td>
<td>VARCHAR</td>
<td>50</td>
<td>Name of the retired room (Primary Key)</td>
</tr>
<tr>
<td>alternateJID</td>
<td>VARCHAR</td>
<td>2000</td>
<td>Optional JID specified on room deletion</td>
</tr>
<tr>
<td>reason</td>
<td>VARCHAR</td>
<td>1024</td>
<td>Optional text explaining why the room was retired</td>
</tr>
<tr>
<td>retiredAt</td>
<td>TIMESTAMP</td>
<td>n/a</td>
<td>When the room was retired (defaults to current timestamp)</td>
</tr>
</tbody>
</table>
&nbsp;<a href="#top" class="top">top of page</a>

<table id="ofMucAffiliation" class="dbtable">
<tbody>
<tr>
Expand Down
Loading
Loading