Commit Graph

233 Commits

Author SHA1 Message Date
Michael 86bd283705 The whole contact handling does work now, yeah ... 2018-09-15 20:31:05 +00:00
Michael 6a8ebc8639 Contact follow and unfollow workd partially 2018-09-15 18:54:45 +00:00
Roland Häder 61693419e8 Cleanups: isResult() more used, readability improved (#5608)
* [diaspora]: Maybe SimpleXMLElement is the right type-hint?

* Changes proposed + pre-renaming:
- pre-renamed $db -> $connection
- added TODOs for not allowing bad method invocations (there is a
  BadMethodCallException in SPL)

* If no record is found, below $r[0] will fail with a E_NOTICE and the code
doesn't behave as expected.

* Ops, one more left ...

* Continued:
- added documentation for Contact::updateSslPolicy() method
- added type-hint for $contact of same method
- empty lines added + TODO where the bug origins that $item has no element 'body'

* Added empty lines for better readability

* Cleaned up:
- no more x() (deprecated) usage but empty() instead
- fixed mixing of space/tab indending
- merged else/if block goether in elseif() (lesser nested code blocks)

* Re-fixed DBM -> DBA switch

* Fixes/rewrites:
- use empty()/isset() instead of deprecated x()
- merged 2 nested if() blocks into one
- avoided nested if() block inside else block by rewriting it to elseif()
- $contact_id is an integer, let's test on > 0 here
- added a lot spaces and some empty lines for better readability

* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)

* Rewrites:
- moved PAGE_* to Friendica\Model\Profile class
- fixed mixure with "Contact::* rewrite"

* Ops, one still there (return is no function)

* Rewrite to Proxy class:
- introduced new Friendica\Network\Proxy class for in exchange of proxy_*()
  functions
- moved also all PROXY_* constants there as Proxy::*
- removed now no longer needed mod/proxy.php loading as composer's auto-load
  will do this for us
- renamed those proxy_*() functions to better names:
  + proxy_init()           -> Proxy::init()         (public)
  + proxy_url()            -> Proxy::proxifyUrl()   (public)
  + proxy_parse_html()     -> Proxy::proxifyHtml()  (public)
  + proxy_is_local_image() -> Proxy::isLocalImage() (private)
  + proxy_parse_query()    -> Proxy::parseQuery()   (private)
  + proxy_img_cb()         -> Proxy::replaceUrl()   (private)

* CR request:
- moved all PAGE_* constants to Friendica\Model\Contact class
- fixed all references of both classes

* Ops, need to set $a here ...

* CR request:
- moved Proxy class to Friendica\Module
- extended BaseModule

* Ops, no need for own instance of $a when self::getApp() is around.

* Proxy-rewrite:
- proxy_url() and proxy_parse_html() are both non-module functions (now
  methods)
- so they must be splitted into a seperate class
- also the SIZE_* and DEFAULT_TIME constants are both not relevant to module

* No instances from utility classes

* Fixed error:
- proxify*() is now located in `Friendica\Util\ProxyUtils`

* Moved back to original place, ops? How did they move here? Well, it was not
intended by me.

* Removed duplicate (left-over from split) constants and static array. Thank to
MrPetovan finding it.

* Renamed ProxyUtils -> Proxy and aliased it back to ProxyUtils.

* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Ops, was added accidentally ...

* Ops, why these wrong moves?

* Ops, one to much (thanks to MrPetovan)

* Ops, wrong moving ...

* moved back to original place ...

* spaces added

* empty lines add for better readability.

* convertered spaces -> tab for code indenting.

* CR request: Add space between if and brace.

