Commit Graph

28 Commits

Author SHA1 Message Date
Alexei Sorokin
26115482ef [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.
2021-07-16 19:44:37 +01:00
Alexei Sorokin
eab5725698 [DATABASE] Disable 'NULL' strings evaluation as SQL NULLs
Use $object->sqlValue('NULL') (identical to DataObject_Cast'ing) instead and
fix related issues like (email|sms)settings considering these NULLs as a
false positive for the E-Mail address still being set when it's been removed.

There could also be security implications to the now-disabled approach of
considering 'NULL' strings as SQL NULLs.
2021-07-16 19:44:35 +01:00
Alexei Sorokin
6fae840ee7 [DATABASE] Set NULL in DB_DataObject in a more reliable manner
Also stop assuming that FeedSub::sub_state (enum) and FeedSub::sub_end
(datetime) can possibly be set to an empty string.
2021-07-16 19:44:35 +01:00
Diogo Cordeiro
f67a93eddc [CORE] Bump Database requirement to MariaDB 10.3+ 2019-08-03 17:47:23 +01: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
Mikael Nordfeldth
05d3622939 Conversation entries where id==0 would screw up the "re-auto-increment" sequencing 2016-01-06 22:26:17 +01:00
Mikael Nordfeldth
0fd2ad649e Conversation IDs (again) no longer based on Notice ID 2016-01-06 13:58:46 +01:00
Mikael Nordfeldth
1e07f8c045 Incorrect use of DataObject type matching after ->find() 2015-09-04 20:35:11 +02:00
Mikael Nordfeldth
925aacec1a Throw exception when a Conversation is not found 2015-05-26 13:11:08 +02:00
Mikael Nordfeldth
2f86cd8602 utf8mb4 conversion on database with index adjusts 2015-02-12 18:18:55 +01:00
Mikael Nordfeldth
9f09b136b8 Adding crc32 to uniqueify conversation URIs
This really should be a UUID or something else totally unexpected
but I figure that crc32 is good enough for now. The reason we keep
the main structure is because some third party scripts have begun
relying upon the tag URI format to parse out domain name, type etc.
2014-11-27 17:05:01 +01:00
Mikael Nordfeldth
e0d0a59706 Move Conversation creation out of insert() to allow URI setting
This means we import the URI string from remote instances to track their
conversations and are able to stitch together replies in a single thread.

We might have to try to avoid collisions so noone remotely can predict
conversation URIs which we generate on our server, causing a DoS kind of
problem.
2014-11-27 14:27:41 +01:00
Mikael Nordfeldth
8a4575ea76 Conversation URI cannot be null 2014-11-27 14:15:42 +01:00
Roland Haeder
ea53233f17 Fixed CHMOD + set error_reporting(0) in getvaliddaemons.php to avoid strict warnings in PHP +5.5
Signed-off-by: Roland Haeder <roland@mxchange.org>
2014-08-24 13:12:44 +02:00
Mikael Nordfeldth
9afdc40763 Show correct number of POSTs in conversation "more" link 2014-07-15 14:26:42 +02:00
Mikael Nordfeldth
1a81188355 Use an Event to present notices conversations 2014-05-12 11:03:21 +02:00
Mikael Nordfeldth
9a5e1423f1 Conversations now have URIs that are not URLs 2014-05-01 20:17:40 +02:00
Mikael Nordfeldth
27ed6b7db0 getConversationUrl introduced for linking to conversations 2014-05-01 15:25:19 +02:00
Mikael Nordfeldth
5144c0cb78 Throw exception, don't return null in Conversation::create 2014-03-01 17:19:10 +01:00
Mikael Nordfeldth
5c505d8539 Conversation ID now gets set from initial notice.
This will work without much extra effort because there will always be
more notices (higher value) than conversations (so no collisions).

But please run upgrade.php to avoid having an autoincrement id on
conversation table.

Installations using code after 2014-03-01 will have identical
conversation IDs to the initial (conversation root) notice IDs. This
will not affect older installations, which will have very different
values.
2014-03-01 17:12:40 +01:00
Mikael Nordfeldth
40fe10e002 Woops, forgot auto_increment (comes with 'serial')
There are still some classes not ported (like Yammer import)
2013-08-21 15:02:44 +02:00
Mikael Nordfeldth
1a9a8ea730 staticGet for sub-Managed_DataObject classes now calls parent
The parent class for our database objects, Managed_DataObject, has a
dynamically assigned class in staticGet which objects get put into,
leaving us with less code to do the same thing.

We will probably have to move away from the DB_DataObject 'staticGet'
call as it is nowadays deprecated.
2013-08-12 19:46:44 +02:00
Evan Prodromou
9ca3c3d1c3 move core schema to class files 2011-08-22 17:52:02 -04:00
Evan Prodromou
59d0e2f373 cache the notice count for threaded view 2011-04-06 23:17:17 -04:00
Siebrand Mazeland
b03ece26eb * i18n/L10n and translator documentation updates.
* whitespace and indentation updates
2010-09-28 23:21:09 +02:00
Brion Vibber
2d79455a1f Don't add PHPSESSID parameter onto notice and conversation URIs if we save a notice during a session override.
This was being triggered by welcomebot messages created at account creation time, then propagated through replies.
2010-03-23 09:54:24 -07:00
Zach Copley
ed46a38ecf - conversation.uri needs to be nullable
- factory method for creating new local conversations
2010-02-17 01:11:14 -08:00
Zach Copley
a2f8c5da17 New Conversation DO to handle remote notices as conversation roots 2010-02-16 23:30:08 -08:00