Commit graph

83 commits

Author SHA1 Message Date
friendica
ce953e2f41 syncing connections issue, incorrect return_url after deleting connection 2015-01-07 14:35:03 -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
4c8036f530 endless scroll on connections page 2014-09-10 23:08:24 -07:00
friendica
82eb265a20 add collections widget to connections page - and some more work on realms 2014-08-17 17:48:41 -07:00
friendica
b19176169c provide a specific permission for liking profiles (reuse the obsolete bookmark permission), also remove the unused 'unconnected contacts' view for now. 2014-07-17 20:54:30 -07:00
marijus
b7b8303f8d fix active state 2014-06-14 15:49:57 +02:00
sasiflo
b472cc0fd3 ifpending repaired again. Hope it works as intended now. 2014-05-04 20:42:05 +02:00
friendica
3da4656e41 hopefully this will fix it 2014-05-04 03:11:28 -07:00
sasiflo
3f9513010f ifpending repaired. Show page "all contacts" directly if no pending connections.
Tried to repair. Think the merge of flags was wrong in the last
commit.
2014-05-04 11:41:31 +02:00
friendica
9026ea649a better mapping of visible connections 2014-04-14 17:29:19 -07:00
friendica
7d429b2894 subdue archived connections in mod/connections 2014-04-06 22:21:51 -07:00
friendica
75b6aa235e more work on #395 2014-04-06 21:40:23 -07:00
friendica
32e71cf06b finish "ifpending" connections 2014-04-04 17:43:44 -07:00
friendica
97f0424b18 introduce a connection type called 'ifpending' for number 6 of issue #395 - so that we can still have an unconditional 'pending' link. Needs testing before integrating with the nav menu 2014-04-04 16:56:49 -07:00
friendica
86d60f572f change flags for one-way connections from hidden to unconnected so we can still use hidden for - well hiding connections 2014-03-04 14:35:42 -08:00
friendica
429022e116 allow one to ignore pending connections 2014-02-28 16:00:29 -08:00
friendica
b5728fa42e fixes to thing profile assignments 2014-02-11 16:56:39 -08:00
friendica
c4d0884596 accept new connection broke yesterday 2014-02-03 14:03:43 -08:00
friendica
bccc20f38c default photo issue, and connections page showing deleted accounts. Also show last updated on connedit page 2013-12-19 19:16:46 -08:00
friendica
825492407e more comanche 2013-12-19 02:35:45 -08:00
friendica
38fd8410eb split off mod_connections into mod_connections & mod_connedit - lots of links to fix 2013-12-18 01:00:08 -08:00
friendica
50731fa6a6 bring back the collection edit sidebar widget on the connection edit page until I sort out Comanche on that page. 2013-12-16 13:34:34 -08:00
friendica
aaf21e8924 slight mod of connections widgets 2013-12-09 18:31:13 -08:00
friendica
00f4ee2717 migrate follow widget to comanche and remove obsolete mod/intro.php 2013-12-09 00:12:44 -08:00
friendica
082ac67778 suggestion widget tweaked to make it comanche capable. Remove old versions of specs that are so obsolete it isn't funny. Zot protocol reference is in red's github wiki, and in the code. We should move the github copy to /doc once it is updated to match the code. There's no point in documenting dfrn in the red code base. 2013-12-08 20:08:50 -08:00
friendica
6d3aebb483 add suggestions to a couple of other pages 2013-12-06 21:45:36 -08:00
friendica
d9f67876dc refactor magic-auth 2013-12-02 15:15:02 -08:00
friendica
d1ab865ccf make the template processor (e.g. replace_macros) pluggable 2013-11-28 19:17:45 -08:00
friendica
f2435ed4cd follow and accept_follow hooks 2013-11-21 17:49:14 -08:00
friendica
8cdbd0e2a6 make default group for new connections work 2013-11-21 17:31:37 -08:00
friendica
06e0272db8 populate some posts when somebody is granted "read stream" permission 2013-11-17 16:50:32 -08:00
friendica
9158909fa3 return a login form on some protoected pages if not logged in. 2013-11-02 23:56:29 -07:00
Thomas Willingham
ced0a9ab74 Don't set widgets if you're not a local user. 2013-11-02 21:11:43 +00:00
friendica
1354702d69 remove the disabled flag on individual permissions and improve the text to show that settings may be inherited. The reason for this change is that we want the individual settings to be stored regardless of the inherited settings, because if somebody changes the higher precedence privacy settings it could leave all their existing contacts with no permissions and this could be a support nightmare.
So this way if somebody starts off with "anybody on the network can send me their stream and posts" and later changes it to "only specific connections can send me their stream and posts", the individual setting will already be set for all their connections. The previous behaviour is that this setting would have been disabled so none of their existing connections will have this specific permission. Old-timers who were here and made lots of connections before this commit - will have to edit all their connections if they change their privacy settings from lesser restrictive to be more restrictive.
2013-10-13 15:42:30 -07:00
friendica
a06f1f9594 Issue #158 2013-09-29 02:47:36 -07:00
friendica
7bb9289921 Preparatory work for photo conversations (third time). Also take away unused "post new activity" preferences until they actually do something. 2013-08-27 21:06:11 -07:00
friendica
c17f7124f3 not able to drop pending connections 2013-08-15 01:32:09 -07:00
friendica
89ad8ad80f string parse error extracting one particular string 2013-08-09 04:00:34 -07:00
friendica
1b7b53f409 don't show connections with removed xchans - as there isn't much to see 2013-08-04 05:12:11 -07:00
friendica
852f102ba3 minor - change nav_set_selected() to only highlight intros if on that particular connections page and not for any connections page. 2013-08-01 20:10:03 -07:00
marijus
47de80ead4 make "selected" class work on all navigation menu items 2013-08-01 13:26:57 +02:00
friendica
7f87da68ba the rest of the heavy lifting on clone sync - now we're down to some log messages and a whole lot of testing 2013-07-25 22:57:06 -07:00
friendica
3d95fcb7cd more work on clone sync 2013-07-25 16:00:04 -07:00
friendica
6e880cfd49 use current channel photo for favicon where applicable - might be browser dependent but seems to work on FF 2013-07-07 17:22:40 -07:00
friendica
8369a8a755 progress on multiple profiles, doing it the old way. I don't think we're going to be able to do it the new way - way too complicated. 2013-07-03 01:50:39 -07:00
friendica
b9466941e7 more work on channel sync 2013-06-26 17:31:02 -07:00
friendica
156cf592ee more nomadic clone sync 2013-06-26 14:28:11 -07:00
friendica
5c1f959c18 set default contact affinity back to 99 - we'll solve the other problem another way, this one is flawed 2013-05-24 06:02:30 -07:00
friendica
bb31e6bd6a make 90 the default closeness when humans are involved in the process 2013-05-23 16:51:08 -07:00
friendica
d72d30fabb more permissions descriptive text to lessen confusion 2013-05-21 17:13:51 -07:00