* CR requests fixed + move reverted
- ops, src/Module/*.php has been moved to src/Network/ accidentally
- reverted some parts in src/Database/DBA.php as pointed out by Annando
- removed internal TODO items
- added some spaces for better readability
2018-08-24 01:05:49 -04:00
Michael Vogel 116bcae6ab Fix: Wrong array element / added logging for DFRN connects (#5609) 2018-08-14 03:15:39 +02:00
Roland Häder e06fc2aa69 Stopped using deprecated constants NETWORK_* (#5537)
* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Removed deprecated NETWORK_* constants as per code reviewer's request.
2018-08-11 22:40:44 +02:00
Roland Häder 4a22710b3b Moved global PAGE_* to Profile class (#5500)
* Rewrites:
- moved PAGE_* to Friendica\Model\Profile class

* Fixed more rewrites from plain (global namespace) PAGE_* to Friendica\Models\Profile class

* CR request:
- moved all PAGE_* constants to Friendica\Model\Contact class
- fixed all references of both classes

* CR request:
- moved ACCOUNT_TYPE_* constants from boot.php to Contact::ACCOUNT_TYPE_*

* Just copy-pasted this code from boot.php, needs to be changed to `const ACCOUNT_TYPE_FOO = x;`

* Ops, melting brain cells here ... :-/
2018-07-27 19:25:57 -04:00
Roland Häder 37253656e3 Moved CONTACT_* constants to Friendica\Model\Contact class, lesser in global namespace (#5490)
* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)
2018-07-24 22:53:46 -04:00
Hypolite Petovan a6fb3568f9 Rename dbesc to DBA::escape 2018-07-23 15:30:54 -04:00
Hypolite Petovan ecea7425f8 Rename DBA::is_result to DBA::isResult 2018-07-23 11:04:14 -04:00
Hypolite Petovan 0ec44f3e8a Rename DBM method calls to DBA method calls 2018-07-23 11:02:24 -04:00
Hypolite Petovan af6dbc654f Rename Friendica\Database\dba to Friendica\Database\DBA 2018-07-20 08:19:26 -04:00
Hypolite Petovan daa1177e3a Update use statement lists with new Friendica\Database\dba class
- Remove unused use statement
- Remove superfluous use statements (classes in the same namespace)
- Add missing use statements
2018-07-19 22:15:21 -04:00
Michael c70ebadd7d Issue-3412 related: Don't send connection posts anymore 2018-05-19 19:34:51 +00:00
Michael c214353a5d Issue 4819: The introduction note is now stored displayed on the contact page. 2018-05-19 15:29:34 +00:00
Michael 4ad655ab80 Replace old database queries with the new ones 2018-05-02 19:26:15 +00:00
Hypolite Petovan 5e7285b9ba Move Temporal::convert() to DateTimeFormat::convert() 2018-02-03 08:56:55 -05:00
Hypolite Petovan 8aff8a76eb Add Temporal::utcNow() 2018-02-03 08:56:52 -05:00
Hypolite Petovan dc366bf1f7 Refactor datetime_convert into Temporal::convert
- Changed parameter order to save space
- Refactor select_timezone into Temporal::getTimezoneSelect
- Refactor field_timezone into Temporal::getTimezoneField
2018-02-03 08:56:51 -05:00
Michael 7b27dda784 Most functions now moved from include/items.php 2018-01-28 11:18:08 +00:00
Adam Magness 9b8599b619 Move functions to system
move some functions to system
2018-01-27 11:59:10 -05:00
Adam Magness f04d40a37e Review update
Rename function, move others
2018-01-27 11:13:41 -05:00
Adam Magness ca76e49c23 Move remaining functions
update remaining function calls
2018-01-27 08:25:54 -05:00
Adam Magness cd3643d174 Move xml_status and http_status_exit
move functions
2018-01-26 23:37:55 -05:00
Adam Magness a32ba32ff4 Move post_url
move post_url function
2018-01-26 23:24:23 -05:00
Adam Magness f0725ae384 Hopefully all t()
hopefully the last of the t()
2018-01-22 18:03:26 -05:00
Adam Magness d49f986d1e Many t() calls
modify many t() calls.
2018-01-22 18:03:26 -05:00
Michael 034d46196f "last-child" is not used anymore 2018-01-18 06:54:44 +00:00
Hypolite Petovan f588adb511 Fix formatting in dfrn_confirm
- Add missing braces
- Use dba::selectFirst whenever possible
- Initialize missing variables
- Remove unused variables
- Use defaults instead of ternary operator
- Simplify sprintf(t()) structure
2018-01-13 23:46:58 -05:00
Adam Magness 9e6bf79380 Crypto to src
move Crypto to src and Friendica\Util namespace
2017-12-30 11:51:49 -05:00
Hypolite Petovan 4fe8dab08d Remove include/group.php 2017-12-09 13:45:54 -05:00
Hypolite Petovan abdecd2b2f Use new Model methods for groups 2017-12-09 13:45:17 -05:00
Hypolite Petovan fe89e7760e Fix formatting all around 2017-12-09 13:42:02 -05:00
Hypolite Petovan a42595a30c Move Object\Contact to Model\Contact 2017-12-07 23:56:12 -05:00
Michael Vogel 5747cfc79c
Revert "Move Objects to Model" 2017-12-08 05:21:51 +01:00
Hypolite Petovan 18d93cddf6 Move Object\Contact to Model\Contact 2017-12-07 09:04:24 -05:00
Adam Magness 0373056448 Review and Use statements
use statements and review changes.
2017-11-29 17:29:11 -05:00
Adam Magness 0091d318e5 Function names
Update function names and corresponding function calls
2017-11-29 12:17:12 -05:00
Adam Magness 54827e7fed Photo to src
Move Photo to Friendica\Object namespace and replace require_once statments with use statements.
2017-11-29 07:52:27 -05:00
Adam Magness 609a4de5d0 src Standards
This basically completes coding standards changes for the entire src directory, with the exception of App.php
2017-11-23 14:01:58 -05:00
Michael 8cd21269ff The last of the big workers moved ... delivery and notifier 2017-11-19 18:59:55 +00:00
Adam Magness 4ca68c7af0 Class file relocations
Issue #3878
2017-11-08 08:37:03 -05:00
Adam Magness 6189f6c8e7 Relocate class files from /include to /src/
dbm, Diaspora, dfrn, and NotificationsManager moved to namespace. Includes and references in files updated.
2017-11-08 08:36:48 -05:00
Adam Magness 0dfa57948f Issue-#3873
Replace deprecated functions with new syntax.
2017-11-07 06:24:39 -05:00
Michael 478e363967 proc_run was replaced 2017-11-05 12:15:53 +00:00
Michael c636b0a6b2 We can now unfollow a contact without deleting it 2017-09-12 06:08:24 +00:00
Michael 5adfeb0bd5 App::get_baseurl is now replaced with System::baseUrl 2017-08-26 07:32:10 +00:00
Michael 3c24bed412 New class "System" 2017-08-26 06:04:21 +00:00
Hypolite Petovan 36e515ee6d Move Probe to src 2017-05-07 14:44:30 -04:00
Hypolite Petovan 82b423c5ac Fix require_once format 2017-05-07 14:40:23 -04:00
Hypolite Petovan 20043914e6 Move App to src
- Add `use Friendica\App;` wherever needed
2017-05-02 22:59:36 -04:00
Roland Häder 49527b70d3 Merge branch 'develop' into rewrites/coding-convention-split2 2017-04-01 22:16:08 +02:00
Michael f6d7ee2781 Issue 3142: mcrypt is no more (as well as phpseclib) 2017-04-01 08:28:42 +00:00
Roland Häder 830af774d3
added more curly braces + a bit more usage of dbm::is_result()
Signed-off-by: Roland Häder <roland@mxchange.org>
2017-03-21 21:50:45 +01:00
Hypolite Petovan 7b352f3f74 Revert "Coding convention applied - part 1" 2017-03-21 12:02:59 -04:00
Roland Häder 0cd241bcbe
added spaces + some curly braces + some usage of dbm::is_result()
Signed-off-by: Roland Häder <roland@mxchange.org>
2017-03-19 00:44:40 +01:00
Roland Häder 3849e7c9ff
added more curly braces + a bit more usage of dbm::is_result()
Signed-off-by: Roland Häder <roland@mxchange.org>
2017-03-19 00:40:47 +01:00
Michael 53393233c3 Replace the direct access of config variables 2017-01-17 19:21:46 +00:00
Hypolite Petovan 8a197055e3 Normalize App parameter declaration (mod folder, 1 out of 3) 2017-01-09 23:12:54 +11:00
Roland Häder 20e71d21a6 Merge branch 'rewrites/app_get_baseurl_static' into develop
Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	mod/admin.php
	mod/bookmarklet.php
	mod/community.php
	mod/contacts.php
	mod/crepair.php
	mod/editpost.php
	mod/events.php
	mod/install.php
	mod/lostpass.php
	mod/network.php
	mod/notify.php
	mod/suggest.php
	mod/uexport.php
	mod/videos.php
	view/theme/duepuntozero/config.php
	view/theme/frio/config.php
	view/theme/quattro/config.php
	view/theme/vier/config.php
2016-12-22 11:37:23 +01:00
Roland Häder ad20c5504d Merge remote-tracking branch 'upstream/develop' into rewrites/app_get_baseurl_static
Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	include/diaspora.php
	object/Item.php
2016-12-22 11:33:00 +01:00
Roland Häder c0df692f5f Merge remote-tracking branch 'upstream/develop' into develop
Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	include/diaspora.php
	object/Item.php
2016-12-22 11:29:56 +01:00
Hypolite Petovan e8e1f9253d Merge remote-tracking branch 'friendica/develop' into bug/fix-diaspora-people-links
# Conflicts:
#	include/follow.php
2016-12-20 12:50:36 -05:00
Hypolite Petovan 4a7c3b9eef Diaspora: Fix class name case + add self 2016-12-20 12:44:15 -05:00
Roland Häder de689583e2 added more curly braces + space between "if" and brace
Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	mod/admin.php
2016-12-20 17:58:34 +01:00
Roland Häder 4b221d216e added more curly braces + space between "if" and brace
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 17:57:40 +01:00
Roland Häder 4805aa8fdb Don't cherry-pick:
- reverted dbm::is_result() to count()

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 16:28:23 +01:00
Roland Häder 51716957b2 converted more to dbm::is_result() + added braces/space
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 15:37:27 +01:00
Roland Häder 65e1cd728c Coding convention:
- added curly braces
- added space between "if" and brace

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 10:40:09 +01:00
Roland Häder a5e4882e25 Coding convention:
- added curly braces
- added space between "if" and brace

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 10:35:28 +01:00
Roland Häder abff6372dd Coding convention applied:
- space between "if" and brace
- curly braces on conditional blocks

Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	include/lock.php
2016-12-20 10:12:31 +01:00
Roland Häder fb676335db Coding convention applied:
- space between "if" and brace
- curly braces on conditional blocks

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 10:10:33 +01:00
Roland Häder 884f44ce94 *much* more usage of App::get_baseurl() instead of $a->get_baseurl() (coding convention applied)
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-19 14:27:16 +01:00
Roland Häder c75d6ad850 More dbm::is_result() instead of count()
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-14 12:03:02 +01:00
Roland Häder 46d383369c Cleanup for #3010 - added spaces, thanks to @annando .
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-14 09:41:33 +01:00
Roland Häder 6a8a36f12d More usage of dbm::is_result($r) instead of count($r):
- count() returns very different results and never a boolean (not even false on
  error condition).
- therefore you should NOT use it in boolean expressions. This still *can* be
  done in PHP because of its lazyness. But it is discouraged if it comes to
  more clean code.

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-13 10:44:13 +01:00
rabuzarus ac39928e5d upload connection graphics & update doxygen headers to insert link to the spec 2016-11-28 16:23:47 +01:00
Michael Vogel 668da905e2 "proc_run" is now called with priority. 2016-08-01 07:48:43 +02:00
Michael Vogel f27bc00464 Remove obsolote functions 2016-07-09 20:09:09 +02:00
Michael Vogel d6a79abb68 Bugfix: "default_group" behaviour wasn't implemented correctly 2016-04-13 22:21:23 +02:00
Michael Vogel 206c26ae30 Merge remote-tracking branch 'upstream/develop' into 1602-diaspora 2016-03-21 06:47:47 +01:00
Michael Vogel 8f00836ffb Add the guid to items that we create locally 2016-03-20 15:01:50 +01:00
Michael Vogel 56cb6cc897 Removed just more old diaspora function calls. 2016-03-14 20:53:44 +01:00
Michael Vogel 8752ec11b2 Central function for default group, special setting for OStatus 2016-03-06 13:15:27 +01:00
fabrixxm b202e02fbf Revert "Updated modules to allow for partial overrides without errors"
This reverts commit db949bb802.
2016-02-07 15:11:34 +01:00
Andrej Stieben db949bb802 Updated modules to allow for partial overrides without errors
Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.
2016-02-05 21:52:39 +01:00
Michael Vogel 78e79de7c9 New central function to store avatar data in contacts 2016-01-28 11:09:08 +01:00
Michael Vogel 6f662b8c74 New avatar picture fields to better cope with changing avatars 2016-01-28 01:26:19 +01:00
Michael Vogel ab0fbc3a65 Bugfix: Unidirectional Diaspora connect request have to be followers - not sharers 2015-10-10 04:56:40 +02:00
Michael Vogel 0e895e24f7 Code reworks: replaced hardcoded network text with the corresponding constants. 2015-04-11 22:14:56 +02:00
fabrixxm 1bdddebd44 connection confirm notification mail via notification()
remove unused email templates
add a check for unexpected reponse from server
2014-09-06 17:28:46 +02:00
Michael Vogel 6e7bd68ebb More "LIMIT 1" removed - and some other SQL improvements. 2014-03-11 23:52:32 +01:00
Zach Prezkuta bce29054b9 allow Smarty use on international templates 2013-01-10 21:46:48 -07:00
friendica 4ab363ed71 bypass smarty wherever using intltext_templates (install, register, friend confirmation emails, etc.) 2013-01-07 20:14:00 -08:00
friendica 07ba4da634 email header encoding everywhere 2013-01-04 15:47:29 -08:00
Zach Prezkuta e684324032 use explicit include paths 2012-12-28 14:51:50 -07:00
friendica 7f3813e9b0 service class basics 2012-06-24 00:56:27 -07:00
friendica 88a0d6a1d5 private group tests, cont. 2012-05-29 22:57:15 -07:00
friendica bb4712b171 bug #434 - default group placement not working after accepting dfrn friend request 2012-05-25 18:06:51 -07:00
friendica afaf9ec74f rev update 2012-05-20 18:30:02 -07:00
friendica 5ecaeb8e5c catch more places to apply default group 2012-05-18 01:03:46 -07:00