Commit Graph

748 Commits

Author SHA1 Message Date
Alexei Sorokin 9a515b9234 [SCHEMA] Improve timestamp storage
Avoid the use of deprecated MariaDB "zero dates" globally. If they're present
as attribute defaults somewhere, they will be replaced with NULL implicitly.
The existing "zero dates" in MariaDB storage will be left intact and this
should not present any issues.

The "timestamp" type in table definitions now corresponds to DATETIME in
MariaDB with "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", which
should be close enough to the original behaviour for compatibility purposes.
It is now the recommended type for "modified" attributes, because of the
update trigger on MariaDB. But there is no such trigger implemented on
PostgreSQL as of this moment.
2020-06-29 01:41:46 +03:00
Alexei Sorokin 6674d1ed0f [NodeInfo][DATABASE] Adjust indices of the "notice" and "user" tables
On big databases these queries from the Nodeinfo plugin choked up:

SELECT profile_id FROM notice
  WHERE notice.created >= (CURRENT_DATE - INTERVAL '180' DAY)
  AND notice.is_local = 1;
SELECT id FROM "user"
  WHERE "user".created >= (CURRENT_DATE - INTERVAL '180' DAY);
2019-11-03 18:57:03 +03:00
Alexei Sorokin 5b797328f2 [DATABASE] Always quote identifiers
The code used to operate under the assumption that MariaDB doesn't support
quoting identifiers. Not only is that not exactly true, but MariaDB has
reserved keywords that cannot be used as table or column names unquoted.
2019-09-11 08:15:16 +03:00
Miguel Dantas b41f9620fa [LIB_REFACTOR] Fix requires 2019-09-03 03:33:13 +01:00
Miguel Dantas 58bde08425 [LIB_REFACTOR] Moving files into separate semantic categories 2019-09-03 03:33:13 +01:00
Miguel Dantas f79cd8cee3 [CORE] Fix small bug where Notice was sending a JSON representation to the queue, instead of sending itself 2019-09-03 03:26:35 +01:00
tenma c802480d75 [CORE] Add new Notice scope for private messaging
Notice:
- Add MESSAGE_SCOPE scope

