Commit Graph

358 Commits

Author SHA1 Message Date
hannes
1eba33590b ActivityVerb::SHARE instead of http://activitystrea.ms/schema/1.0/share 2015-11-22 20:26:08 +00:00
hannes
70695a1463 make sure the notice is a repeat, i.e. not a delete activity notice that also can have a repeat_of set 2015-11-22 18:59:56 +00:00
Mikael Nordfeldth
ec19661312 Can't use return-value in empty() 2015-10-04 22:31:07 +02:00
Mikael Nordfeldth
ad3b62cf2f ShowprofiletagAction now extends ShowstreamAction 2015-09-27 23:46:30 +02:00
Mikael Nordfeldth
6f62adedfc Infinite loop on CLI initiated profile deletion for local users
profile deleting user deleting profile deleting user...
2015-07-18 02:16:52 +02:00
Mikael Nordfeldth
9f82da07f1 ProfilesettingsAction and related stuff modernised 2015-07-17 12:20:11 +02:00
Mikael Nordfeldth
cfaaf3c13c PasswordsettingsAction aligned with FormAction
Also made some changes in the password "munging" function call
common_munge_password to accept a profile instead of user ID (which
was only there because stoneage StatusNet used the ID to generate a
not-very-random salt, but nowadays we primarily use AuthCrypt plugin).
2015-07-17 01:47:43 +02:00
Mikael Nordfeldth
a6e299a2fc OAuth stuff adapted for FormAction
TODO: Break OAuth out into a plugin.
2015-07-17 01:07:19 +02:00
Mikael Nordfeldth
f9d82a6ac5 Easy comparison of two Profile objects 2015-07-10 12:19:55 +02:00
Mikael Nordfeldth
e46b2803a7 Introducing TargetedRss10Action for simplifying RSS 1.0 2015-07-10 00:28:36 +02:00
Mikael Nordfeldth
fd121f371a case insensitive indexing for content and nick/fullnames (search)
This broke when changing the database to utf8mb4 instead of utf8,
since utf8_general_ci wasn't accepted and the engine fell back to
utf8mb4_bin. Now we're back in case insensitive search business!
2015-06-03 22:43:51 +02:00
Mikael Nordfeldth
b4b8cb57b3 slugify console.php prompt name
since PHP thought it was fun to crash on Quitter España and I
couldn't be bothered messing with readline
2015-05-30 16:40:00 +02:00
Mikael Nordfeldth
2b58d6b774 Merge branch 'quitagram' into nightly
Fixes that make quitagram work better amongst other things.
2015-04-22 22:17:50 +02:00
Mikael Nordfeldth
7601e10b6a getFullname function on Profile class
No need to fix it for User since we shouldn't use that mostly.
2015-04-22 20:57:05 +02:00
Mikael Nordfeldth
88411fb1ca ImageFile should not have an $id set if not a File 2015-03-10 23:52:50 +01:00
Mikael Nordfeldth
ce91f1c0e6 Hide posts from users with private_stream in scoping streams
For example the public timeline would show notices from a user with
private_stream configured. (previously it would only hide _new_ notices
by this user as they would be the only ones with notice scoping set).
2015-02-24 22:59:58 +01:00
Mikael Nordfeldth
0590f2975e Merge branch 'utf8mb4' into nightly
Conflicts because of urlhash fixes:
	classes/File.php
	classes/File_redirection.php
	classes/File_thumbnail.php
