Commit Graph

2215 Commits

Author SHA1 Message Date
Mikael Nordfeldth
7e388e697d fallback to local URL if reply->getUrl() is missing
Remote Activity notices generally don't have a proper HTTP URL associated.
2015-06-02 13:55:13 +02:00
Mikael Nordfeldth
0726dcd06c Start using NoParentNoticeException more widely 2015-06-02 13:50:52 +02:00
Mikael Nordfeldth
c84b21008e Notice->getParent code reuse
...not entirely sure whether to allow getParent calls on Notice
objects which have not been created, but we'll leave that in for now...
2015-06-02 13:46:23 +02:00
Mikael Nordfeldth
2096c18e57 use array_key_exists instead of empty to test array key 2015-06-02 13:14:57 +02:00
Mikael Nordfeldth
82f9b6908c Fake recovery by email address, to hide registrants on the site 2015-05-30 23:29:58 +02:00
Mikael Nordfeldth
731d283159 Password recovery logic cleaned up 2015-05-30 23:18:17 +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
3294d704a4 scripts/nukefile.php for blasting crap from the server
Deletes notices and the locally stored file based on File id, as
you may want to just get rid of shit sometimes.
2015-05-30 15:41:04 +02:00
Mikael Nordfeldth
f926e27a65 urlhash will _be_ NULL on update, so NOT NULL won't work 2015-05-27 22:37:20 +02:00
Mikael Nordfeldth
c31d6608a8 remove _all_ file URLs not just the duplicates 2015-05-27 21:54:51 +02:00
Mikael Nordfeldth
cd0b70dbc1 upgrade fix for file URLs longer than 191 chars 2015-05-27 21:31:29 +02:00
Mikael Nordfeldth
6b717a6a69 Throw exception if Local_group has no corresponding User_group 2015-05-26 13:14:26 +02:00
Mikael Nordfeldth
925aacec1a Throw exception when a Conversation is not found 2015-05-26 13:11:08 +02:00
Mikael Nordfeldth
d010c5a581 magnet URL linkify support 2015-05-09 15:54:09 +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
c5715bc756 File_to_post indexing and cleaning preparations 2015-04-15 23:25:12 +02:00
Mikael Nordfeldth
eefef44378 filename is never used for indexing so let's make it text
varchar is pretty limited so let's avoid it if we can
2015-04-10 22:16:44 +02:00
Mikael Nordfeldth
0bd16b521c OpportunisticQM shouldn't try to handle what it can't find 2015-04-09 12:15:34 +02:00
Mikael Nordfeldth
5081477e95 enclosures in Atom were not included 2015-04-05 20:24:17 +02:00
Mikael Nordfeldth
f6432fdf48 File_thumbnail->getUrl now gives Attachment_thumbnail action URL
That in turn redirects to the statically stored file.
2015-04-03 21:21:39 +02:00
Mikael Nordfeldth
2821be2bce Notice properties set in bad order on activityobject saving 2015-03-12 22:17:08 +01:00
Mikael Nordfeldth
5a235ffbf9 Event fixes for activityhandlerplugin 2015-03-12 21:53:44 +01:00
Mikael Nordfeldth
1adf5f2863 Merge branch 'nightly' into repeat_as_shareplugin 2015-03-12 20:54:06 +01:00
Mikael Nordfeldth
3ee673ac91 ImageFile->resize now totally replaced with resizeTo 2015-03-12 20:47:07 +01:00
Mikael Nordfeldth
20f8dd6565 Repeats shown in threaded noticelist now handled by plugin 2015-03-12 19:49:20 +01:00
Mikael Nordfeldth
6f0f8cd6c7 Initial work on making the Share verb handled in plugin 2015-03-12 12:27:49 +01:00
Mikael Nordfeldth
2a32af084f ImageFile $id argument is only for File objects
Remember to eliminate the Avatar/group logo call to ImageFile->resize!
2015-03-11 00:20:48 +01:00
Mikael Nordfeldth
6f76c8b59d Same as last commit, don't give ID if it's not for a File object 2015-03-11 00:14:14 +01: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
aa27c45230 Notice class got exception throwing getById
Less code, more happy.
2015-03-09 17:33:20 +01:00
Mikael Nordfeldth
286b54e527 Use getUrl() on File and File_thumbnail instead of ->url 2015-03-04 13:13:20 +01:00
Mikael Nordfeldth
a4af51b5ba Move thumbnail algorithm mainly to ImageFile class 2015-03-04 13:12:42 +01:00
Mikael Nordfeldth
284705eeb8 Subscription_queue::start does not mean Subscription exists 2015-03-04 11:49:54 +01:00
Mikael Nordfeldth
ec4e432d55 Subscription::ensureStart skips AlreadyFulfilledException
Sometimes we just want to accept the user's wrong, but when it comes
to remote APIs etc. we probably want to let the client know it has
done something already (in this case multiple identical subscription
requests - which might indicate to it that it should refresh the sub
lists or something).
2015-03-04 11:38:04 +01:00
Mikael Nordfeldth
bece816ec7 User class throws exception on register failure 2015-03-01 12:36:19 +01:00
Mikael Nordfeldth
caa0dd549e Avatar table url field now 'text', maybe use filename as unique key? 2015-02-28 12:56:42 +01:00
Mikael Nordfeldth
8fac7a9f6c StatusNet class renamed GNUsocial
also added backward compatible StatusNet class for the two calls I know
third party plugins use, isHTTPS and getActivePlugins
2015-02-27 12:44:15 +01:00
Mikael Nordfeldth
7e6ba94241 Documentation + filename uniqueness in File class 2015-02-25 15:19:27 +01:00
Mikael Nordfeldth
9a843548c0 Save thumbnails with proper extension
This might cause double extensions, but that's ok since the filename
is stored in the database. We might want to look at it later though.
2015-02-25 01:34:00 +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
060dbe1b56 Removing whitespace and creating an early-return in inScope 2015-02-24 22:44:43 +01:00
Mikael Nordfeldth
325e784ccd Don't store duplicates of files.
If a new file is uploaded, it will be matched with a previously uploaded
file so we don't have to store duplicates. SHA256 is random enough and
also unlikely enough to cause collisions.
2015-02-24 21:11:25 +01:00
Mikael Nordfeldth
0e6c83e521 Had to avoid using indexes in the migration phase
File and File_redirection still had their indexes in the temporary migration table definition.
2015-02-19 22:06:43 +01:00
Mikael Nordfeldth
b54710950f unique keys and indexes must be NOT NULL or MySQL fucks up
If this merge throws exception on scripts/upgrade.php and you recently
tried a nightly (i.e. during 2015-02-19) then just go back a commit or two
and try again.

