Commit Graph

3310 Commits

Author SHA1 Message Date
Mikael Nordfeldth 5c34369460 Don't use PEAR MIME lib when we have PECL fileinfo 2014-03-08 01:20:08 +01:00
Mikael Nordfeldth 0bc7d9c6c6 We sent a User object instead of Profile to InboxNoticeStream (thanks postblue) 2014-03-07 01:27:14 +01:00
Mikael Nordfeldth 4b2a66ed29 New mechanism for "all" feed (InboxNoticeStream)
Also cleaned up and made typing stricter for the stream, so only
profiles can be submitted. This reasonably also means we can create
"inbox" or "all" streams for foreign profiles as well using the same
stream handler (but of course only for messages we already know about).

To avoid looking up posts for a long time in a large notice database,
the lookback period for the inbox is no longer than the profile creation
date. (this matches the behaviour of Inbox)

Inbox class can probably be removed now.
2014-03-06 04:18:54 +01:00
Mikael Nordfeldth 4baaf7274c Spiffing up all.php and making it more profile:y 2014-03-05 01:17:34 +01:00
Mikael Nordfeldth fc047bd6e6 Minor code cleanup with group related actions (thanks brw12)
Originated from brw12 who noticed an incorrect variable name used in
an error message in actions/apigroupjoin.php:109
2014-03-01 12:01:17 +01:00
Mikael Nordfeldth 63102950b2 Compare to profile id of group, for backward compatibility 2014-02-23 21:28:52 +01:00
Mikael Nordfeldth 5487c596fc Remove callback sneakery by StatusNet 2014-02-23 14:57:12 +01:00
Mikael Nordfeldth 915d329b5a updating prepare and handle 2014-01-01 20:30:30 +01:00
Mikael Nordfeldth 4ab56f34dd Previous edit made translation notes incompatible 2014-01-01 20:09:11 +01:00
Mikael Nordfeldth df43684196 apparently not only regex 'https?' urls are sent 2014-01-01 19:47:49 +01:00
Mikael Nordfeldth 3552bf4d94 No pagination when no groups shown... :) 2013-11-04 16:57:30 +01:00
Mikael Nordfeldth f110fc5c9a Using GNUSOCIAL_VERSION instead of STATUSNET_VERSION 2013-11-01 13:51:41 +01:00
Mikael Nordfeldth 810495708d Version name strings updated, StatusNet only retained for copyright 2013-10-30 16:37:13 +01:00
Mikael Nordfeldth 8dafce34c3 LoginAction somewhat converted to FormAction 2013-10-30 12:23:10 +01:00
Mikael Nordfeldth 9b6633698c Group discovery from text functions polished
Also removed the entirely unused saveGroups function.

Now avoiding multiGet and using listFind in Profile->getGroups()
so we don't have to deal with ArrayWrapper.
2013-10-29 13:40:14 +01:00
Mikael Nordfeldth f8b49e69d0 Protected function prepare with array $args defaulting to array() 2013-10-29 10:26:46 +01:00
Mikael Nordfeldth 23a6b4595f Reworked the ActivityContext->attention structure
Removing Evan's obscure attentionType solution and directly using the attention array
2013-10-28 22:21:14 +01:00
Mikael Nordfeldth fcba540a14 Removed legacy OMB. Use OStatus for remote profiles. 2013-10-28 16:22:09 +01:00
Mikael Nordfeldth 362b6ad2fc ForceGroup and some qvitter API stuff still used staticGet 2013-10-25 13:20:53 +02:00
Mikael Nordfeldth a38ed0057a Moved jbfavre's Twitter card support to Twitter plugin
It was causing problems with an undefined TWITTER_SERVICE constant.
2013-10-22 20:35:03 +02:00
Mikael Nordfeldth a6c52c5ca7 Prepare the RepeatAction for modernisation (more OOP) 2013-10-21 23:27:09 +02:00
Mikael Nordfeldth 145fbf1130 Move nick updating of User entry to Profile->update()
Also, timezone and language in User table weren't indexes. So no need
to do them separately.
2013-10-17 16:38:42 +02:00
Mikael Nordfeldth 274b70784f When updating a User_group nickname, correlate Local_group and Profile
...no need to make a separate call to Local_group's setNickname all the time,
or a bunch of redundant code for the Profile table.

