Commit Graph

380 Commits

Author SHA1 Message Date
Hypolite Petovan 5d4bafb116 Fix two additional uses of uid in Worker\Notifier 2019-01-22 08:31:39 -05:00
Hypolite Petovan 282bc01994 Fix using wrong uid for APDelivery in Worker\Notifier 2019-01-22 01:59:30 -05:00
Hypolite Petovan e7be87df93 Fix missing $ in front of variable names 2019-01-21 11:12:49 -05:00
Hypolite Petovan 3d839bb176 Move Contact::ACCOUNT_TYPE_* constants to User::ACCOUNT_TYPE_*
- Keep Contact::TYPE_* constants for comparison with contact.contact-type
2019-01-21 10:56:27 -05:00
Hypolite Petovan dbc6eb5422 Remove unused code in mod/
- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code
2019-01-21 10:53:32 -05:00
Hypolite Petovan 4a95ca280d Remove unused code
- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code
- Remove duplicate array keys
2019-01-21 10:48:40 -05:00
Hypolite Petovan d1c6ec9718 Update namespaces declaration in include/
- Remove unused use statements
- Add required use statements
2019-01-21 10:44:45 -05:00
Hypolite Petovan cb3f09ae4f Refactor namespaces
- Remove unused use statements
- Add required use statements
- Escape global classes
2019-01-21 10:43:42 -05:00
Hypolite Petovan 3282ce5389 Fix PHPDoc comments project-wide 2019-01-21 10:35:51 -05:00
Hypolite Petovan 55e54bb950 Replace deprecated Addon::callHooks with Hook::callAll
- Update documentation
2019-01-21 09:50:56 -05:00
Hypolite Petovan 895b3abf32 Remove/replace killme() with *exit() 2019-01-21 09:49:17 -05:00
Hypolite Petovan ff1f6564f9 Remove delivery queue done incrementation for mail delivery 2019-01-21 09:39:14 -05:00
Hypolite Petovan 1696ad962e Add delivery queue number manipulation
- Add new ItemDeliveryData model class
- Add queue_count initialization in Notifier
- Add queue_done incrementation in various Delivery tasks
2019-01-21 09:36:51 -05:00
Hypolite Petovan 8a0e4e12e1 Replace item_id by target_id in multimode delivery workers 2019-01-21 09:32:41 -05:00
Hypolite Petovan 1e6193a14e Refactor Worker/Notifier part 4
- Remove redundant $normal_mode flag
- Moved public message email recipient loop
- Simplify OStatus delivery
2019-01-21 09:31:57 -05:00
Hypolite Petovan 774609dd38 Refactor Worker/Notifier part 3
- Replace deprecated q() calls
2019-01-21 09:31:56 -05:00
Hypolite Petovan d0228b9b97 Refactor Worker/Notifier part 2
- Move self-removal in a sub-method in Worker/Notifier
2019-01-21 09:27:06 -05:00
Hypolite Petovan 507c215c76 Refactor Worker/Notifier part 1
- Rename variables
- Remove orphan, duplicate and one-use intermediary variables
- Initialize potentially missing variables
- Replace obsolete Addon::callHooks call
- Simplify Notifier::activityPubDelivery() signature
2019-01-21 09:27:05 -05:00
fabrixxm 8c75c26361 Use Model\Photo as much as possible
Most important is to use `Photo::delete()` to have backend
to remove data.
2019-01-21 09:12:28 -05:00
Michael 103b92fc48 Avoid that forum posts are received via the Diaspora protocol first 2019-01-19 12:30:16 +00:00
Michael d813d72b1a Simplyfies AP relaying, fixes relaying of public contacts 2019-01-17 23:06:27 +00:00
Michael 98d44ce7c7 The "]" had been at the wrong place 2019-01-17 05:32:06 +00:00
Michael fe0339dabe Fixing a bug, adding some logging 2019-01-16 22:19:41 +00:00
Michael c359c162a7 Issue 6282: Update the contact data regularly (including the network) 2019-01-16 21:39:56 +00:00
Michael 236c7718d3 Fixing some notice again 2019-01-13 09:44:04 +00:00
Michael 297a549590 Issue 6282: Update the forum status of contacts 2019-01-12 16:09:27 +00:00
Hypolite Petovan acaee626f5 Remove include/ requires that are now done directly from Composer 2018-12-24 09:56:25 -05:00
Hypolite Petovan b6e1571b1e Fix various notices 2018-12-15 04:32:47 -05:00
Michael a041c7c0fa Issue 6236: Handle account removal messages with very low priority 2018-12-06 10:04:16 +00:00
Michael Vogel 5a3991d4f7
Merge pull request #6219 from MrPetovan/task/remove-x
Remove x()
2018-12-01 23:40:51 +01:00
Andy H 14b4fac818 Fixing permanent deletion counter 2018-12-01 13:21:54 +07:00
Hypolite Petovan 458981f75c Replace x() by isset(), !empty() or defaults()
- Remove extraneous parentheses around empty() calls
- Remove duplicate calls to intval(), count() or strlen() after empty()
- Replace ternary operators outputting binary value with empty() return value
- Rewrite defaults() without x()
2018-11-30 09:06:22 -05:00
Michael ba1e385f86 Don't deliver to blocked domains 2018-11-22 22:09:22 +00:00
Michael 1e873a2815 Avoid a blocked workerqueue due to removed users 2018-11-12 05:03:12 +00:00
Michael 7458d793ed Removing some notices again 2018-11-11 12:15:17 +00:00
Adam Magness 218f0734be Rename removeTags to escapeTags
rename function and update calls.
2018-11-09 13:29:42 -05:00
Adam Magness 063f0e9cb0 Rename escapeTags to escapeHtml
rename function and update calls.
2018-11-09 13:27:58 -05:00
Adam Magness ffc406d819 normalise_link calls
implement normaliseLink function
2018-11-08 11:28:29 -05:00
Adam Magness 5276c28a78 link_compare calls
implement compareLink function.
2018-11-08 10:46:50 -05:00
Adam Magness 0e01568ccd escape_tags calls
implement escapeTags function
2018-11-08 10:20:03 -05:00
Adam Magness a0f65ca7a1 notags calls
implement removeTags function
2018-11-08 10:14:37 -05:00
Michael 3b565e80b6 Improved logger text 2018-11-05 20:35:17 +00:00
Michael ef205878b6 Cleaned up the notifier 2018-11-04 23:17:41 +00:00
Michael bd97215147 Merge remote-tracking branch 'upstream/develop' into diasppora-delivery 2018-11-04 18:54:49 +00:00
Philipp Holzer 26aee23254
Replacing dbupdate_ in admin.php and removing it from Worker\DBUpdate 2018-10-31 14:44:22 +01:00
Philipp Holzer e876adef8f
Moved the functions update_db and run_update_function to a Friendica\Core\Update class 2018-10-31 14:44:21 +01:00
Michael f7f96e971a Avoid duplicated delivery to Diaspora 2018-10-30 17:34:18 +00:00
Adam Magness 50da89d861 Logger Levels
update logger levels in calls
2018-10-30 09:58:45 -04:00
Adam Magness 14fde5dc9b Log function
implement log() function.
2018-10-30 09:57:14 -04:00
Michael 73f596cc46 Fixes duplicated transmissions and not working undo of like/dislike 2018-10-27 11:09:23 +00:00
Michael a6f6db8d4e Improve query speed 2018-10-24 04:50:27 +00:00
Michael c0a24d80dd Remove items more memory friendly 2018-10-24 04:46:45 +00:00
Tobias Diekershoff dbe49a0c1a
Merge pull request #5998 from annando/ap-queue
Unsuccessful ActivitiyPub transmission are now deferred
2018-10-23 06:54:11 +02:00
Michael e3e714a45f Unsuccessful ActivitiyPub transmission are now deferred 2018-10-23 03:54:18 +00:00
Hypolite Petovan dc35d2f2f3
Merge pull request #5997 from annando/notice-relocation
Fix a notice when sending relocation messages
2018-10-22 22:40:47 -04:00
Michael 3dc0bb5c4b Fix a notice when sending relocation messages 2018-10-23 02:24:24 +00:00
Hypolite Petovan e511790d62 Move NULL_DATE from boot.php to DBA::NULL_DATETIME
- Add DBA::NULL_DATE constant
2018-10-22 16:50:55 -04:00
Hypolite Petovan ca9cad3491 Move hook-related methods from Core\Addon to Core\Hook 2018-10-22 16:50:54 -04:00
Michael c4cc7a4afb The limit for dbclean is now configurable 2018-10-21 05:41:40 +00:00
Philipp Holzer 4392858662
Move Global Functions - Part 3
- Replaced every CACHE definition
- Moved check_url to App->checkURL()
- Removed unused definition "ZCURL_TIMEOUT"
2018-10-20 18:19:55 +02:00
Michael fea48fa85e AP: Transmitting and receiving with non AP contacts 2018-10-20 07:53:45 +00:00
Michael d307aa1484 For test purposes we can now deactivate polling 2018-10-18 02:46:02 +00:00
Hypolite Petovan e9c9eb9c66 Fix notice in Worker\Delivery 2018-10-16 18:26:43 -04:00
Michael 35a73b729f Onepoll hadn't polled anymore / small relocation in zrlinit for better logging 2018-10-16 13:17:01 +00:00
Michael efad4936b0 OStatus contacts are now automatically converted to AP 2018-10-13 18:13:01 +00:00
Philipp Holzer 7c73e8634c
Curl Response Refactoring
- refactored Network::post()
- replaced every Network::post() execution with the new Curl container
2018-10-10 21:15:26 +02:00
Philipp Holzer 2dec8895a9
Curl Response Refactoring
- extended Curl to parse Curl Response
- refactored Network::curl()
- replaced every Network::curl() execution with the new Curl container
2018-10-10 21:08:43 +02:00
Philipp Holzer 5a02e39a65
Rename App Methods
- renamed a lot of App methods to CamelCase
- replaced direct public variables with get-/set-Methods
2018-10-10 00:16:06 +02:00
Michael b5d73f840c AP fixes: LD-signature, wrong owner for completed thres, account removal 2018-10-09 05:04:24 +00:00
Michael 192c6c8d4f Preparation for suggestions under AP 2018-10-06 18:42:26 +00:00
Michael 6b374c32a2 Improved AP distribution / Only process trusted content 2018-10-06 13:16:52 +00:00
Michael f69c80b9e2 AP delivery is relocated to the top of the notifier 2018-10-06 03:16:38 +00:00
Michael 51dbffd396 Cache the AP delivery process 2018-10-05 21:00:40 +00:00
Michael 8841519c0d Renamed functions 2018-10-03 15:41:51 +00:00
Michael 3ab837f3c7 Functionality is now split 2018-10-03 09:15:38 +00:00
Michael 6020605d5c Account deletion could work now. 2018-10-01 19:22:13 +00:00
Michael 72c3a62e7f Profile update is now done via APDelivery 2018-10-01 05:44:56 +00:00
Michael 5456ef0185 Profile update and some more is now added 2018-09-30 20:26:30 +00:00
Michael 4699741f00 Fix delivery only for comments to native networks 2018-09-26 13:00:48 +00:00
Michael c083ae047c Merge remote-tracking branch 'upstream/2018.08-rc' into ap1 2018-09-22 15:18:53 +00:00
Michael 214407bdc8 Improve communication 2018-09-22 14:12:54 +00:00
Michael 0dbb6313a5 Hopefully fixes relocations that hadn't been executed 2018-09-22 06:47:35 +00:00
Michael 4c224fbddd Deliver everything to all receivers in the thread 2018-09-21 12:06:36 +00:00
Michael 59cd6611ec Direkt delivery is done 2018-09-21 05:41:18 +00:00
Michael 11310f4cf0 Relocated AP signature functions, reduced magic auth functions 2018-09-20 18:16:14 +00:00
Michael f772ece86f New delivery module for ap 2018-09-17 21:13:08 +00:00
Michael 699a4140f9 Now sending does finally work - and some AP standards are improved as well 2018-09-16 20:12:48 +00:00
Michael e4d28629e4 First posting tests 2018-09-16 17:47:00 +00:00
Michael e45206ae5d Merge remote-tracking branch 'upstream/2018.08-rc' into ap1 2018-09-15 20:49:46 +00:00
Michael 61e2c7d20d Added AP to many network conditions / enabling inbox processing 2018-09-14 16:51:32 +00:00
Michael 96d10c25e3 Issue 5733: Removing contacts does work now on the same machine as well 2018-09-12 06:05:14 +00:00
Michael 9ef1d827f3 Restore the behaviour to remove the remote contact upon termination 2018-09-05 05:02:06 +00:00
Michael 4fcae18289 Issue 5262: Comments to a forum post aren't distributed via push 2018-09-01 03:23:12 +00:00
Michael Vogel 49dad00570 Issue 5260: Ensure that user data is really deleted (#5666)
* Issue 5260: Ensure that user data is really deleted

* Missing files
2018-08-25 17:48:50 -04: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 54aee2aaa7 Removed notices that revealed themselfes over night ... (#5645)
* Removed notices that revealed themselfes over night ...

* And more notices removed that occured over night

* One more ..

* Some more notices of the day ...
2018-08-21 17:35:09 +02:00
Michael Vogel 16a081871c Improved profile page, improved "limit" handling (#5639)
* Improved profile page, improved "limit" handling

* Update will now work again

* Update will work now
2018-08-20 06:26:05 +02:00
Michael Vogel c1da44b7dc We now use a central function to fetch the importer (#5636) 2018-08-19 13:37:56 +00:00
Michael Vogel 7f3fb34c24 Some easy to replace "q" calls have been replaced by "DBA" calls (#5632)
* Some easy to replace "q" calls have been replaced by "DBA" calls

* Simplified the GUID creation

* And one in the API ...

* And OStatus has got some DBA calls more

* Just some more replaced database calls

* The event query is now simplified

* Events are now shown again

* subthread is now using the DBA calls as well

* Some more replaced database calls

* And some more replaced database calls and prevented notices

* Better use gravity

* Some more replaced database stuff

* Some more replaced database calls in DFRN.php

* The gcontact class now has got the new DBA functions as well

* The Contact class is now changed to new database functions as well

* Small correction

* We can now delete without cascade

* One more functionality is safe for future changes
2018-08-19 12:46:10 +00:00
Michael 6d852ff6fd Fix a fatal error when removing contacts 2018-08-15 09:27:25 +00:00