Or delete the duplicate entries. Find the entries like this:

SELECT COUNT(*), urlhash FROM file_redirection
    GROUP BY urlhash
    HAVING COUNT(*) > 1;

then for each urlhash (or come up with a smart SQL query) do:
DELETE FROM file_redirection WHERE urlhash='hashfrompreviousquery' LIMIT 1;

You'll have to remove duplicates more than once if you have >2 identical
urlhash entries. LIMIT -1 might do that for you. I'm not sure.
2015-02-19 21:21:39 +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
5471c65c9a less newlines for the scripts/upgrade.php output 2015-02-19 19:40:36 +01:00
Mikael Nordfeldth
e299583eee Bad check on existing urlhash key 2015-02-19 19:36:59 +01:00
Mikael Nordfeldth
8ac8e2e734 Use new ::getByUrl for File and File_redirection
and make use of the exceptions instead endless if statements
2015-02-19 19:29:55 +01:00
Mikael Nordfeldth
c05e9b118c function is hashurl, variable is urlhash 2015-02-19 19:07:43 +01:00
Mikael Nordfeldth
45dc76de26 File and File_redirection adhoc storage methods updated for urlhash 2015-02-19 19:05:24 +01:00
Mikael Nordfeldth
0dfe39ac87 File_thumbnail url is not an index 2015-02-19 18:59:13 +01:00
Mikael Nordfeldth
27480d8e8e File_redirection also got urlhash column 2015-02-19 18:34:48 +01:00
Mikael Nordfeldth
176bde269f Merge branch 'nightly' into file_urlhash 2015-02-19 18:13:09 +01:00
Mikael Nordfeldth
94e19e1ac6 escapedTableName for SQL query easy access 2015-02-18 12:15:46 +01:00
Mikael Nordfeldth
5a8f24eb46 urlhash first steps, including scripts/upgrade.php 2015-02-17 18:55:12 +01:00
Mikael Nordfeldth
61aa71ed34 Subscription class gets exception throwing getSubscription function 2015-02-17 17:15:47 +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
Chimo
56d431320d Replace one instance of LOG_ERR with LOG_DEBUG 2015-02-09 18:08:46 -05:00
Mikael Nordfeldth
3a41dc4610 Merge commit 'refs/merge-requests/37' of https://gitorious.org/social/mainline into merge-requests/37 2015-02-08 23:21:28 +01:00
Chimo
e02bd34d26 Populate 'created' property on attention
The 'created' column in attention SQL table has NOT NULL
restriction.
2015-02-08 14:47:03 -05:00
Mikael Nordfeldth
427a6e39ee added non-critical FIXMEs 2015-02-08 15:33:14 +01:00
Mikael Nordfeldth
59bbc81c4b updateWithKeys did not always COMMIT transactions 2015-02-08 15:17:50 +01:00
Mikael Nordfeldth
f7548ed7e9 cacheKey change for Status_network class
From statusnet to gnusocial.
2015-02-05 12:06:01 +01:00
Mikael Nordfeldth
6b638b8e13 User class also needs getConfigPref 2015-02-03 22:04:29 +01:00
Mikael Nordfeldth
4eea68e557 getConfigPref for globally configurable fallbacks 2015-02-03 21:58:17 +01:00
Mikael Nordfeldth
40416c2c69 Don't email users who are sandboxed
If sandboxed or silenced, don't email the user any notifications.
2015-02-03 11:41:20 +01:00
Mikael Nordfeldth
a5d27d9ce7 /main/all will give a network-wide public stream
Qvitter had implemented this as a "PublicAndExternal" stream, but
I figured we might as well put it into the GNU social core.
2015-01-28 20:25:39 +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
67d09532dd Improved animated image thumbnail freedom of choice
Default is now to take still thumbnails of animated GIFs and then
show them as originals in an AttachmentListItem. The still frames
are mostly used with front-ends like qvitter.
2015-01-26 16:33:39 +01:00
Mikael Nordfeldth
9f9af9a139 Only report local URLs for local groups 2015-01-26 12:10:15 +01:00
Mikael Nordfeldth
a8e613e508 Animated GIF restructuring, ImageMagick only used for resizing animated sequences. 2015-01-25 23:00:00 +01:00
Mikael Nordfeldth
2a7d45c986 No need for ImageMagick to detected animated GIF 2015-01-25 22:45:25 +01:00
Mikael Nordfeldth
470971cf47 File_thumbnail uses file_id as PRI 2015-01-25 13:13:01 +01:00
Mikael Nordfeldth
12058c30b4 Managed_DataObject->updateWithKeys throws its own exception 2015-01-25 12:54:08 +01:00
Mikael Nordfeldth
998afe1844 updateWithKeys reworked to more reliable execution
Throws exception on UPDATE fails.
2015-01-25 12:29:28 +01:00
Mikael Nordfeldth
4917a422a1 updateKeys -> updateWithKeys (w/ functionality) 2015-01-25 12:07:26 +01:00
Mikael Nordfeldth
e38d78eba9 updateKeys (for classes with PRI id) now in Managed_DataObject 2015-01-25 11:58:35 +01:00
Mikael Nordfeldth
8fbdb45cc6 Primarily the getUrl call is fixed. Also some new class calls
The getUrl call would think that a File_thumbnail object was the child
of a local File if its filename was set. That has been true up to recent
development code where a File_thumbnail can have a 'filename' value,
but the original File does not. Only look at the File object to indicate
whether it's a local or remote file!
2015-01-25 02:32:57 +01:00
Mikael Nordfeldth
97bf470895 File class improved debugging and filename generation
In some development code I noticed that when handling File objects without
filename values, there would be problems calling getPath and such.

