-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
OF-2954: New feature: Spam Reporting #2661
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
base: main
Are you sure you want to change the base?
Changes from all commits
0b56d77
11c37c7
64cf3c8
f1d280e
a7b2a0d
3e10177
4e38ff3
543b1e7
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 |
---|---|---|
|
@@ -365,13 +365,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, | ||
reportOrigin TINYINT NOT NULL, | ||
thirdParty TINYINT 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. 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. good. If the migration is anyway planed and you know how it will be implemented, then for the new code it may better to start using it. Just my 2c. |
||
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); | ||
|
||
# Entry for admin user | ||
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate) | ||
|
@@ -381,4 +404,4 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica | |
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0); | ||
|
||
# Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully. | ||
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37); | ||
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID INTEGER NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
reportOrigin INTEGER NOT NULL, | ||
thirdParty INTEGER 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 = 38 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID BIGINT NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
reportOrigin INTEGER NOT NULL, | ||
thirdParty INTEGER 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 = 38 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reportID BIGINT NOT NULL, | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
reportOrigin TINYINT NOT NULL, | ||
thirdParty TINYINT 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 = 38 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).