2015-02-19 20:50:40 +01:00
Mikael Nordfeldth
901a825b61 Non-functional "retweeted to me" API call modified (but not fixed)
For some reason the "retweeted to me" part of the Twitter API was removed
when Evan made some inbox changes back in the StatusNet days. We might
recover this functionality, but not yet. The proper function calls are
however fixed in this commit.
2015-02-17 16:48:24 +01:00
Mikael Nordfeldth
2f86cd8602 utf8mb4 conversion on database with index adjusts 2015-02-12 18:18:55 +01:00
Mikael Nordfeldth
4eea68e557 getConfigPref for globally configurable fallbacks 2015-02-03 21:58:17 +01:00
Mikael Nordfeldth
c8e0000c49 a group's Profile will now correctly update group original avatar 2015-01-27 13:37:50 +01:00
Mikael Nordfeldth
12058c30b4 Managed_DataObject->updateWithKeys throws its own exception 2015-01-25 12:54:08 +01:00
Mikael Nordfeldth
4917a422a1 updateKeys -> updateWithKeys (w/ functionality) 2015-01-25 12:07:26 +01:00
Mikael Nordfeldth
fac9f4e545 Merge branch 'nightly' of gitorious.org:social/mainline into nightly 2015-01-21 23:45:49 +01:00
Mikael Nordfeldth
5653c25641 Add simpler delete preference for Profile and User 2015-01-21 23:00:33 +01:00
Mikael Nordfeldth
68143ff916 DirectMessage moved into a plugin, not done yet
We still have to move some API calls into the new plugin.
2014-11-07 15:53:35 +01:00
Mikael Nordfeldth
7589e78817 multiGet instead of listFind, subs now in order!
It was desired that subscriptions were listed in an order
with the latest first.
2014-10-25 17:57:20 +02:00
Mikael Nordfeldth
8aa783241d Profile activityobject array outputs "summary" field 2014-08-07 21:54:31 +02:00
Mikael Nordfeldth
eb2f93ad2b More use of Profile, less User 2014-07-28 09:34:46 +02:00
Mikael Nordfeldth
b5fd2a048f Shortcut to Profile_prefs get/set Data in Profile and User 2014-07-13 16:49:35 +02:00
Mikael Nordfeldth
1d981b826a ActivityObject::fromProfile implemented in Profile 2014-07-02 18:39:53 +02:00
Mikael Nordfeldth
7e597ea7cc More Favorite pluginification (favecount, cache, menus(favecount, cache, menus)) 2014-06-28 14:03:30 +02:00
Mikael Nordfeldth
c8c6bf9a1c Simplify functions regarding locally cached profiles etc. 2014-06-06 00:32:07 +02:00
Mikael Nordfeldth
1217cd59bf Non-dynamic user and group fetching in Profile 2014-06-06 00:07:32 +02:00
Mikael Nordfeldth
90cc6b4d3b Notice::getReplyTo more specific now (getInlineReplyTo) 2014-06-04 23:20:20 +02:00
Mikael Nordfeldth
1431bbd884 No need to pre-resize avatars 2014-06-03 01:52:42 +02:00
Mikael Nordfeldth
49fa34e234 Make Profile::fromUri use UnknownUriException 2014-05-26 15:05:14 +02:00
Mikael Nordfeldth
34b570352f Fix Direct Message functionality. 2014-04-29 20:37:58 +02:00
Mikael Nordfeldth
5fd6053220 Code cleanup and enabling User object's etc. getUri() 2014-04-28 14:08:42 +02:00
Mikael Nordfeldth
5e4a275220 Clear Attentions when notice or profile is removed 2014-03-06 14:43:36 +01:00
Mikael Nordfeldth
f323f234d7 Better typing for isSubscribed 2014-03-05 13:44: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
20bd0c1136 getStreamName will now return nick/fullname based on current user's preferred representation 2013-10-30 13:05:04 +01:00
Mikael Nordfeldth
09ef1fff69 NoticeListItem attentions showed double for User_group
...because they each have their own Profile now! Whiie!
2013-10-30 12:56:17 +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
2dfa0bfcee function delete in dataobjects now don't break strict syntax 2013-10-29 10:20:57 +01:00
Mikael Nordfeldth
3ba6374b9d Memcached_DataObject extensions got their update functions more consistent 2013-10-28 19:36:05 +01:00
Mikael Nordfeldth
9ea57e5cb2 getAcctUri function added with related exception
Used in ActivityObject for Atom Title generation.