The width and height value testing will be validated later anyway, and by
removing such a narrow test we can use events to generate thumbnails of
media formats supported by recently added plugins on demand.
2015-01-25 02:30:43 +01:00
Mikael Nordfeldth
93377e1c24 Allow fallback to local URL on Notice->getUrl()
To avoid verbose exception handling in other parts of the code.
2015-01-23 12:39:08 +01:00
Mikael Nordfeldth
3119341aea Prefer local URLs for all locally generated notices. 2015-01-23 12:37:27 +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
305c9f33a7 Registration coding cleanup
Mainly there was an Undefined variable: code in apiaccountregister.php
2015-01-18 13:06:12 +01:00
Mikael Nordfeldth
3927acdde5 getUrl() fixed for File and File_thumbnail to correct http/https stuff and other 2015-01-12 19:22:10 +01:00
Mikael Nordfeldth
cbb7ec07a5 When called in offline queue, File::url was HTTP
Despite having the site configured "always" for HTTPS, File generated
thumbnails and such with HTTP urls.
2015-01-12 19:19:41 +01:00
Mikael Nordfeldth
6b48db2539 Merge commit 'refs/merge-requests/27' of https://gitorious.org/social/mainline into merge-requests/27 2014-12-09 13:30:47 +01:00
Joshua Judson Rosen
06235a3aa3 Consistently root autostitched conversations at the oldest notice. 2014-12-08 22:39:36 -05:00
Mikael Nordfeldth
d671b7b289 debug output was referencing wrong variable 2014-12-01 19:19:16 +01:00
Mikael Nordfeldth
9f09b136b8 Adding crc32 to uniqueify conversation URIs
This really should be a UUID or something else totally unexpected
but I figure that crc32 is good enough for now. The reason we keep
the main structure is because some third party scripts have begun
relying upon the tag URI format to parse out domain name, type etc.
2014-11-27 17:05:01 +01:00
Mikael Nordfeldth
411ce0629c If a Notice insert fails, don't continue processing it 2014-11-27 14:29:50 +01:00
Mikael Nordfeldth
e0d0a59706 Move Conversation creation out of insert() to allow URI setting
This means we import the URI string from remote instances to track their
conversations and are able to stitch together replies in a single thread.

