Commit Graph

2027 Commits

Author SHA1 Message Date
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