Next up is User->update()...
2013-10-17 13:49:20 +02:00
Mikael Nordfeldth 6ed66d9c76 Local_group and User are now assumed to be in same namespace 2013-10-17 01:27:01 +02:00
Mikael Nordfeldth db7ef52d13 Better use of Nickname validation functions
Nickname verifications on registration and updates for profiles (not yet
groups) have been improved.

Minor bugs in RegisterAction were also fixed, where multiple forms would
be outputed because the function did not return after showForm(). This
will be solved more permanently with throwing exceptions in the future.
2013-10-16 15:38:54 +02:00
Mikael Nordfeldth 080352b646 Minor changes to ApiCheckNicknameAction, syntax and exception handling mostly 2013-10-16 13:43:10 +02:00
Mikael Nordfeldth 29d0871e5a Making many of the API actions more consistent with coding style
clientError and serverError exit after they're done so no need for
break or return. Also, $this->format is default.

We also got rid of the incredibly verbose version of $this->isPost()
which was spread all over the place.

Not all of this cleaning up is done yet.
2013-10-15 03:07:40 +02:00
Mikael Nordfeldth ffdbd8d729 Now using common_local_url properly 2013-10-15 01:20:21 +02:00
Mikael Nordfeldth f46d675a20 GNU social is with a minor s. 2013-10-15 00:20:36 +02:00
Mikael Nordfeldth 9be368006c Naming stuff GNUsocial rather than StatusNet 2013-10-15 00:19:03 +02:00
Mikael Nordfeldth 6d739789f6 protected handle function without args for Action 2013-10-14 14:00:12 +02:00
Mikael Nordfeldth 390556d932 Remote Profile Action from ModPlus now more generic 2013-10-08 21:08:02 +02:00
Mikael Nordfeldth 1d8b19fe54 Let's not limit qvitter stuff to 'json' requests
Also, cleanup and report errors properly when we try unsupported media types.
2013-10-07 20:54:25 +02:00
Mikael Nordfeldth cf0570fc99 Cleaning up clientError and serverError 2013-10-07 19:56:45 +02:00
Mikael Nordfeldth ece8ba8ea4 Calling parent::handle in ApiCheckHubAction 2013-10-07 14:51:23 +02:00
Mikael Nordfeldth 8912cdc7a4 Validate::uri replaced with filter_var for HTTP[S] URL checks
Also, a bug in checking the OAuth callback URL for validity was fixed,
where it referenced the wrong variable when going through form data.
2013-10-07 14:46:09 +02:00
Mikael Nordfeldth 2c0790be54 Let the SearchEngine take care of the search, and showJsonTimeline is good enough for now
I bet JSONSearchResultsList is a good idea, but we have no immediate use of it right now.

And it's better if the SearchEngine can take care of all that jazz.
2013-10-06 23:09:57 +02:00
Mikael Nordfeldth 87370f0cb1 URL shortening can now be disabled for the 'maxurllength'
Also, URL shortening now consistently uses 'maxurllength'...
2013-10-06 22:35:49 +02:00
Mikael Nordfeldth 34a6624452 Qvitter API changes (thanks hannes2peer)
I implemented changes from quitter.se's new API that their front-end qvitter
uses, https://github.com/hannesmannerheim/qvitter/blob/master/api-changes-1.1.1/CHANGES

However I left out the URL shortening commens, since I believe whatever behaviour
they experienced that caused them to implement this was a bug (or many) and should
be fixed in their proper areas and that shortening should not be entirely left
out in API calls.
2013-10-06 21:51:50 +02:00
Mikael Nordfeldth fb94a16217 Moved Avatar retrieval into Avatar class
Backwards compatible functions are still in Profile class.
2013-10-06 15:55:06 +02:00
Mikael Nordfeldth 78f9629bf3 Moved shareLocation preference check to Profile class 2013-10-06 13:38:09 +02:00
Mikael Nordfeldth cc34bb48c7 OAuth related syntax fixes, nothing big
Making better use of class autoloading too.
2013-10-06 12:43:18 +02:00
Mikael Nordfeldth 48da97f204 MediaFile code improvements, preparing to implement multi-attachments
Maybe in the future we can use this for anonymous file uploads too?
With some kind of anonymous/pseudonymous profile. That'd be neat.
2013-10-05 18:47:45 +02:00
Mikael Nordfeldth 39f43e415d Do not name anything getOriginal (because DB_DataObject calls that)
Avatar->getOriginal has been renamed getUploaded
Notice->getOriginal has been renamed getParent
2013-10-02 15:01:11 +02:00
Mikael Nordfeldth 7979918ba9 Various minor Avatar fixes, but pretty necessary.
One typing thing. And a missed exception case.