We might have to try to avoid collisions so noone remotely can predict
conversation URIs which we generate on our server, causing a DoS kind of
problem.
2014-11-27 14:27:41 +01:00
Mikael Nordfeldth
8a4575ea76 Conversation URI cannot be null 2014-11-27 14:15:42 +01:00
Mikael Nordfeldth
bdb4a41696 Use remote conversation URI info to stitch convos together
If we know the URI sent from the remote party, and we don't know the
notice it is replying to, we might still be able to put it in the same
conversation thread!
2014-11-27 14:06:10 +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
7ea067a0dc Notice_source checks in better code style 2014-11-05 19:44:22 +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
Hannes Mannerheim
a3574bac6c we _do_ want to show text/html as attachments, since that's how mustard and crow expands oversized notices 2014-10-20 16:21:42 +02:00
Hannes Mannerheim
a3b66da261 repeat-bug, could not repeat oversized notices
this code is copy-paste from statusnet, apparently we need it still
2014-10-20 16:20:12 +02:00
Roland Haeder
c1a0132cab Added missing index declarations.
Signed-off-by: Roland Haeder <roland@mxchange.org>
2014-08-24 13:21:59 +02:00
Roland Haeder
ea53233f17 Fixed CHMOD + set error_reporting(0) in getvaliddaemons.php to avoid strict warnings in PHP +5.5
Signed-off-by: Roland Haeder <roland@mxchange.org>
2014-08-24 13:12:44 +02:00
Mikael Nordfeldth
8aa783241d Profile activityobject array outputs "summary" field 2014-08-07 21:54:31 +02:00
Mikael Nordfeldth
1c04601a9c Removing excessive "inline" attachment listings 2014-08-05 11:30:45 +02:00
Mikael Nordfeldth
17b9614ff8 File->getEnclosure improvements (text/html is not an attachment) 2014-08-05 10:54:00 +02:00
Mikael Nordfeldth
e61e11a973 Shares would lack a title in any Activity representation 2014-07-30 00:17:22 +02:00
Mikael Nordfeldth
6e481d35ed Start/End NoticeAsActivity modifications
More 'scoped' profiles and typing to the functions.
Also, there's no need to send an object as a reference.
2014-07-28 09:40:07 +02:00
Mikael Nordfeldth
eb2f93ad2b More use of Profile, less User 2014-07-28 09:34:46 +02:00
Mikael Nordfeldth
9afdc40763 Show correct number of POSTs in conversation "more" link 2014-07-15 14:26:42 +02:00
Mikael Nordfeldth
c96f0aa30f More Activity-based reasoning for saveActivity in Notice
If we can, get the activity ID from the activity itself, instead of the
supplied $options array.
2014-07-14 23:54:58 +02:00
Mikael Nordfeldth
ae62b91940 Unifying HTML stripping functions to common_strip_html 2014-07-14 13:52:23 +02:00
Mikael Nordfeldth
e0a10f775f Store activity content into Notice table in saveActivity 2014-07-14 13:29:03 +02:00
Mikael Nordfeldth
0a20abf1d8 Email notify-on-fave moved to Profile_prefs (run upgrade.php) 2014-07-13 19:46:40 +02:00
Mikael Nordfeldth
b46b588522 New Profile_prefs get a 'created' value now. 2014-07-13 17:09:18 +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
b67a611ca7 Allow default data from Profile_prefs::getData call 2014-07-13 16:26:08 +02:00
Mikael Nordfeldth
6f593a79d4 making more sense in mail_notify_fav
We should probably get rid of this function, at least storing everything in
lib/mail.php - but until then, at least let's make it more understandable.
2014-07-13 12:56:43 +02:00
Mikael Nordfeldth
42e2232371 Use canonical object type in Notice title as ActivityObject 2014-07-09 13:36:57 +02:00
Mikael Nordfeldth
2eea7a2d4b Do proper Activity-plugin based mention notification 2014-07-07 01:15:43 +02:00
Mikael Nordfeldth
fffacaa27c FavorAction now uses Notice::saveActivity 2014-07-06 01:37:03 +02:00
Mikael Nordfeldth
ffb9d7ad3f Rewriting code for notice representation
Getting rid of NoticeListItemAdapter, putting more into ActivityHandlerPlugin
and relying on plugins to handle rendering code of the content. This gives us
a lot more structure and consistency in notice structure and allows activity
plugins to stop rendering certain kinds of notices more easily.