New events:
    * StartGetProfileAcctUri
    * EndGetProfileAcctUri
2013-10-28 18:21:10 +01:00
Mikael Nordfeldth
fcba540a14 Removed legacy OMB. Use OStatus for remote profiles. 2013-10-28 16:22:09 +01: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
4e8d7795d0 Moved favoriteNotices from User to Profile class 2013-10-15 02:15:58 +02:00
Mikael Nordfeldth
fdbb528e7a getTaggedSub-stuff moved to Profile class 2013-10-15 02:00:27 +02:00
Mikael Nordfeldth
390556d932 Remote Profile Action from ModPlus now more generic 2013-10-08 21:08:02 +02:00
Mikael Nordfeldth
1d1951d4b0 common_sql_now() is recommended 2013-10-08 11:40:23 +02:00
Mikael Nordfeldth
9ddc40b6da NoResultException returns the failed object 2013-10-08 00:21:24 +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
ac819e5738 fillAvatars would avoid the *ProfileGetAvatar events 2013-10-06 03:01:43 +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
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
cced063e47 Fixed regression in latest Avatar fixes
I thought typing would fix it, but there's a problem earlier in the
execution chain which will be fixed in the future.
2013-09-30 22:49:47 +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
Mikael Nordfeldth
63306081bc Subscription "get by" functions now don't use ArrayWrappers
They were getting in the way of some strict-typing stuff.
2013-09-21 18:38:14 +02:00
Mikael Nordfeldth
93e878d7ca Make better use of Subscription class
removed lib/subs.php as it was essentially only a wrapper for Subscription
2013-09-19 17:29:05 +02:00
Mikael Nordfeldth
a35344eb00 instanceof instead of is_a is faster (thanks quix0r) 2013-09-19 16:40:16 +02:00
Mikael Nordfeldth
8140c4ff90 Bad call to joinAdd in Profile.php 2013-09-16 22:36:44 +02:00
Mikael Nordfeldth
99312c8cc2 Declaring some more static functions properly
As a bonus I added type declaration on Profile_block::exists and
Subscription::exists respectively.
2013-09-09 23:28:20 +02:00
Mikael Nordfeldth
747fe9d59b Tidying up getUser calls to profiles and some events
getUser calls are much more strict, and one place where this was found was
in the (un)subscribe start/end event handlers, which resulted in making the
Subscription class a bit stricter, regarding ::start and ::cancel at least.
Several minor fixes in many files were made due to this.

This does NOT touch the Foreign_link function, which should also have a more
strict getUser call. That is a future project.
2013-09-09 23:03:34 +02:00
Mikael Nordfeldth
79e3acf0f0 Moved multiGet into Managed_DataObject 2013-08-29 10:38:11 +02:00
Mikael Nordfeldth
fac7371179 pivotGet moved into Managed_DataObject 2013-08-29 10:13:07 +02:00
Mikael Nordfeldth
0785cc2469 Don't use DB_DataObject::factory (statically at least)
Not all instances of this has been fixed, but at least the ones
in the base class of Memcached_DataObject.

Avatar fix (in classes/Profile.php) requires a pkeyGet function
in the Avatar class (or as in this tree, the parent class of
Managed_DataObject)
2013-08-19 11:40:35 +02:00
Mikael Nordfeldth
861e838add pkeyGet is now static and more similar to getKV
Memcached_DataObject now defines
   * pkeyGetClass to avoid collision with Managed_DataObject pkeyGet
   * getClassKV to avoid collision with Managed_DataObject getKV
2013-08-18 15:42:51 +02:00
Mikael Nordfeldth
2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Mikael Nordfeldth
1a9a8ea730 staticGet for sub-Managed_DataObject classes now calls parent
The parent class for our database objects, Managed_DataObject, has a
dynamically assigned class in staticGet which objects get put into,
leaving us with less code to do the same thing.

