Commit graph

297 commits

Author SHA1 Message Date
friendica
eebb6f23fb critical notifier fix to make diaspora delivery work reliably again. If everything breaks revert or debug. 2014-12-17 01:50:43 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
a659ac8952 disable request message response until we work through this 2014-11-01 00:36:21 -07:00
friendica
28a35261db What this checkin does is catch the case where a comment arrived and there's a missing top-level post to match it with. So we'll send a request back to the sender that you've never seen this thread and please send a fresh copy of the entire conversation to date. We could soon have posts in the matrix from different platforms from days gone by, which have been migrated into the modern world. We'll be polite and not deliver these to everybody. However, if someone comments on one of these antique threads we wouldn't be able to see it in our own matrix because we won't have a copy of the parent post. So this rectifies that situation. Be aware that item deletion may need to change to keep "hard deleted" items indefinitely so that they don't keep coming back. We'll have to null out the important data of the former item to accomplish the deletion aspect. 2014-10-30 19:15:03 -07:00
friendica
ad86cc24c8 d* PM cont. 2014-09-23 04:34:35 -07:00
friendica
b735961560 found the sucker 2014-09-22 16:23:59 -07:00
friendica
e76ab30467 we don't always set HUBLOC_FLAGS_DELETED but we often set hubloc_status = HUBLOC_OFFLINE instead. Filter this as well from deliveries. 2014-09-21 15:11:47 -07:00
friendica
5ea6f27792 final piece of the mrjive delivery puzzle, and now we've got most all the tools to implement mod_hubman 2014-09-15 13:37:57 -07:00
friendica
0dc33900b6 provide a way to sync locations and get rid of bogus hublocs, now implemented 2014-09-14 22:19:19 -07:00
friendica
b1809f5f0c log why this doesn't get executed 2014-09-12 15:10:53 -07:00
friendica
6a42d6fe3b works one way sort of - now to go the other way - which will require fixing a whole slew of FIXMEs 2014-08-26 18:58:48 -07:00
friendica
e42205cec2 houston we have liftoff 2014-08-26 17:32:51 -07:00
friendica
6e99848043 more diaspora stuff - most of the basic bits are there except queueing and physical delivery (I'm keeping delivery turned off until some of the bugs are fixed so we don't cause inifinite loops or network meltdowns) - now it's just a matter of going through and methodically finding all the bugs 2014-08-25 22:43:44 -07:00
friendica
eb8f194419 sort out some anomalies 2014-08-25 21:42:46 -07:00
friendica
84ff380302 more diaspora heavy lifting 2014-08-25 20:57:10 -07:00
friendica
9196c9eef0 We really can't do this without a hubloc. I was hoping we could, but notifier is setup to take hublocs, not xchans. 2014-08-22 21:37:08 -07:00
friendica
5f41813845 homepage revisions 2014-07-06 19:15:09 -07:00
friendica
62b4ec4e75 make folks from certain other networks feel more at home here 2014-05-02 17:29:04 -07:00
friendica
1eb8e570bf tag anyone 2014-04-15 18:35:22 -07:00
friendica
7e6804b599 make sure we can find that function 2014-04-11 15:14:01 -07:00
friendica
202582cbd6 we also need a loop breaker 2014-04-11 15:08:40 -07:00
friendica
50a7e9ce8f this should improve queue performance dramatically. 2014-03-24 19:40:36 -07:00
friendica
caa284e786 we don't allow forgeries to be received - save some bandwidth by not allowing them to be sent. We do have to figure out how some secondary delivery chains are ending up with posts belonging to the original owner instead of the chain owner, but that's for another day. 2014-03-21 01:14:51 -07:00
friendica
66baa3cab0 try to reduce the number of simulaneous deliveries of the same post when dealing with owner relays that have more than one channel instance. If things melt down in the next few hours and I'm not available please revert this. I've reviewed a few times and think it's OK, but this part of the delivery code is traditionally touchy. 2014-01-22 22:07:47 -08:00
friendica
be8a7e2de6 this is necessary for any possibility of a federated future. 2013-11-21 15:58:42 -08:00
friendica
4791b2fd9c add aid to notifiy table which we may need to supress duplicate notify emails across your channels
also try to handle the wretched mess of broken and duplicated hublocs that fred.cepheus.uberspace.de typically reports
2013-11-20 21:09:13 -08:00
friendica
0b0bd3c207 create update record for accounts on directory server itself during profile changes, re-queue failed directory sync packets, fix account_id index in queue creation, be more selective about updating hubloc_connected (only when we're talking to the associated site). But we still need a way to flag dead accounts and these mechanisms won't cut it, because it isn't a requirement that channels communicate with anybody, except for contacting the directory when the account is created. I think we need to make every channel ping the directory once a month. Then we can find those that have not done so (after syncing with other directories). We can't have the directory just flag dead accounts as this would create a way for an anti-social attacker to become a directory server and mark all the accounts dead. 2013-10-24 19:38:50 -07:00
friendica
ad29d0f9a1 preserve the source owner when creating a delivery fork so that we can uplink back to them without any ambiguity. 2013-10-13 18:36:28 -07:00
friendica
ff2ada207a Pieces we'll need to tie together chanman and account/channel deletion and directory sync. Please do not mess with any of this.
Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this. Please do not mess with any of this.

OK? Understood?
2013-09-17 20:50:09 -07:00
friendica
83e086edcd doc update, put more telemetry on notifier and try to ensure that private posts have recipients. 2013-09-13 04:51:55 -07:00
friendica
a09829a1ee perform a refresh_all when an import has completed so that all your connections get a fresh update. 2013-09-08 21:05:39 -07:00
friendica
a35d440ff1 Add Comanche layouts to the things that don't go offsite. 2013-09-01 20:11:04 -07:00
friendica
ac541a7d32 most of expire is now ported from friendica, but the protocol bits to push out the delete notifications for the entire batch to all recipients of the original post are not complete and will take quite a bit more work. As a consequence, expire has been completely disabled until it is fully implmented since it could result in completely un-removable posts reminiscent of the infamous "Bonnie Nadri" incident at Diaspora which we do not wish to re-live. 2013-08-14 20:09:02 -07:00
friendica
04f8de184e block content-type (called ITEM_BUILDBLOCK to avoid confusion with content that is blocked) 2013-08-12 17:42:52 -07:00
friendica
85c7d7165f yhis should fix the privacy leak - as well as non-private replies to private posts 2013-08-01 14:27:40 -07:00
friendica
2a848c0d37 privacy leakage 2013-07-31 22:58:23 -07:00
friendica
9f1fa5aba2 improvements in delivery logging 2013-07-21 17:19:16 -07:00
friendica
6220ab4b54 fix profile update propagation 2013-06-18 02:51:43 -07:00
friendica
f338da04e1 don't federate webpages ;-) 2013-06-15 19:31:38 -07:00
friendica
765d6e0a97 push refresh messages, performance work on conversations and configs, doc updates 2013-06-14 16:54:58 -07:00
friendica
df32c93d56 zidify img links, delay notifier until actually published for time travelling posts 2013-05-27 05:27:35 -07:00
friendica
deedac6ae5 workarounds for people that re-install and end up polluting everybody's databases with stale entries 2013-05-16 20:21:12 -07:00
friendica
ea3940c4b0 start formatting for Doxygen 2013-02-25 17:09:40 -08:00
friendica
95415bff69 delete item should now mostly work 2013-01-28 19:24:36 -08:00
friendica
cb5a20ba2c uncomplicate item deletion and fixup all the other linked tables 2013-01-24 16:44:10 -08:00
friendica
5182d6d820 this should make tag delivery (e.g. forums) work - but not yet fully tested 2013-01-13 18:35:12 -08:00
friendica
9253eaa98a never enough documentation 2013-01-04 17:16:35 -08:00
friendica
816383a9c3 This should fix the errant relaying... 2013-01-04 17:04:44 -08:00
friendica
37a4afa2ff fix typo - commited to wrong tree 2013-01-04 16:28:33 -08:00
friendica
59c23564a0 break delivery loop 2013-01-04 03:36:32 -08:00
friendica
4c21abe533 verify table needs auto_increment flag 2013-01-02 23:07:46 -08:00
friendica
e9c87a69ce cleanup more obsolete stuff 2012-12-18 16:29:57 -08:00
friendica
1c6f301d8f y'all got mail 2012-12-05 16:44:07 -08:00
friendica
7082d198c2 Now if you follow somebody it will create an abook entry on the other site with blocked,ignored, and pending set. No "friend notifications" yet. 2012-11-29 18:15:13 -08:00
friendica
2fe2de1d5a got comments going back and forth - we really need local_deliver now since even local deliveries are going through zot and that isn't necessary or desirable in the long term 2012-11-27 17:09:01 -08:00
friendica
f3fdbb6021 tracking through comments 2012-11-27 03:08:26 -08:00
friendica
194ef02c28 DATABASE: outq additions, delivery now getting the notify across to the other side 2012-11-19 16:51:15 -08:00
friendica
db77309bc3 For private messages, use hush-hush ultra top-secret mode by default 2012-11-18 19:19:16 -08:00
friendica
8611c3da68 Now we are able to get a zot notification packet and the resulting json encoded message into the queue, it's still a hard slog, but there's light at the end of the tunnel - "a message is ready and waiting to be delivered". 2012-11-18 18:30:00 -08:00
friendica
b8609aba63 little stuff 2012-11-16 15:53:02 -08:00
friendica
5d4c9f5617 more progress on notifier cleanup and encoding items for transit. 2012-11-15 21:52:05 -08:00
friendica
0ace91bd0e starting the big notifier cleanup 2012-11-14 17:02:30 -08:00
friendica
5bf3ddfcf6 got zot 2012-11-12 20:59:18 -08:00
friendica
82e74e3520 likes are quasi working again - at least an activity item is stored and it mostly has correct data, but displaying it needs improvement. 2012-11-05 23:52:01 -08:00
friendica
e3c2e58979 "profile url" e.g. the wall/stream is now "channel url". "Profile URL" goes to the profile details. 2012-10-29 17:14:02 -07:00
Mike Macgirvin
7acba41dc6 more cleanup 2012-10-23 21:26:12 +11:00
friendica
3ebb4a3dc7 updates 2012-09-09 21:17:06 -07:00
friendica
80bd128425 more DB cleanup 2012-08-30 18:47:07 -07:00
friendica
5ff6e9348b a few minor changes 2012-08-26 23:05:00 -07:00
friendica
f7c6a6ff90 item table rename parent-uri, target-type, object-type (more to come later) 2012-08-15 22:33:37 -07:00
friendica
e80d69d25b merge upstream 2012-08-11 18:54:23 -07:00
friendica
49c0e0de9b sync changes 2012-07-19 18:53:26 -07:00
friendica
d683df17bd Removing connectors we won't be needing - this is probably going to break some shit. 2012-07-18 04:49:15 -07:00
friendica
44638184c3 the pioneers should at least have a current db - it will likely be some time before db updates go into this tree as many incompatible things are changing and cannot be automatically migrated, so it will probably mean frequent reinstalls. 2012-07-16 16:33:31 -07:00
friendica
3f414aec63 get rid of special "short salmon key" for statusnet 2012-07-11 16:54:18 -07:00
friendica
a3edbf7e5d create third privacy state - public post but not searchable or publicly visible 2012-06-28 17:43:29 -07:00
Zach Prezkuta
c0c50ece0f revert extra Diaspora disabling changes to try to eliminate Mustard double-posting 2012-06-25 19:03:03 -06:00
Zach Prezkuta
8bb7ab88fb Clean up the Diaspora connectivity:
- Move Diaspora code into separate functions to make it more modular
- Create more checks for whether Diaspora connectivity has been enabled
2012-06-25 19:03:03 -06:00
Zach Prezkuta
cde0de965f first shot at getting like/unlike functions to work consistently 2012-06-03 14:53:30 -06:00
Zach Prezkuta
77962aa79d Fix bugs in the retraction code
Currently, the following seems to be the functional status:
	For a Diaspora top-level post:
		Friendica comments show up AND delete
		Diaspora comments show up AND delete for top-level owner
		Diaspora comments show up for non-owner
		Diaspora comments sometimes don't delete for non-owner
			-> Appears to be Diaspora's fault, as a "not a valid object" error shows up in the log

		Friendica likes show up, but can't unlike (Friendica doesn't even message Diaspora)
		Diaspora likes show up
		Diaspora non-owner can't unlike
			-> Same as comments, seems to be Diaspora's fault

	For a Friendica top-level post:
		Friendica comments show up AND delete
		Diaspora comments show up AND delete

		Friendica likes don't show up in Diaspora sometimes
		Friendica doesn't even message Diaspora for unlikes (sometimes?)
		Diaspora likes and unlikes work
