-
-
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 5 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,6 +371,16 @@ CREATE TABLE ofPubsubDefaultConf ( | |
PRIMARY KEY (serviceID, leaf) | ||
); | ||
|
||
CREATE TABLE ofSpamReport ( | ||
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. |
||
raw TEXT NOT NULL, | ||
INDEX ofSpamReport_created_reporter_id (created, reporter), | ||
INDEX ofSpamReport_created_reported_id (created, reported) | ||
); | ||
|
||
# Finally, insert default table values. | ||
|
||
INSERT INTO ofID (idType, id) VALUES (18, 1); | ||
|
@@ -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', 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 |
---|---|---|
|
@@ -384,6 +384,16 @@ CREATE TABLE ofPubsubDefaultConf ( | |
CONSTRAINT ofPubsubDefaultConf_pk PRIMARY KEY (serviceID, leaf) | ||
) | ||
|
||
CREATE TABLE ofSpamReport ( | ||
reporter NVARCHAR(1024) NOT NULL, | ||
reported NVARCHAR(1024) NOT NULL, | ||
reason NVARCHAR(255) NOT NULL, | ||
created INTEGER NOT NULL, | ||
"raw" LONG VARCHAR 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. maybe rename the 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 column is not great, indeed. I'm in the middle of a refactoring of the database structure. I think this column will be dropped (and instead we'll have a table that can be JOINed with, to have zero-to-many reported stanzas. More on this later! |
||
) | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter) | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported) | ||
|
||
/* Finally, insert default table values. */ | ||
|
||
INSERT INTO ofID (idType, id) VALUES (18, 1) | ||
|
@@ -392,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', 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,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
raw LONG VARCHAR NOT NULL | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
raw LONGVARCHAR NOT NULL | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
raw TEXT NOT NULL, | ||
INDEX ofSpamReport_created_reporter_id (created, reporter), | ||
INDEX ofSpamReport_created_reported_id (created, reported) | ||
); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter VARCHAR2(1024) NOT NULL, | ||
reported VARCHAR2(1024) NOT NULL, | ||
reason VARCHAR2(255) NOT NULL, | ||
created INTEGER NOT NULL, | ||
"raw" CLOB NOT NULL | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
raw TEXT NOT NULL | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter VARCHAR(1024) NOT NULL, | ||
reported VARCHAR(1024) NOT NULL, | ||
reason VARCHAR(255) NOT NULL, | ||
created BIGINT NOT NULL, | ||
raw NVARCHAR(MAX) NOT NULL | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
UPDATE ofVersion SET version = 37 WHERE name = 'openfire'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE ofSpamReport ( | ||
reporter NVARCHAR(1024) NOT NULL, | ||
reported NVARCHAR(1024) NOT NULL, | ||
reason NVARCHAR(255) NOT NULL, | ||
created INTEGER NOT NULL, | ||
"raw" LONG VARCHAR NOT NULL | ||
); | ||
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter); | ||
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported); | ||
|
||
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).