Commit graph

307 commits

Author SHA1 Message Date
friendica
ac594183c6 Merge branch 'master' into tres and add some work on the item_deleted flag refactor
Conflicts:
	include/attach.php
	include/onedirsync.php
	include/zot.php
	mod/locs.php
2015-01-26 18:27:03 -08:00
friendica
4c2a1e572a start on item_restrict conversion 2015-01-22 21:04:54 -08:00
friendica
6e0e3b2433 more expanding item flags 2015-01-22 18:41:10 -08:00
friendica
e46eba1258 heavy lifting converting item flag bits 2015-01-22 17:41:16 -08:00
friendica
29436081a8 slow progress removing bitfields on item table 2015-01-21 16:06:25 -08:00
friendica
78cb87343c friendica commenters are currently shown using "Diaspora" app. Try and fix this where we can. 2014-11-20 02:54:55 -08:00
friendica
18cae8a78c change logging of some troublesome or noisy bits so we can figure out what is really going on 2014-11-19 19:22:22 -08:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -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
1237957dd5 logging changes, untranslated string 2014-11-05 21:02:33 -08:00
friendica
d5d6158973 ok heads up - potentially destabilising change. I've tried to sort out all the default connection permissions for those who don't have a predefined (or therefore have a "custom") permissions role. Unfortunately this includes most people that were using this software more than a month ago. The real changes are that the SELF address book entry no longer holds "auto-permissions" but instead holds your "default permissions" (if you have a pre-defined role, the defaults will be pulled from the role table).
The auto permissions have moved to a pconfig (uid.system.autoperms). A DB update will move these settings into their new homes.

What used to be the "Auto-permissions settings" page is now the "default permissions settings" page and a checkbox therein decides whether or not to apply the permissions automatically. A link to this page will only be shown when you have the "custom" role selected.