We will probably have to move away from the DB_DataObject 'staticGet'
call as it is nowadays deprecated.
2013-08-12 19:46:44 +02:00
Evan Prodromou
3fc1d245a1 Merge 1.1.x into master 2013-07-16 10:57:06 -07:00
Joshua Wise
c5a710e081 Escape $tag passed to Profile::getTaggedSubscribers()
This patch escapes the $tag parameter in
Profile::getTaggedSubscribers(). The parameter is not escaped either
in actions/subscriptions.php or in actions/apiuserfollowers.php. So
there is a potential for SQL injection here.
2013-07-16 10:14:38 -07:00
Evan Prodromou
1c3c269ab4 cache key for member_ids 2012-07-04 14:39:26 -04:00
Evan Prodromou
642b1044cc Better user group member queries 2012-07-04 14:12:11 -04:00
Evan Prodromou
04ad0838be Add spam-training, spam-reviewing rights
Replaced the check for a moderator role in certain spam-training and
-reviewing points. Make sure modhelpers can check, too.
2012-03-25 13:18:16 -04:00
Evan Prodromou
3b09465fc4 flush anonymous scope when a profile is silenced 2012-03-22 11:37:59 -04:00
Evan Prodromou
cd3bc8f4ef correct groups from Profile::getGroups() 2011-09-30 11:38:06 -04:00
Zach Copley
ba4bda9beb Fix display of group admin avatars 2011-09-30 00:57:54 +00:00
Evan Prodromou
699a90f11c Show Event attendees in mini-list 2011-09-29 15:12:30 -04:00
Evan Prodromou
88c00facc8 fix getOtherTags() to not use joinAdd() 2011-09-27 10:51:02 -04:00
Evan Prodromou
8fa816c324 don't use potentially bad Profile values 2011-09-22 16:29:31 -04:00
Evan Prodromou
2c1911bfae Short-circuit bugs by defining Profile::getProfile() 2011-09-18 19:29:23 -04:00
Evan Prodromou
48625da04b Automatically add or drop fulltext indexes 2011-09-18 18:28:44 -04:00
Zach Copley
3bf3b6686c Remove fulltext indexes from notice and profile tables. The default
for fulltext search is 'like' (MySQLLikeSearch) which doesn't require
them.
2011-09-18 14:17:41 -07:00
Evan Prodromou
51764be5a1 For fave count, don't use distinct 2011-08-27 18:21:44 -04:00
Dan Scott
db9ac1a531 Issue #546: enable case-insensitive searching in MySQL
MySQL needs the collation utf8_general_ci to support case-insensitive
searching. lib/mysqlschema.php already supports a 'collate' attribute on
a per-column basis, so we just need to take advantage of that attribute
on the columns we want to search and Bob (and BOB, and bOB) is your
uncle.

Signed-off-by: Dan Scott <dan@coffeecode.net>
2011-08-27 16:36:58 -04:00
Evan Prodromou
f81c1f7554 use an array of profiles rather than a looping cursor for profile lists 2011-08-27 12:53:15 -04:00
Evan Prodromou
34a0525b67 Profile uses joinAdd() with explicit arguments 2011-08-26 11:48:40 -04:00
Evan Prodromou
9ca3c3d1c3 move core schema to class files 2011-08-22 17:52:02 -04:00
Evan Prodromou
5081c56ea4 remove some debugging stuff in Profile::fillAvatars() 2011-08-02 13:14:11 -04:00
Evan Prodromou
af49545e95 reduce the number of calls to get profile groups 2011-08-02 12:14:55 -04:00
Evan Prodromou
06e2422517 pre-fill avatars for Profiles in a notice list 2011-08-02 11:54:27 -04:00
Evan Prodromou
a3ef80941e use multiGet() for a profile's groups 2011-08-01 15:18:29 -04:00
Evan Prodromou
874f1db389 Pre-fill profiles in notice streams 2011-08-01 14:51:59 -04:00