lib/*.stream:
- Filter out notices with MESSAGE_SCOPE scope
2019-08-21 16:54:47 +01:00
Diogo Cordeiro f67a93eddc [CORE] Bump Database requirement to MariaDB 10.3+ 2019-08-03 17:47:23 +01:00
Diogo Cordeiro c03ed457a6 Fix broken user activitystreams feed due to deleted notices 2019-05-06 23:27:38 +01:00
mmn 924bcd93e5 Merge branch 'notice_id-xml' into 'nightly'
Use the statusnet namespace for notice_id in atom feed

See merge request !136
2017-07-11 20:01:01 +00:00
Mikael Nordfeldth 0dd68d11cb What just happened? Not sure if me or git caused duplicate code. 2017-05-06 14:48:04 +02:00
Mikael Nordfeldth 4f37c564a5 Merge branch 'master' into mmn_fixes 2017-05-06 14:40:06 +02:00
Mikael Nordfeldth 966971bd12 Revert some of 8a4bec811b
use Notice_prefs instead of adding a new field. The rationale here
is simply that the Notice table was _huge_ and I rant into issues
with /tmp filling up when altering the tables. So let's just create
a new table instead.
2017-05-06 14:38:48 +02:00
Mikael Nordfeldth d115f9dd1b Output selfLink from notice asActivity[Object] 2017-05-06 14:38:45 +02:00
Mikael Nordfeldth 434956fc75 Notices start saving selfLink from activities/objects 2017-05-06 14:38:42 +02:00
Mikael Nordfeldth 286b1e0ab7 Revert some of 8a4bec811b
use Notice_prefs instead of adding a new field. The rationale here
is simply that the Notice table was _huge_ and I rant into issues
with /tmp filling up when altering the tables. So let's just create
a new table instead.
2017-05-06 13:24:11 +02:00
Mikael Nordfeldth 7c829852b8 Output selfLink from notice asActivity[Object] 2017-05-06 12:26:54 +02:00
Mikael Nordfeldth 8a4bec811b Notices start saving selfLink from activities/objects 2017-05-06 12:15:54 +02:00
Mikael Nordfeldth 000af6d9ee default to #addtag on !group mention 2017-05-02 21:21:53 +02:00
Mikael Nordfeldth 07458e5375 Fixed the parsing of ostatus:conversation etc.
Conversation will now start storing remote URL

The namespace features don't work the way they were written for here
so I fixed that, making the ostatus: namespace properly looked up and
then the homegrown getLink function looks for what is back-compat with
StatusNet etc. if I remember correctly.
2017-05-02 18:58:22 +02:00
Thomas Karpiniec 47cd054976 Use the statusnet namespace for notice_id 2017-02-04 21:59:30 +11:00
Mikael Nordfeldth a7043bf7cc Split up source and source_link. Never trust HTML!
https://community.highlandarrow.com/notice/269667
or alternatively: https://social.umeahackerspace.se/conversation/495655
2016-09-02 01:00:52 +02:00
Mikael Nordfeldth 59b93b23e2 Split up source and source_link. Never trust HTML!
https://community.highlandarrow.com/notice/269667
or alternatively: https://social.umeahackerspace.se/conversation/495655
2016-09-02 00:55:46 +02:00
Mikael Nordfeldth 3b046ee49d Shorthand function to check if notice has been repeated. 2016-08-27 14:42:28 +02:00
Mikael Nordfeldth 3d6e25ee5f We have to create and populate the Notice_location table before constraint checking foreign keys. 2016-06-25 13:01:56 +02:00
Mikael Nordfeldth f93f02f424 Managed_DataObject now has getByUri() 2016-06-25 11:59:06 +02:00
Mikael Nordfeldth 7978cd6d59 s/EmptyIdException/EmptyPkeyValueException/ 2016-06-25 11:50:59 +02:00
Stephen Paul Weber 47e541eaec Allow getting notice title without implying one
Sometimes I just want explicit titles, and not the generated "blah posted on date" text
2016-06-10 21:00:01 +00:00
Mikael Nordfeldth 0959efd7be Use constant for ATTN_PUBLIC (public collection) 2016-04-18 15:56:52 +02:00
Mikael Nordfeldth 6d33c003fc Maybe stop deleteRelated from failing on constraint checking 2016-04-04 12:04:20 +02:00
Mikael Nordfeldth 195285ac2f Fix constraint checking and only run it if not already constrained 2016-04-01 06:24:11 +02:00
Mikael Nordfeldth 8de3469957 Constraint check Notice table, need to get foreign key array! 2016-03-31 17:57:01 +02:00
Mikael Nordfeldth 72cafe03e9 Index object_type too... 2016-03-29 12:48:25 +02:00
Mikael Nordfeldth 4e2be07234 Better indexing for Notice (performance++) 2016-03-29 12:13:33 +02:00
Mikael Nordfeldth 4790db348d FetchRemoteNotice event call in Notice (not effective yet) 2016-03-27 14:00:05 +02:00
Mikael Nordfeldth 49a91885c9 Strictify Notice->isPublic() 2016-03-24 01:54:33 +01:00
Mikael Nordfeldth 6b4c331060 Attachment and file handling since we could get NULL instead of File 2016-03-23 17:53:38 +01:00
Mikael Nordfeldth 86ce93b376 Notice->deleteRelated should be called from delete() 2016-03-21 17:34:03 +01:00
Mikael Nordfeldth a0336ce48b Unnecessary debug output 2016-03-06 18:15:36 +01:00
Mikael Nordfeldth d9538183bd Use information about activityschema public mention for Notice scope 2016-03-06 17:47:35 +01:00
Mikael Nordfeldth d6598e790c Introduce a ConfigException 2016-03-02 12:33:06 +01:00
Mikael Nordfeldth 9534969c05 Don't set is_local=LOCAL_NONPUBLIC on sandboxed user notices
Let's decide whether they are nonpublic by testing them when the notice
is shown instead.
2016-03-02 12:26:23 +01:00
Mikael Nordfeldth 47f408ca7c Strict typing for mail_notify_attn 2016-03-01 23:37:11 +01:00
Mikael Nordfeldth e41809af89 Nothing interesting was made in this commit. 2016-03-01 16:30:00 +01:00
Mikael Nordfeldth 63c087a255 Consistent behaviour for ScopingNoticeStream $scoped
We don't guess the current profile anymore if the value of the profile === -1

Also sets $this->scoped for all ScopingNoticeStream inheritors, which just
like in an Action can be null if we're not scoped in any way (logged in).
2016-03-01 14:51:47 +01:00
Mikael Nordfeldth 52a3764ae4 Resolve relative URLs (assuming URI.Base==notice URL)
The real way to do this would be to get the xml:base property from
the Atom feed but it's probably not there in any posts we see today.
2016-02-26 14:46:26 +01:00
Mikael Nordfeldth c58228195b Make sure the saved Notice has an ID 2016-02-26 01:11:20 +01:00
Mikael Nordfeldth 519e3308ab Use mb_strlen to see if something is an empty string 2016-02-26 01:04:59 +01:00
Mikael Nordfeldth 6336248d71 Notice getRendered() can now be called on uninserted notices 2016-02-25 20:13:00 +01:00
Mikael Nordfeldth e69f878241 Notice getRendered() can now be called on uninserted notices 2016-02-25 15:48:37 +01:00