2012-06-03 14:53:30 -06:00
Zach Prezkuta
c0af6dbb1a Implement relaying of relayable_retractions
Also: some whitespace cleanup, fix Diaspora parent DB query
2012-06-03 14:53:29 -06:00
Zach Prezkuta
1fe1ac022f Support relayable_retractions that are relayed to us by the top-level post owner 2012-06-03 14:53:29 -06:00
friendica
2bd1004587 rework the way private photos are embedded to avoid url differences and also check the permissions if possible to make sure that nothing sneaks by. 2012-05-27 21:01:58 -07:00
friendica
afaf9ec74f rev update 2012-05-20 18:30:02 -07:00
friendica
513ef2410d backend support for 'x' deliveries per process - x is configurable, more importantly any search starting with # is automatically a tag search. TODO: Need to extend this to people searches starting with @ 2012-05-19 02:42:11 -07:00
friendica
7b0ded3f14 more private forums, default privacy group for new contacts 2012-05-17 22:44:52 -07:00
friendica
f3e18df55d string update 2012-05-03 16:55:03 -07:00
friendica
26c53580d1 implement contact archival 2012-04-27 17:17:58 -07:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
friendica
5d0d9f8772 make contact ssl_policy change a function since it is used in a few places 2012-04-02 23:07:26 -07:00
friendica
f4721955db more ssl policy fixes and prevent delivery to soapbox when using local delivery 2012-04-02 21:01:19 -07:00
friendica
cca524495c community discovery cont., cleanup of DB debugging 2012-03-18 22:12:36 -07:00
Michael Vogel
6e7a190e91 Mail: Subject are now with working "Re:" 2012-03-12 00:22:12 +01:00
Michael Vogel
2ed6b3531e Removing test exports 2012-03-11 23:29:59 +01:00
friendica
395a9530dc still getting parent relays on remote systems 2012-03-07 18:23:55 -08:00
Michael
437e18d7a7 Merge remote branch 'upstream/master' 2012-02-26 21:47:47 +01:00
friendica
f5c5da742d attribution issue - don't take author name from contact if available from item. 2012-02-24 20:03:13 -08:00
Michael
a74b0746b1 multipart messages complete, message-id conversion done. 2012-02-25 01:10:45 +01:00
Michael
0ba45eb745 Sending mail as multipart/alternative (html and plain text) (very basic by now) 2012-02-24 08:50:42 +01:00
Michael
f6320f3319 Encoding for incoming mails. Fixed invalid message id (with side effect at the moment). Sending mail as text mail. Encoding name when importing mail contact. 2012-02-24 07:11:26 +01:00