There should also be a property for an ActivityHandlerPlugin class to avoid
rendering notices in the ordinary stream, so we don't have to overload stuff.
2014-07-04 14:14:49 +02:00
Mikael Nordfeldth
53b794342c Saved incoming activites for Favorite as wrong profile
also removed some debugging lines

Now we have to get rid of OStatus dependency in lib/activityhandlerplugin.php
2014-07-03 14:08:26 +02:00
Mikael Nordfeldth
1f97376813 Occasionally we'd get a false from Profile::getKV
Due to cache miss? Probably, but now we simply say that it's null in that case
so we get a proper exception from Notice::_setProfiles
2014-07-03 11:55:24 +02:00
Mikael Nordfeldth
b63f6e949c Converted all ActivityObject::fromProfile to $profile->asActivityObject 2014-07-03 10:51:36 +02:00
Mikael Nordfeldth
1d981b826a ActivityObject::fromProfile implemented in Profile 2014-07-02 18:39:53 +02:00
Mikael Nordfeldth
c44146d6f8 Favorites are now being stored from activities 2014-07-02 18:38:19 +02:00
Mikael Nordfeldth
acb07ef52f Added saveActivity method to Notice class
saveActivity will accept an Activity which gets parsed and saved through
plugins. So when an ActivityHandlerPlugin (such as Favorite will be soon)
gets a feed to save, this will be the function called instead of saveNew.
2014-07-02 11:38:37 +02:00
Mikael Nordfeldth
96babc59f5 getIdentifiers, resolveUri, findLocalObject Activity algorithms
Also modified related classes to support this feature.
2014-07-02 11:38:20 +02:00
Mikael Nordfeldth
7e597ea7cc More Favorite pluginification (favecount, cache, menus(favecount, cache, menus)) 2014-06-28 14:03:30 +02:00
Mikael Nordfeldth
fcdd061b4f pluginified most of hasFave, getFaves and related calls
The code is now more event-driven when it comes to rendering notices
and their related HTML elements, since we can't have direct calls from
core to a plugin.

