-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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-2954: New feature: Spam Reporting #2661
base: main
Are you sure you want to change the base?
Changes from all commits
9b82d8e
a4c4798
83fb015
70fd67c
729ec91
91726c9
8ec5fa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,15 +371,36 @@ CREATE TABLE ofPubsubDefaultConf ( | |
PRIMARY KEY (serviceID, leaf) | ||
); | ||
|
||
CREATE TABLE ofSpamReport ( | ||
reportID BIGINT NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we may use timestamp There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good idea, but not for now: We've had trouble before finding a consistent way to represent a timestamp in all of the databases that we support, which is why we use a number instead. I'm not sure if this is still as impossible as it was in 2004, by the way, but I'd like Openfire to be consistent. If we do change number for timestamp (which would be a good thing), we should do it for all columns that currently use a number. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also see the remark at the top of https://download.igniterealtime.org/openfire/docs/latest/documentation/database-guide.html which describes this. |
||
context TEXT NULL, | ||
PRIMARY KEY (reportID), | ||
INDEX ofSpamReport_created_reporter_id (created, reporter), | ||
INDEX ofSpamReport_created_reported_id (created, reported) | ||
); | ||
|
||
CREATE TABLE ofSpamStanza ( | ||
reportID BIGINT NOT NULL, | ||
stanzaIDValue VARCHAR(1024) NOT NULL, | ||
stanzaIDBy VARCHAR(1024) NOT NULL, | ||
stanza TEXT NULL, | ||
INDEX ofSpamStanza_reportID (reportID) | ||
); | ||
|
||
# Finally, insert default table values. | ||
|
||
INSERT INTO ofID (idType, id) VALUES (18, 1); | ||
INSERT INTO ofID (idType, id) VALUES (19, 1); | ||
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 ofID (idType, id) VALUES (42, 1); | ||
|
||
INSERT INTO ofVersion (name, version) VALUES ('openfire', 36); | ||
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37); | ||
|
||
# Entry for admin user | ||
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID INTEGER NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
context LONG VARCHAR NULL, | ||
CONSTRAINT ofSpamReport PRIMARY KEY (reportID) | ||
); | ||
|
||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
CREATE TABLE ofSpamStanza ( | ||
reportID INTEGER NOT NULL, | ||
stanzaIDValue VARCHAR(1024) NOT NULL, | ||
stanzaIDBy VARCHAR(1024) NOT NULL, | ||
stanza LONG VARCHAR NULL | ||
); | ||
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID); | ||
|
||
INSERT INTO ofID (idType, id) VALUES (42, 1); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID BIGINT NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
context LONGVARCHAR NULL, | ||
CONSTRAINT ofSpamReport PRIMARY KEY (reportID) | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
CREATE TABLE ofSpamStanza ( | ||
reportID BIGINT NOT NULL, | ||
stanzaIDValue VARCHAR(1024) NOT NULL, | ||
stanzaIDBy VARCHAR(1024) NOT NULL, | ||
stanza LONGVARCHAR NULL | ||
); | ||
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID); | ||
|
||
INSERT INTO ofID (idType, id) VALUES (42, 1); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID BIGINT NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
context TEXT NULL, | ||
PRIMARY KEY (reportID), | ||
INDEX ofSpamReport_created_reporter_id (created, reporter), | ||
INDEX ofSpamReport_created_reported_id (created, reported) | ||
); | ||
|
||
CREATE TABLE ofSpamStanza ( | ||
reportID BIGINT NOT NULL, | ||
stanzaIDValue VARCHAR(1024) NOT NULL, | ||
stanzaIDBy VARCHAR(1024) NOT NULL, | ||
stanza TEXT NULL, | ||
INDEX ofSpamStanza_reportID (reportID) | ||
); | ||
|
||
INSERT INTO ofID (idType, id) VALUES (42, 1); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID INTEGER NOT NULL, | ||
reporter VARCHAR2(1024) NOT NULL, | ||
reported VARCHAR2(1024) NOT NULL, | ||
reason VARCHAR2(255) NOT NULL, | ||
created INTEGER NOT NULL, | ||
context CLOB NULL, | ||
CONSTRAINT ofSpamReport_pk PRIMARY KEY (reportID) | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
CREATE TABLE ofSpamStanza ( | ||
reportID INTEGER NOT NULL, | ||
stanzaIDValue VARCHAR2(1024) NOT NULL, | ||
stanzaIDBy VARCHAR2(1024) NOT NULL, | ||
stanza CLOB NULL | ||
); | ||
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID); | ||
|
||
INSERT INTO ofID (idType, id) VALUES (42, 1); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID BIGINT NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
context TEXT NULL, | ||
CONSTRAINT ofSpamReport_pk PRIMARY KEY (reportID) | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
CREATE TABLE ofSpamStanza ( | ||
reportID BIGINT NOT NULL, | ||
stanzaIDValue VARCHAR(1024) NOT NULL, | ||
stanzaIDBy VARCHAR(1024) NOT NULL, | ||
stanza TEXT NULL | ||
); | ||
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID); | ||
|
||
INSERT INTO ofID (idType, id) VALUES (42, 1); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the db2 has the TIMESTAMP type. In other places of the file used char for date, which it very strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(as above: we currently never use a TIMESTAMP field, which is certainly something I'd like to improve on. If we do improve on that, we should do it consistently, everywhere).