With luck nobody will notice anything wrong. But at least for the next few days, please review permissions that have been assigned to new connections (either automatically or manually) and make sure they make sense (e.g. they aren't "nothing"). You still need to take action when seeing a message "permissions have changed but not yet submitted" as we always let you review and perhaps adjust the settings _before_ a connection is established (unless you have autoperms turned on).
2014-11-04 17:11:02 -08:00
friendica
65b84e839a back to wrestling with the !@#$ diaspora recursive reshare from hell 2014-10-14 18:47:08 -07:00
friendica
41b74dd7ac diaspora_send_status() - recalculate markdown translation to pickup any later message changes after original submission like wall-to-wall attributions for instance. Normally this would've come from our cached version which was stored prior to tag_deliver being run and therefore isn't yet aware that wall-to-wall status may have changed after delivery. 2014-10-12 21:20:08 -07:00
friendica
0991a5a494 remove remnants of old signing structure - now using diaspora_meta 2014-10-10 14:11:13 -07:00
friendica
aae1d11de8 reset route to parent route on Diaspora comments flowing upstream so they won't be rejected going downstream 2014-10-10 14:04:05 -07:00
friendica
5bfde82258 make sure diaspora comments get the correct route 2014-10-10 13:56:31 -07:00
friendica
202039d389 don't double-encode hashtags 2014-10-08 14:47:24 -07:00
friendica
b595f9d3ee log the recursive reshare from hell at logger_debug until we get through this mess. 2014-10-07 20:42:57 -07:00
friendica
ac77076135 Make a best guess at how to pull the attribution from the recursive reshare from hell. 2014-10-06 21:37:02 -07:00
friendica
bbf88cf639 found one bug trying to fetch the recursive reshare from hell. I still think there's a problem with attribution but we'll have to wait and find that once we have some content to track. Also in private messages, on the message list page, change the text from delete message to delete conversation, because that's what we're really doing. 2014-10-06 20:54:52 -07:00
friendica
34ef3fda76 attempt to deal with the diaspora recursive reshare from hell (Bob reshared Nancy's reshare of George's reshare of Lilly's reshare of Nathan's post). The attribution may be wrong so this is still a work in progress. 2014-10-05 22:17:51 -07:00
friendica
2cadc5a840 send dislike activities to diaspora as comments, also send likes and dislikes of comments as additional comments. We won't go into why this is necessary for a service that claims to support activitystreams. 2014-10-05 17:27:52 -07:00
friendica
d4a6a6b4f5 diaspora share not rendering issue - still have one remaining (the recursive share from hell) 2014-10-05 15:41:03 -07:00
friendica
16b94f1dc0 issues with diaspora comment signatures on relayed comments that are relayed through a redmatrix site (parent post is redmatrix) and involve a private post. 2014-10-02 02:43:07 -07:00
friendica
f203d2a3b0 diaspora private mail seems to work now - but there's an obfuscation leak via the conversation structure that needs to be dealt with. 2014-09-23 20:36:10 -07:00
friendica
2b466ccb8c d* little fixes 2014-09-23 04:40:36 -07:00
friendica
ad86cc24c8 d* PM cont. 2014-09-23 04:34:35 -07:00
friendica
509a85cb12 more work on d* private messages 2014-09-23 03:03:14 -07:00
friendica
2070dbfdea private mail from d* to r# seems to work with these edits. - Now have to go back the other way. 2014-09-22 02:27:52 -07:00
friendica
87a6f25769 try to sort out walltowall translation for diaspora recipients 2014-09-19 02:22:24 -07:00
friendica
19e8d10b7a still some old Friendica database queries in diaspora_signed_retraction 2014-09-16 21:08:34 -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
5042847334 fix diaspora_retraction 2014-09-14 19:04:36 -07:00
friendica
ab7f2db4d7 doc updates and a couple of issues spotted in the logs (diaspora likes, feed author import) 2014-09-12 00:59:23 -07:00
friendica
f1539a65e5 possible solution to diaspora walltowall mistaken attribution 2014-09-10 22:21:19 -07:00
friendica
de89bdc45f encrypt diaspora_meta since it may contain private message contents 2014-09-10 19:02:00 -07:00
friendica
79bd451631 fix the like signatures to the "new ordering" - inbound and outbound 2014-09-10 16:32:19 -07:00
friendica
d891b09b22 don't include plus-sign in the stored term for imported mentions 2014-09-10 01:27:52 -07:00
friendica
e45a9b1522 this should be the final piece of the puzzle 2014-09-09 23:23:52 -07:00
friendica
cb10da3eef Did I ever mention how much I HATE hacking crypto? If you've got a protocol doc that says how you sign something, you damm well better sign it that way. 2014-09-09 22:45:26 -07:00
friendica
c02554ad36 some fixes for auto-perms across networks 2014-09-09 21:38:51 -07:00
friendica
89b65e554c reduce log level of inbound d* posts until we get through some of the more serious federation issues 2014-09-09 20:32:03 -07:00
friendica
f52e754dc6 put back old pointer 2014-09-09 15:53:58 -07:00
friendica
420fd59513 fix empty reshared content 2014-09-09 15:52:52 -07:00
friendica
4384fa8b12 d* friending vsprintf error 2014-09-09 01:14:15 -07:00
friendica
384eace32a heavy lifting on diaspora likes. Still needs much more work - especially as we're ignoring signatures at this time 2014-09-08 22:32:05 -07:00
friendica
b7c1ad8cb2 diaspora_like - sql error 2014-09-08 21:08:50 -07:00
friendica
c6d07feff5 This is long overdue - use a symblic constant NULL_DATE instead of the easily mis-typed sequence '0000-00-00 00:00:00' 2014-09-08 20:35:15 -07:00
friendica
8fbeb370db attempt to format diaspora reshares correctly. This might be an iterative process. 2014-09-08 17:29:37 -07:00
friendica
3cff9c55ba support the recent (2 years ago) changes to diaspora photo embeds 2014-09-06 15:11:56 -07:00
friendica
6ad9d9f845 sort out some of the bb2d madness 2014-09-03 22:00:18 -07:00
friendica
96a9378fd7 this is turning into a wretched mess. It's going to get worse before it gets better, but I'm trying to do this incrementally so I don't break the whole shebang for a few days. It will get better once all the bbcode translation is done in a single place (cross fingers), and we can just sign the post once when we submit it and be done with it. If Diaspora ever implements editing of existing posts we'll have to go back and do the whole wretched mess over again. 2014-09-03 21:14:24 -07:00
friendica
e8ef515b61 store diaspora meta info in the item table. It has to go there or it will kill us with complex joins. We can phase out the sign table once this all checks out. 2014-09-03 05:09:43 -07:00
friendica
75d0f6329c outbound feed issue 2014-09-03 01:09:28 -07:00
friendica
5715d5f4c7 fix diaspora_handle_from_contact() 2014-09-02 22:50:32 -07:00
friendica
f36b58eb45 if we don't have a stored diaspora author signature which has been passed the baton since the post's creation, fill in the field with their redmatrix signature. It's pointless, but there's so much pointless stuff in here that I doubt it matters. From what I can ascertain - nobody is going to look at it anyway. 2014-09-02 21:55:40 -07:00
friendica
8337fd7bb4 try to proceed with a diaspora relayable even if we don't have the original author's signature. 2014-09-02 21:43:46 -07:00
friendica
9dac46ca25 minor nits 2014-09-01 22:59:11 -07:00
friendica
88f8900ac5 various diaspora issues 2014-08-29 17:31:40 -07:00
friendica
8a62b824f9 lots of little Diaspora issues 2014-08-28 21:49:13 -07:00
friendica
eb27bea794 mind numbing drudgery continued... 2014-08-27 19:15:34 -07:00
friendica
5e4298029a and ... we've got a comment coming the other way 2014-08-26 21:00:51 -07:00
friendica
8c6067b411 more hard work 2014-08-26 20:51:59 -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
289ec34ae6 take off the kid gloves 2014-08-26 16:35:06 -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
1abd2a2917 another round of heavy lifting 2014-08-21 22:28:09 -07:00
friendica
69d3e5468d provide the site blacklist everywhere it is needed 2014-08-21 21:07:32 -07:00
friendica
c7fe071a1f some work on network discovery 2014-08-19 19:38:42 -07:00
friendica
dc212c80e2 diaspora - crazy amount of work remaining 2014-08-19 02:00:34 -07:00
friendica
d9ff121930 beginning of permission role settings 2014-08-17 22:53:00 -07:00
friendica
cb027232ff diaspora - begin heavy lifting. This is a 738 tonne brick with a herd of elephants standing on it. I'm working on the first tonne or two. 2014-08-17 20:37:52 -07:00
friendica
20bdcb037f provide backend storage and declaration of directory realm 2014-08-16 16:10:35 -07:00
friendica
da982c6c9f here's the file but I'm less than 5% of the way through porting it. 2014-08-12 21:24:36 -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
a20a637727 merge upstream, slider work, refactor ping module, language selection work 2012-07-13 07:09:29 -07:00
friendica
94fabe3a29 upstream fixes and a lot of taxonomy stuff 2012-07-10 06:28:02 -07:00
Zach Prezkuta
528d250ded slightly better way of handling last loop 2012-07-05 19:08:30 -06:00
Zach Prezkuta
5dcce1ed93 add some timeouts to prevent deadlock 2012-07-05 19:01:13 -06:00
Zach Prezkuta
168ae40dd2 add rudimentary locking capability to Friendica functions 2012-07-05 14:26:42 -06:00
friendica
e29dd081ca render the recycle symbol correctly on Diaspora reshares 2012-07-04 22:44:04 -07:00
Zach Prezkuta
59ebe6f111 ok now I'm just making silly mistakes--take out premature function locking code 2012-06-23 22:28:28 -06:00
Zach Prezkuta
0877c5b687 use author handle instead of sender handle 2012-06-23 22:04:20 -06:00
Zach Prezkuta
90f8454190 allow linking to Diaspora's scaled-down images 2012-06-23 11:02:15 -06:00
Michael Vogel
a81af2e042 Merge remote branch 'upstream/master'
Conflicts:
	include/bb2diaspora.php
2012-06-23 12:50:00 +02:00
Michael Vogel
7a4ad4564d Diaspora: Messages are now looking better 2012-06-23 12:42:01 +02:00
Zach Prezkuta
73c6f40ebc create new signed text for relayables right when relaying them 2012-06-20 20:52:09 -06:00
Michael Vogel
3968e77f9e New function to convert bbcode to markdown. 2012-06-17 19:49:05 +02:00
Zach Prezkuta
3132ed2979 more cleanup 2012-06-16 10:45:26 -06:00
Zach Prezkuta
577cfdd314 some cleanup of obsolete code 2012-06-16 10:41:25 -06:00
Zach Prezkuta
0946c4a375 still need the original author information for comments and likes 2012-06-16 10:25:33 -06:00
Zach Prezkuta
09eb52810b update signature checking for relayables 2012-06-16 10:25:32 -06:00
Zach Prezkuta
9920fb39e5 Debugged implementation of Diaspora relayable_retractions
Diaspora "relayable_retraction" is now supported by Friendica.
The following should now work:

	Friendica top-level post:
	Diaspora comment deleted, disappears in Friendica
	Friendica comment deleted, disappears in Diaspora
	Diaspora like retracted, disappears in Friendica
	Friendica like retracted, disappears in Diaspora

	Diaspora top-level post:
	Same

There are still exceptions, however. First, Friendica and Diaspora
seem to frequently reject comments with an "invalid signature" error.
This can probably be fixed.

Also, some comments/likes/retractions seem to just disappear on the
Diaspora side. In the Diaspora log these seem to be accompanied by a
"not a valid object" error, often preceeded by a "received a comment
but no corresponding post" error. These seem to be purely internal,
since sometimes it works for some Diaspora contacts but not others.
2012-06-03 14:53:30 -06:00
Zach Prezkuta
06263f72a8 cleanup and logging 2012-06-03 14:53:30 -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