lib/activitymover.php has a function to move a Favorite activity which
will not happen now. The move must be pluginified and performed as an
event which plugins can catch on to.
2014-06-27 14:09:02 +02:00
Mikael Nordfeldth
db7cc7fa75 Favorite functionality put into plugin (not done yet)
Now we have to fix any code in the core which directly uses the Fave class
or any other favorite stuff, since it is pluginised and thus might not be
available on some installations.
2014-06-24 15:58:53 +02:00
Mikael Nordfeldth
86fa4f5fe5 There was no getNickname() for User_group 2014-06-23 19:12:10 +02:00
Mikael Nordfeldth
414a95a784 Initial move towards microformats2
No validation has been attempted yet. Lots of changes left. This
is visibly not (very) different from the previous CSS layout. But
some simplifications have been made.

Might cause issues with local changes to themes and CSS. Also maybe
javascript which depends on certain legacy microformats elements.

The move to microformats2 is motivated by the announcement that all
microformats should be migrated to version 2, as of 2014-06-20 at:
http://microformats.org/2014/06/20/microformats-org-turns-9-upgrade-to-microformats2
2014-06-22 17:11:04 +02:00
Mikael Nordfeldth
d16af504f6 File basename call lacked a dot 2014-06-22 17:05:11 +02:00
Mikael Nordfeldth
79824a3625 Could not update avatar due to Bad Thumbnail parameters 2014-06-17 12:48:10 +02:00
Mikael Nordfeldth
c8c6bf9a1c Simplify functions regarding locally cached profiles etc. 2014-06-06 00:32:07 +02:00
Mikael Nordfeldth
c786892103 Non-dynamic profile fetching in User and User_group 2014-06-06 00:19:54 +02:00
Mikael Nordfeldth
1217cd59bf Non-dynamic user and group fetching in Profile 2014-06-06 00:07:32 +02:00
Mikael Nordfeldth
adf896bc12 Add support for plugins to resize images
This also adds an event hook to get more metadata of the ImageFile.
Such as if it's animated or so.
2014-06-05 13:29:36 +02:00
Mikael Nordfeldth
a900d04052 Non-dynamic fetching for multiple Notice properties 2014-06-05 00:29:43 +02:00
Mikael Nordfeldth
3d807c812d $notice->getProfile will ALWAYS return a Profile
otherwise it throws an exception
2014-06-05 00:07:04 +02:00
Mikael Nordfeldth
04d4b62dff Replies to repeats should go to the original 2014-06-04 23:51:32 +02:00
Mikael Nordfeldth
a490d634db Repeats were not delivered a conversation ID
Vinilox noticed that replies to repeats ended up outside of the original
notice's conversations.
2014-06-04 23:21:37 +02:00
Mikael Nordfeldth
90cc6b4d3b Notice::getReplyTo more specific now (getInlineReplyTo) 2014-06-04 23:20:20 +02:00
Mikael Nordfeldth
629cbedee2 Dangerous non-dynamic profile fetching in Notice
For a Notice object with multiple results, ->getProfile() would ALWAYS
return the first profile in the list. For example our "popular notices"
stream ended up believing all notices were made by the same profile.
2014-06-03 12:22:07 +02:00
Mikael Nordfeldth
1431bbd884 No need to pre-resize avatars 2014-06-03 01:52:42 +02:00
Mikael Nordfeldth
db443e9374 File::processNew now static and always throws exception on failure 2014-06-02 02:11:23 +02:00
Mikael Nordfeldth
d6f52f5939 File::processNew can return -1 which was not true for empty()
Also, File->getEnclosure() now throws exception if not enough metadata.
2014-06-02 01:46:09 +02:00
Mikael Nordfeldth
49188e826c ArrayWrapper no longer returned from multiGetClass
multiGetClass uses FIND_IN_SET for ordering, which is pretty MariaDB specific.
2014-06-02 00:15:17 +02:00
Mikael Nordfeldth
61116ea991 Subscription class listing retrieval fixed
The incorrect variable was tried to be 0 causing offset limits that
are more than 1 to be treated identically (like the raw $ids value).
2014-05-30 23:37:00 +02:00
Mikael Nordfeldth
49fa34e234 Make Profile::fromUri use UnknownUriException 2014-05-26 15:05:14 +02:00
Mikael Nordfeldth
e83b2e147a NoProfileException collision avoidance fix 2014-05-26 14:39:03 +02:00
Mikael Nordfeldth
1207f4f06f isLocal() for User_group 2014-05-19 14:46:54 +02:00
Mikael Nordfeldth
b0cc9292b1 Notice->repeat() function takes Profile as argument now 2014-05-18 21:03:10 +02:00
Mikael Nordfeldth
c4c4835899 Notice->repeat should include the full message
Any clients showing the repeat itself should have its own shortening or
otherwise formatting rules which it can apply itself.
2014-05-18 20:53:44 +02:00
Mikael Nordfeldth
2755e23707 Clear out stored files and reltaed thumbnails when a File is deleted. 2014-05-12 15:16:41 +02:00
Mikael Nordfeldth
214a10ddec File_thumbnail fixes (run scripts/upgrade.php)
We're now capable of doing image rotation for thumbnails based on
EXIF orientation data. Also, thumbnails are tracked by filenames and
thus we can delete them from storage when we feel like it.
2014-05-12 14:33:41 +02:00
Mikael Nordfeldth
cd3cff451f ConversationTree is now a plugin (not oldschool setting)
Conversation trees works pretty bad with the current layout, javascript
etc. So it's best if we separate it and work on it as a side-project. The
oldschool settings are currently being deprecated (or broken out like this).