Get src from displayUrl() instead of url for example.
2013-10-02 14:49:01 +02:00
Mikael Nordfeldth 1d46ca45d1 PHP Notice: Undefined variable: logo
It was reported in actions/apitimelinetag.php on line 142
2013-10-01 17:07:16 +02:00
Mikael Nordfeldth b0dfc70a54 Properly unlink all old avatars when deleting/uploading a new
We're also now using $config['image']['jpegquality'] to determine the
quality setting for resized images.

To set Avatar max size, adjust $config['avatar']['maxsize']

The getAvatar call now throws exceptions too. Related changes applied.
Now let's move Profile->avatarUrl to the Avatar class!
2013-10-01 17:00:10 +02:00
Mikael Nordfeldth a23c4aa236 Avatar resizing improvements and better code reuse
* getOriginal added to Avatar class
    This is a static function that retrieves the original avatar in a leaner
    way than Profile->getOriginalAvatar() did (see below).
    This will throw an Exception if there was none to be found.

* getProfileAvatars added to Avatar class
    This gets all Avatars from a profile and returns them in an array.

* newSize added to Avatar class
    This will scale an original avatar or throw an Exception (originally from
    Avatar::getOriginal) if one wasn't found.

* deleteFromProfile added to Avatar class
    Deletes all avatars for a Profile. This makes the code much smarter when
    removing all avatars from a user.
    Previously only specific, hardcoded (through constants) sizes would be
    deleted. If you ever changed lib/framework.php then many oddsized avatars
    would remain with the old method.

* Migrated Profile class to new Avatar::getOriginal support
    Profile class now uses Avatar::getOriginal through its own
    $this->getOriginalAvatar and thus remains backwards compatible.

* Updating stock GNU Social to use Avatar::getOriginal
    All places where core StatusNet code used the
    $profile->getOriginalAvatar, it will now useAvatar::getOriginal with
    proper error handling.

* Updated Profile class to use Avatar::newSize
    When doing setOriginal, the scaling will be done with the new method
    introduced in this merge.
    This also edits the _fillAvatar function to avoid adding NULL values to
    the array (which causes errors when attempting to access array entries as
    objects). See issue #3478 at http://status.net/open-source/issues/3478
2013-09-30 22:23:03 +02:00
Mikael Nordfeldth a0e107f17f Implemented WebFinger and replaced our XRD with PEAR XML_XRD
New plugins:
* LRDD
    LRDD implements client-side RFC6415 and RFC7033 resource descriptor
    discovery procedures. I.e. LRDD, host-meta and WebFinger stuff.

    OStatus and OpenID now depend on the LRDD plugin (XML_XRD).

* WebFinger
    This plugin implements the server-side of RFC6415 and RFC7033. Note:
    WebFinger technically doesn't handle XRD, but we serve both that and
    JRD (JSON Resource Descriptor), depending on Accept header and one
    ugly hack to check for old StatusNet installations.

    WebFinger depends on LRDD.

We might make this even prettier by using Net_WebFinger, but it is not
currently RFC7033 compliant (no /.well-known/webfinger resource GETs).

Disabling the WebFinger plugin would effectively render your site non-
federated (which might be desired on a private site).

Disabling the LRDD plugin would make your site unable to do modern web
URI lookups (making life just a little bit harder).
2013-09-30 22:04:52 +02:00
Joshua Judson Rosen 90858804bc Allow the hostmeta to indirect from one domain to another.
e.g.: rozzin@hackerposse.com => rozzin@status.hackerposse.com.
2013-09-29 23:13:45 +02:00