Commit graph

788 commits

Author SHA1 Message Date
friendica
2f4ef7660c improved route mismatch detection. We will be less strict about the absolute route matching and only look at the last hop before it got to us - which is ultimately all we should care about (since that sender controls the thread permissions). Route mismatches seem to occur somewhat frequently from yamkote (for unknown reasons), and the logging has been improved a bit so it should provide some slightly more useful debugging info in case it still happens going forward. Oh, also we'll set the parent on comments when we store the initial post (item_store()) and only go back and set the parent for top-level posts. This should reduce the number of comments with missing parents on shared hosts, but may increase the number of missing threads. Probably worthwhile to do a query occasionally for parent = 0 and see how we're doing and how many have shared host related delivery issues. 2015-01-27 15:47:24 -08:00
friendica
168b67fa41 correct some activity object types (for comments), also fix a foreach warning resulting from recent tag work 2015-01-14 18:36:23 -08:00
friendica
25e090148d federate consensus items (in network only). Work in progress. 2015-01-14 14:15:04 -08:00
friendica
7090b58f68 check mentions against the appropriate xchan_url and not a hard-coded /channel/ string 2015-01-13 20:54:27 -08:00
friendica
66cef7531a don't wipe out the item body of a linked item to a photo when doing a normal delete and not forced 2015-01-12 16:36:10 -08:00
friendica
cdc52ba884 change deletion behaviour of linked photo items. Previously deleting the visible item in the conversation deleted the photo as well. Now photos must be deleted in the photos module. Deleting the linked item removes any attached conversation elements (likes, etc.) and sets the conversation item to hidden. This may create an issue in the future if we move the photo tags, title, or other photo elements to the linked item rather than the photo. Noting here so this can potentially be discovered and remembered at that time. 2015-01-12 16:27:27 -08:00
Stefan Parviainen
adc9564b5c Refactor mention code to make it more reusable 2015-01-12 20:01:07 +01:00
marijus
978d78b953 basic changes for file activity 2015-01-09 15:18:45 +01:00
friendica
aa490a39bb include channel clones in PM deliveries (also some whitespace edits) 2015-01-08 16:02:15 -08:00
Habeas Codice
ab5bf1b7d6 prevent database hackery from leaking over the wire 2014-11-22 11:54:40 -08:00
friendica
03a457ed83 more logging for zot_feed anomalies 2014-11-20 18:44:16 -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
friendica
af9015c8ed place holder 2014-11-17 18:29:57 -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
55f64c3736 tgroup_check - decrypt if obscured before checking body text for reshares 2014-11-07 13:06:56 -08:00
friendica
a6d8c3193a various UI issues related to having an enormous number of entries in the posted_date selector including years/months that had no posts 2014-11-03 14:49:03 -08: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
ce8a891682 doh - this needs to be markdown, not bbcode 2014-10-24 14:18:02 -07:00
friendica
1c4bbbd13e diaspora walltowall comment signature, force update. 2014-10-23 16:08:29 -07:00
Thomas Willingham
f29c5a35f1 Provide comment box for PERMS_AUTHED items. Presently only commentable from owners wall. 2014-10-23 21:50:53 +01:00
friendica
58c692e389 improved wall-to-wall detection for comments so we can handle Diaspora signing and wall-to-wall attribution correctly.
Do it at the point of submission. This also fixes a potential bug in yesterday's wall-to-wall permission setting,
if it was a local comment to a remote post.
2014-10-22 20:39:49 -07:00
friendica
d7cb5c0436 you've gotta' be on your toes to catch this bug... though it's been here for about 2 1/2 years and even survived a rewrite. Symptoms are that the archive widget only lists one month (the month when you first posted), and only if your first post was written between the 28th and 31st of whatever month that was. 2014-10-22 16:41:06 -07:00
friendica
ed7712cfbf private forum issues 2014-10-21 16:33:35 -07:00
friendica
4bf758cc5b content deletion issue 2014-10-12 01:40:48 -07:00
friendica
b5f91d7b40 missing source route after edit 2014-10-10 14:45:18 -07:00
friendica
4634049549 allow (our own) ajax urls to pass through bbcode intact. 2014-10-09 20:59:33 -07:00
friendica
6806888fa4 return of the missing diaspora wall-to-wall attribution 2014-10-09 03:36:50 -07:00
RedMatrix
98af2de9b4 Merge pull request #626 from habeascodice/master
regex missing terminator char
2014-10-08 23:30:24 +11: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
habeascodice
e62a95aaba regex missing terminator char 2014-09-29 15:41:47 -07:00
friendica
d8c03526ed optionally include wall items (posts) in import/export 2014-09-25 20:21:23 -07:00
Thomas Willingham
e75f1ccb2e Typo 2014-09-25 19:47:06 +01:00
friendica
24d402941f if no rss/atom element author, use feed level contact 2014-09-24 14:27:18 -07:00
friendica
c76b8febaa make it the default 2014-09-24 02:18:13 -07:00
friendica
95470a9f9b one step closer 2014-09-24 02:08:35 -07:00
friendica
be54f0d9e6 more testing 2014-09-24 01:58:24 -07:00
friendica
87b8e2725c just an experiment - don't do anything with this until I'm finished with it. 2014-09-24 01:45:57 -07:00
friendica
81ee35e03b fix url mismatches of a single trailing slash for feed author/owner comparisons; update diaspora_compat 2014-09-23 20:55:22 -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
09b5bbb032 feeds with '@' in the URL were being handled as webfinger addresses and didn't fall through to RSS discovery. Issue #599 2014-09-21 14:46:12 -07:00
friendica
87a6f25769 try to sort out walltowall translation for diaspora recipients 2014-09-19 02:22:24 -07:00
friendica
a1b66f56f0 use the more portable encoded_item format for exported items - but with added attributes so we can use it as a reasonably complete item backup. The encoded_item format gives us extended author and owner information in case we need to probe them to bring the entry back. It also contains taxonomy entries. Importing and/or recovering will best be accomplished in chunks. It could take some time and some memory to chew through this. 2014-09-16 03:33:48 -07:00
friendica
6be6b41a42 privacy issue - restrictive stream permission setting with a non-targetted post cannot be enforced on remote networks. Restrict these posts to zot network. 2014-09-14 17:07:39 -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
3a10956b20 correct item author for feeds with multiple or different authors 2014-09-11 17:27:49 -07:00
friendica
de89bdc45f encrypt diaspora_meta since it may contain private message contents 2014-09-10 19:02:00 -07:00
friendica
537f101554 encode rss message-id's - warning this will double store all existing rss feed items and probably make a mess of things 2014-09-09 16:28:33 -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
715417c0e3 import_profile_photo array warnings 2014-09-08 16:06:15 -07:00
friendica
1e5e70fcf4 import_author_rss not succeeding, missing url 2014-09-04 19:15:01 -07:00
friendica
955567fe5f unset item_nocomment when starting a new delivery chain 2014-09-04 18:52:37 -07:00
friendica
e426f48a26 oops forgot about the privacy exclusion 2014-09-04 18:06:59 -07:00
friendica
ca2bf76b06 allow stuff with Diaspora authors to federate in zot conversations even if the local site has diaspora disabled. This way it won't look like folks are talking to themselves. 2014-09-04 01:13:01 -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
688722de5b fix phantom attachments in feeds 2014-09-01 20:59:53 -07:00
friendica
148f4e8795 issue #578 - this won't fix old items but should work going forward. The extra time slop shouldn't be needed and will in fact result in possibly undesired redundancy. 2014-09-01 19:55:43 -07:00
friendica
2a37d99958 get out the sunnies 2014-08-31 22:15:00 -07:00
friendica
a63de472cf various rss fixes 2014-08-31 20:51:05 -07:00
friendica
45c35d97b8 doc change - read it. 2014-08-30 22:53:21 -07:00
friendica
e9bf742cc7 insecure network filter 2014-08-30 17:03:26 -07:00
friendica
88f8900ac5 various diaspora issues 2014-08-29 17:31:40 -07:00
friendica
ae3047791c when updating the commented timestamp on the parent post (item_store) don't include any time travelling posts. They can mess up the conversation sort order in a big way until they're actually published. 2014-08-28 17:25:00 -07:00
friendica
53b5cf7f50 Ability to close comments at a certain date/time - needed for loom.io emulation (and many other uses) 2014-08-28 16:56:13 -07:00
friendica
f526a10f07 let's make this "specific" since that's what it is. 2014-08-28 04:14:49 -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
56e8b2b971 add "any connections" to can_comment_on_post() - was missing 2014-08-23 15:22:26 -07:00
friendica
5d2dc4e8fd switch everything over to crypto_encapsulate() 2014-08-23 02:45:21 -07:00
friendica
255ab8e9c9 issue #573 - this may not fix everything in that issue but should resolve some of it. 2014-08-22 18:01:21 -07:00
friendica
38f931618c "false" issue 2014-08-22 17:34:18 -07:00
friendica
2dc705d9a0 issue #571 - use feed/nickname?top=1 2014-08-22 15:51:48 -07:00
friendica
831714f0f0 profile edit - missing visibility and drop link on non-default profiles, re-arrange order of replacing red#matrix smilie so it works correctly, accept a post with body content of '0' which was interpreted by x() as nothing (was treated as integer). 2014-08-21 16:46:24 -07:00
friendica
b4aed12129 extensible profiles - add the input form elements. Still needs styling and we're not yet storing the results. And right now we're ignoring the type and only doing type=string. Oh yeah - and I split off starting the second delivery chain into its own function in tag_deliver since it was largely duplicate code. 2014-08-20 23:01:25 -07:00
friendica
a169e5c4f3 restructure the author and owner info from feeds 2014-08-20 18:35:36 -07:00
friendica
b102986929 greatly simplify consume_feed() - a lot of this was friendica specific and somebody may want to put some of it back in, but we'd be much better off building a zot compatible feed for friendica (hint,hint) - even if it didn't support the other protocol bits. Special purpose feed handlers for things like likes, dislikes, events, and community tags are better handled as zot arrays. We have all those handlers. We just need to pass them a JSON message instead of an XML/Atom message. Handlers for statusnet follow messages are another casualty. That's easy to bring back - but we need to keep driving nails into the XML coffin or the damn zombies will get out. 2014-08-20 04:38:17 -07:00
friendica
0fef39a326 fangs bared 2014-08-19 22:47:11 -07:00
friendica
0c8866acde snakebite continued 2014-08-19 21:31:33 -07:00
friendica
55d4ceb7e0 also reset comment policy on alternate delivery chains 2014-08-19 17:51:45 -07:00
friendica
8b5627e777 make sure privacy scope is completely reset on second delivery chain - revert if there are forum issues, this is subtle and complicated 2014-08-19 17:47:32 -07:00
friendica
9ab12929d7 implement max_import_size 2014-08-09 23:38:33 -07:00
friendica
1397c6f994 booboo 2014-08-09 15:21:15 -07:00
friendica
e9caf9db6a a couple of "not quite public" fixes 2014-08-08 15:27:17 -07:00
friendica
a7d95108d0 cleanup some text where we said "public" or "visible to anybody on the internet" when that isn't necessarily true. 2014-08-07 18:22:50 -07:00
friendica
640dbdf5e9 a bit more cleanup and a bug fix or two for the new private post security model 2014-08-07 17:14:11 -07:00
friendica
2cff122d6f public scope delivery issues 2014-08-06 21:16:24 -07:00
friendica
86bccf35a2 basic 'notpublic' bits working 2014-08-06 19:24:46 -07:00
friendica
afac379177 first step first - just store the public_policy data, don't do anything with it yet. 2014-08-06 17:36:07 -07:00
friendica
5a5190f2ff add an encoding type to formatted zot communication structures so that we can later add alternate encodings. 2014-07-24 15:55:01 -07:00
friendica
1accf82bd1 clean up more code duplication 2014-07-14 21:21:24 -07:00
friendica
233e4e1363 remove some code duplication 2014-07-14 01:38:16 -07:00
friendica
ee3a4902de when deleting items, delete linked events and photos during stage1 2014-07-04 20:34:54 -07:00
friendica
ee6fd1d6e5 minor optimisation 2014-07-01 21:24:43 -07:00
friendica
8b545d91db notification being sent for comments from blocked connections on same site. 2014-06-26 16:24:53 -07:00
friendica
223ed4a6c5 process profile like removals with normal low_level drop_item 2014-06-23 01:22:58 -07:00
Alexandre Hannud Abdo
b20887995a Implements a new permission level PERMS_PENDING
With this a user can allow some action to any user which connects
to them, even before they've connected back.

Ref.
https://mobiliza.org.br/display/478d9e71eaf55748dc646d3990651d6d34cfb7db5c38360538ec730ca3ccf908@zothub.com

Also some code cleanup and an alternative logic for handling
notifications of permission changes in zot.php.

This assumes that private posts are still restricted to people in
your addressbook. Regardless of your global permissions, a
pending channel won't get private posts, even if the post
only has a deny clause not matching the pending channel.
2014-06-19 15:13:32 -03:00
friendica
35d42f8626 access control modification functions (item specific - we may need these for several data types) 2014-06-17 19:21:46 -07:00
friendica
72f00d6e04 issues with editing webpage permissions 2014-06-15 18:58:02 -07:00
friendica
b67c8ec8b9 webpage permissions weirdness 2014-06-14 16:35:38 -07:00
friendica
8084fed851 poke notifications 2014-06-04 22:15:52 -07:00