I'll wait with removing User preferences for oldschool conversation tree,
since that might be reusable data. But I guess it will go in the near future.
2014-05-12 11:51:11 +02:00
Mikael Nordfeldth
1a81188355 Use an Event to present notices conversations 2014-05-12 11:03:21 +02:00
Mikael Nordfeldth
04b7194511 Notice->getUrl() for shares would throw exception in some feeds 2014-05-10 13:06:18 +02:00
Mikael Nordfeldth
a7a4eeef09 width and height are now properties in the File class 2014-05-07 09:51:37 +02:00
Mikael Nordfeldth
621533a7c2 Bad variable reference in event hook. 2014-05-06 23:40:45 +02:00
Mikael Nordfeldth
1776c90cb9 Moved oEmbed stuff out to a plugin (Oembed). 2014-05-06 23:32:13 +02:00
Mikael Nordfeldth
8b12e41351 User object didn't have getNickname() function
We're just jumping on to the Profile->getNickname() function.
2014-05-06 16:08:36 +02:00
Mikael Nordfeldth
848d513706 Only run EndSubscribe when it is really a sub 2014-05-06 00:22:02 +02:00
Mikael Nordfeldth
fc3125cf28 More modern coding, stuff related to subscriptions
Also trying to use the newly implemented AlreadyFulfilledException
2014-05-05 23:58:05 +02:00
Mikael Nordfeldth
9a5e1423f1 Conversations now have URIs that are not URLs 2014-05-01 20:17:40 +02:00
Mikael Nordfeldth
27ed6b7db0 getConversationUrl introduced for linking to conversations 2014-05-01 15:25:19 +02:00
Mikael Nordfeldth
4774a25040 Link notice posted time to local representation
Notice class got a 'getLocalUrl' function.
2014-05-01 14:28:53 +02:00
Mikael Nordfeldth
b77a09fdee Notice URIs are not necessarily URLs.
Let's use getUrl() for URL retrieval. May throw exceptions, but
only if it's a Notice that cannot be linked like that anyway.
2014-04-30 20:44:23 +02:00
Mikael Nordfeldth
34b570352f Fix Direct Message functionality. 2014-04-29 20:37:58 +02:00
Mikael Nordfeldth
7d191f8062 s/bestUrl/getUrl/ for notices and microapp objects 2014-04-29 19:46:58 +02:00
Mikael Nordfeldth
cd6bd07c9d Handle File thumbnail errors better 2014-04-28 20:26:32 +02:00
Mikael Nordfeldth
5fd6053220 Code cleanup and enabling User object's etc. getUri() 2014-04-28 14:08:42 +02:00
Mikael Nordfeldth
0883f54f62 getUrl replaces deprecated bestUrl (more to come) 2014-04-28 14:04:54 +02:00
Mikael Nordfeldth
37ce1f4766 Better fallback on UnsupportedMediaException 2014-04-28 12:12:06 +02:00
Mikael Nordfeldth
e526909bd8 File width and height is now properly set for File 2014-04-22 12:09:24 +02:00
Mikael Nordfeldth
d59eb5e184 Dynamically generate thumbnails (see full text)
The File object now stores width and height of files that can
supply this kind of information. Formats which we can not read
natively in PHP do not currently benefit from this. However an
event hook will be introduced later.

The CreateFileImageThumbnail event is renamed to:
CreateFileImageThumbnailSource to clarify that the hooks should not
generate their own thumbnails but only the source image. Also it now
accepts File objects, not MediaFile objects.

The thumbnail generation is documented in the source code. For
developers, call 'getThumbnail' on a File object and hope for the best.

Default thumbnail sizes have increased to be more appealing.
2014-04-21 20:46:11 +02:00
Mikael Nordfeldth
7f3611c51c use intval() instead of floor() for int return type 2014-04-21 19:32:08 +02:00
Mikael Nordfeldth
b3bf036975 Preparing File for dynamic thumbnail generation. 2014-04-21 12:33:26 +02:00
Mikael Nordfeldth
43a3f5ea90 File_oembed::saveNew are File::saveNew are static
Also did some non-backwards-compatible (to StatusNet) code cleanup.
2014-04-20 16:10:05 +02:00
Mikael Nordfeldth
72707ddc26 deprecate Notice::bestUrl() in favor of getUrl() 2014-04-20 15:28:31 +02:00
Mikael Nordfeldth
132be99506 Improve ShownoticeAction remote redirect code 2014-04-19 22:13:48 +02:00
Mikael Nordfeldth
454a9bc1c4 Use getUrl() instead of ->url in OembedAction 2014-04-19 22:05:44 +02:00
Mikael Nordfeldth
2c1dcc7f14 Fixes to URI/URL handling for notices 2014-04-19 22:04:52 +02:00
Mikael Nordfeldth
85b022246f Handle missing URIs and URLs better 2014-04-18 23:36:01 +02:00
Mikael Nordfeldth
3e2136f222 Avoid double colon on Notice URI generation 2014-04-18 23:17:34 +02:00
Mikael Nordfeldth
e0e69ddd7c Throw exception when we can't get the url for a notice 2014-04-18 23:17:15 +02:00
Mikael Nordfeldth
7025817cc1 File_thumbnail lacked getUrl function
The only reason it worked was because DB fetches calls to get$varname if
the dataobject has a variable with the specific name. However, it started
blurting out errors that the case must be correct (which would require
'geturl' to be the function name).

Since we probably want to replace DB sometime, we'll just override this
auto-fetching mechanism and use more explicitly defined functions.
2014-04-18 23:06:28 +02:00
Mikael Nordfeldth
28dc361a15 Set new notice uri to something that's not a URL 2014-04-18 22:42:01 +02:00
Mikael Nordfeldth
d3b4a8616d Original name preserved in uploaded file.
Avoiding collisions with date (shorter than before) and 4 character
random alphanumeric string. I bet someone could mass-upload files
and generate all combinations of aaaa-zzzz during the course of a
day, but then maybe that user should be disabled anyway :)
(filling the collision space will cause a never-ending loop).
2014-04-16 23:17:27 +02:00
Mikael Nordfeldth
06d4cecf7f MediaFile thumbnail event hooks + VideoThumbnails plugin
The exception thrown from MediaFile will be caught and simply result in
no thumbnail at all right now. In the future we might use a catch-all
and have a "cannot generate preview"-icon or something.

VideoThumbnails requires php5-ffmpeg and php5-gd.
2014-04-16 21:48:58 +02:00
Mikael Nordfeldth
639f1a01e0 File class no longer depends on MIME
+ minor tweaks to MediaFile
2014-03-08 03:51:47 +01:00
Mikael Nordfeldth
79cacdc62f Removing unused "inboxed" flag for User class 2014-03-07 21:37:48 +01:00
Mikael Nordfeldth
5842c59ba7 Get group attentions back into the "all" feed 2014-03-07 02:49:42 +01:00
Mikael Nordfeldth
5e4a275220 Clear Attentions when notice or profile is removed 2014-03-06 14:43:36 +01:00
Mikael Nordfeldth
bed8cc48bc Add an index for Attention notice_ids too
Not sure if this is really needed, since notice_id and profile_id together
build up the primary key. That might cause MySQL to index them anyway.
2014-03-06 14:42:29 +01:00
Mikael Nordfeldth
018fd84032 Add Attention class for non-sub and non-mention notice attentions 2014-03-06 14:22:26 +01:00
Mikael Nordfeldth
5127a83935 Add Managed_DataObject getID() to avoid $obj->id 2014-03-06 14:21:44 +01:00