Commit Graph

2336 Commits

Author SHA1 Message Date
Mikael Nordfeldth
4abb3f19bf Make Profile->getFancyUrl() somewhat better on fallback
It tries to get a referential identifier apart from the fullname trying
with acct: URI, profile URL and lastly URI.
2016-03-01 23:48:32 +01:00
Mikael Nordfeldth
ddd60e7142 Make Profile->getFancyName() return including the acct URI 2016-03-01 23:37:38 +01:00
Mikael Nordfeldth
47f408ca7c Strict typing for mail_notify_attn 2016-03-01 23:37:11 +01:00
Mikael Nordfeldth
e41809af89 Nothing interesting was made in this commit. 2016-03-01 16:30:00 +01:00
Mikael Nordfeldth
a112e7f9a4 Use another method of detecting unspecified defaultImage size 2016-03-01 15:00:52 +01:00
Mikael Nordfeldth
63c087a255 Consistent behaviour for ScopingNoticeStream $scoped
We don't guess the current profile anymore if the value of the profile === -1

Also sets $this->scoped for all ScopingNoticeStream inheritors, which just
like in an Action can be null if we're not scoped in any way (logged in).
2016-03-01 14:51:47 +01:00
Mikael Nordfeldth
52a3764ae4 Resolve relative URLs (assuming URI.Base==notice URL)
The real way to do this would be to get the xml:base property from
the Atom feed but it's probably not there in any posts we see today.
2016-02-26 14:46:26 +01:00
Mikael Nordfeldth
1e6520fddd Woops, forgot to skip the / in path 2016-02-26 14:13:46 +01:00
Mikael Nordfeldth
6a4470912f Fiddling with merge request #98 to use internal routing functions 2016-02-26 14:10:32 +01:00
Mikael Nordfeldth
8356c2495c Use mb_* and strict === comparison 2016-02-26 13:52:25 +01:00
mmn
722ff4d9c0 Merge branch 'foolproof_file_redirection_branch' into 'nightly'
Foolproof file redirection

This solves an issue when our internal /attachment/{file_id} links are shortened with an remote shorteners (which caused the /attachment/{file_id} links to be saved to the File table and a thumbnail of a thumbnail being generated)

See merge request !98
2016-02-26 12:49:10 +00:00
mmn
fae9e27365 Merge branch 'group-autocomplete' into 'nightly'
Fix !group autocomplete

"Call to undefined method User_group::getFullname"

See merge request !108
2016-02-26 12:30:19 +00:00
Mikael Nordfeldth
c58228195b Make sure the saved Notice has an ID 2016-02-26 01:11:20 +01:00
Mikael Nordfeldth
519e3308ab Use mb_strlen to see if something is an empty string 2016-02-26 01:04:59 +01:00
Mikael Nordfeldth
aeb2e282db Commented on the mime extension matching regexp 2016-02-25 22:32:54 +01:00
Mikael Nordfeldth
bac37d1714 syntax error 2016-02-25 22:17:44 +01:00
Mikael Nordfeldth
e6e1705852 Make uploads work properly if we accept _all_ attachment types
Also introduced $config['attachments']['extblacklist'] that can disable
certain file extensions (or rewrite them, for example php => phps)
2016-02-25 22:15:54 +01:00
Mikael Nordfeldth
e69f878241 Notice getRendered() can now be called on uninserted notices 2016-02-25 15:48:37 +01:00
Mikael Nordfeldth
e3e3a91734 Correct comment on Notice->conversation in table schema 2016-02-24 19:34:44 +01:00
Chimo
54da2526ed Fix !group autocomplete
"Call to undefined method User_group::getFullname"
2016-02-24 13:00:15 -05:00
Mikael Nordfeldth
731fd01139 Allow easy fetching of rel="me" values 2016-02-24 16:42:54 +01:00
Mikael Nordfeldth
3ef573f67c Default to profile size in Avatar::defaultAvatar 2016-02-24 16:42:35 +01:00
Mikael Nordfeldth
d672547112 getAliases should be only a list (numeric array) 2016-02-23 14:33:09 +01:00
Mikael Nordfeldth
b59dacb806 getAliases for Profile and Notice
Also move fancyurlfix into site-wide $config['fix']['fancyurls']

TODO: getByUri should make use of this directly I guess?
2016-02-23 14:00:59 +01:00
Mikael Nordfeldth
d16a883e17 Allow lookup of User->getByUri (throws NoResultException) 2016-02-21 18:47:47 +01:00
hannes
501d081d3b getKV doesn't throw exception 2016-02-16 19:16:05 +00:00
Mikael Nordfeldth
83f679fb57 Profile->isPrivileged() to check if users have more rights than to post etc. 2016-02-12 14:47:49 +01:00
Mikael Nordfeldth
e5ad98e601 Silence action can only be used on non-priviliged users 2016-02-12 14:22:25 +01:00
Mikael Nordfeldth
5dce08d068 Add Profile::ensureCurrent() to verify we _certainly_ got a Profile. 2016-02-12 13:52:48 +01:00
Mikael Nordfeldth
733debd9b3 Use thumbnail upscaling config value 2016-02-10 04:40:54 +01:00
Mikael Nordfeldth
dd229e855a Allow finding the "original remote thumbnail"
This will probably cause older oEmbed images not to show, since they
probably were updated to use empty url entries because they were thought
of as local ones. During a migration period maybe you want to change
the default value of notNullUrl to 'false' in File_thumbnail::byFile(...)
2016-02-10 04:37:43 +01:00
Mikael Nordfeldth
893d888152 Add urlhash field to File_thumbnail for indexing 2016-02-10 04:15:41 +01:00
Mikael Nordfeldth
49b7648fea Managed_DataObject gets onInsert and onUpdate 2016-02-10 03:37:27 +01:00
Mikael Nordfeldth
ec257d940a Either use or don't use HTTPS
The risk of injection attacks using HTTP is too great to allow a
site that allows both HTTP and HTTPS...
2016-02-10 00:57:39 +01:00
Mikael Nordfeldth
3dea259f52 Return intval from getID() 2016-02-08 12:21:46 +01:00
Mikael Nordfeldth
e903bd0bc3 Hacky support for geo URI detection
Won't work with common_purify yet because there is no geo uri scheme for it
2016-02-03 14:19:08 +01:00
Mikael Nordfeldth
6a4aa34b0c Don't process further in redirection if HEAD gives 400 Bad request 2016-02-03 00:34:49 +01:00
Mikael Nordfeldth
40cffb9463 File::isProtected is static 2016-02-03 00:22:18 +01:00
Mikael Nordfeldth
c6ae883ad2 Don't trust local HTML either
If we reallyreally want to include <img> or <script> or whatever then we
have to do that after Notice::saveActivity sets ->rendered.
2016-01-30 00:00:37 +01:00
hannes
f708a5b016 Never save our /attachment/{file_id} links as links in the file table, return the old file 2016-01-29 00:36:30 +00:00
hannes
efd2326a29 the last url in the redirection chain can actually also be a redirection (e.g. if it's one of our /attachment/{file_id} links) 2016-01-29 00:34:32 +00:00
Mikael Nordfeldth
efe23ed404 updateWithKeys now understands multi-column keys
and automatically identifies _which_ columns are the right ones,
so for example 'uri' primary keys don't need to be explicitly set
2016-01-28 16:42:59 +01:00
hannes
a888294135 add our own protected urls 2016-01-25 19:00:46 +00:00
hannes
ca0c792ed3 File and File_redirection records are saved in File_redirection::where() now 2016-01-25 19:00:05 +00:00
hannes
48e1a2431b save File and File_redirection records in File_redirection::where(), because then we will have to run where() over and over again 2016-01-25 18:55:48 +00:00
Mikael Nordfeldth
a9d18a077e Harmonize, clarify, categorize URL schemes
Regular expression + avoid-redirection list now match each other.
2016-01-24 12:47:31 +01:00
Mikael Nordfeldth
1cec627d72 Allow bitcoin scheme to URLs 2016-01-24 12:44:28 +01:00
Mikael Nordfeldth
f74d2d555c Working on some RSVP code stuff 2016-01-21 02:10:34 +01:00
Mikael Nordfeldth
5999171c11 Throw NoObjectTypeException on Notice->getObjectType if no string 2016-01-20 21:37:14 +01:00
Mikael Nordfeldth
7715ea993b getVerb function in Notice class 2016-01-18 22:02:05 +01:00
Mikael Nordfeldth
6c46a93a81 Minor improvements on Notice::saveActivity 2016-01-18 19:29:45 +01:00
Mikael Nordfeldth
11b925c4ca Use a function to getCreated() 2016-01-18 17:03:37 +01:00
Mikael Nordfeldth
deda83fdef Distinguish notice saving errors from others for Salmon 2016-01-16 22:39:04 +01:00
Mikael Nordfeldth
a85a08ff35 Add a check in Notice->asActivityObject that we're actually returning such a thing! 2016-01-16 21:13:26 +01:00
Mikael Nordfeldth
fdfa71a033 Extremely verbose debugging is annoying 2016-01-16 18:04:04 +01:00
Mikael Nordfeldth
1f76c1e4a9 Initial user doesn't need as strict checking on email 2016-01-16 17:23:50 +01:00
Mikael Nordfeldth
0caf0612d0 Make Twitter Media upload API v1.1 reach us
Now we just have to accept the 'media' or 'media_data' (base64 encoded)
POST arguments instead of $_FILES uploads.
2016-01-14 18:29:21 +01:00
Mikael Nordfeldth
45dd343126 Eventify Notice getAsTimestamp (for Deleted_notice) 2016-01-13 21:01:47 +01:00
Mikael Nordfeldth
961725205d Try if Profile is a Person (in effect ActivityObject::PERSON) 2016-01-13 18:34:48 +01:00
Mikael Nordfeldth
e75472f460 Use the upstream function to get effectiveUrl 2016-01-13 14:00:05 +01:00
Mikael Nordfeldth
b696fb4eb1 Mimetypes like image/svg+xml were misinterpreted when guessing
We don't really need the mb_ in mb_strtolower but what the heck, why not. I love Unicode.
2016-01-12 13:46:25 +01:00
Mikael Nordfeldth
93c614c184 Do updateWithKeys properly if someone would like to update PRI 2016-01-11 19:52:33 +01:00
Mikael Nordfeldth
67801a5566 Not only local groups should be added to group inbox notificiation table 2016-01-09 15:14:38 +01:00
Mikael Nordfeldth
5ef10a14ef Get group attentions too for outbound notices 2016-01-09 15:06:44 +01:00
Mikael Nordfeldth
c3c5a9974d Do proper fromUri lookup on groups too 2016-01-09 14:36:47 +01:00
Mikael Nordfeldth
d1e609a886 Local user profile getUrl gives dynamically generated URL 2016-01-09 13:47:38 +01:00
Mikael Nordfeldth
f143925931 Actually return the group home URL 2016-01-09 13:33:30 +01:00
Mikael Nordfeldth
28cd5640c1 Save attentions to Reply table for backwards compatibility
local users only of course
2016-01-08 01:59:16 +01:00
Mikael Nordfeldth
c48871cf1b Notice from web now saves context->attention too! ;) 2016-01-07 23:24:15 +01:00
Mikael Nordfeldth
6255e1dca3 saveAttentions, trying to move away from saveReply 2016-01-07 23:23:51 +01:00
Mikael Nordfeldth
3eebf2a353 Don't store the notice object for distrib queue handler, just id 2016-01-07 20:24:59 +01:00
Mikael Nordfeldth
d4be5349b3 think I have managed to show oEmbed images better now 2016-01-07 17:35:37 +01:00
Mikael Nordfeldth
9e5c71e701 Fixed group representation in Directory plugin, also some ->raw calls 2016-01-07 12:58:14 +01:00
Mikael Nordfeldth
839ae571d8 Define User_group::$profile_id among class variables 2016-01-07 12:12:27 +01:00
Mikael Nordfeldth
94392ab00c Index the verb column since we do COUNT(*) based on it 2016-01-07 11:39:46 +01:00
Mikael Nordfeldth
05d3622939 Conversation entries where id==0 would screw up the "re-auto-increment" sequencing 2016-01-06 22:26:17 +01:00
Mikael Nordfeldth
f1c4c64cd9 Don't update stored URLs just because we have a filename
This would overwrite remote URLs with local verisons which removes source href...
The reason one might have filenames for remote URLs is that StoreRemoteMedia plugin
fetches them and uses the filename field.
2016-01-06 19:24:03 +01:00
Mikael Nordfeldth
346e34e543 Return dynamically generated URLs for thumbnails for all locally stored entries 2016-01-06 19:06:29 +01:00
Mikael Nordfeldth
4352d1739d Always generate notice URLs on the fly for local notices
Related to issue #118
2016-01-06 16:24:33 +01:00
Mikael Nordfeldth
1a1e44cdfd Issue #118 wanted better TOR support, now Avatar URLs are not stored
There was no reason to store the generated Avatar URLs because it's so
cheap to generate them on the fly.
2016-01-06 16:14:26 +01:00
Mikael Nordfeldth
7b2036a4b5 Note in the debug log if we render the HTML of a message 2016-01-06 15:37:30 +01:00
Mikael Nordfeldth
b596391fcd Avoid having to check for notices without rendered copies in upgrade.php
Always call the Notice->getRendered() function to get a rendered copy.
We could perhaps put some sanitation there too in the future
2016-01-06 15:32:27 +01:00
Mikael Nordfeldth
0fd2ad649e Conversation IDs (again) no longer based on Notice ID 2016-01-06 13:58:46 +01:00
Mikael Nordfeldth
59d3bbe037 Merge branch 'nightly' of git.gnu.io:gnu/gnu-social into mmn_fixes 2016-01-06 00:53:20 +01:00
mmn
d45457e4a9 Merge branch 'nightly' into 'nightly'
only count post-notices (i.e. don't include activity-notices in statuses_count in the API)



See merge request !73
2016-01-05 23:53:08 +00:00
Mikael Nordfeldth
1946197a1c Merge request #10 by aroque but in a slightly different version 2016-01-06 00:48:03 +01:00
hannes
32549cfd8c $notices->verb = ActivityVerb::POST; 2016-01-05 23:29:48 +00:00
Mikael Nordfeldth
31c8416a8f Merge branch 'nightly' of git.gnu.io:gnu/gnu-social into mmn_fixes 2016-01-06 00:24:41 +01:00
mmn
956e053da6 Merge branch 'lookup_url_fix' into 'nightly'
makes url lookup work and adds full url to href for shortened links



See merge request !74
2016-01-05 23:24:16 +00:00
Mikael Nordfeldth
792b62874e Require Profile for Profile->getLists 2016-01-06 00:18:10 +01:00
hannes
1c25cffbd8 add $redir->redir_url to use in common_linkify() 2016-01-05 23:07:24 +00:00
Mikael Nordfeldth
3d66d960a1 Require Profile for Profile->getOtherTags 2016-01-06 00:07:15 +01:00
Mikael Nordfeldth
8ad6b8809a Don't abort on too long notices in Notice::saveActivity 2016-01-05 17:31:09 +01:00
hannes
e10691abea only count post-notices (i.e. don't include activity-notices in statuses_count in the API) 2016-01-05 14:19:33 +00:00
Mikael Nordfeldth
701f6ff608 Allow Profile->getCurrentNotice to send scoped profile info
not that we're using it anywhere (yet anyway).
2016-01-04 21:42:24 +01:00
Mikael Nordfeldth
6a16939830 Profile->getCurrentNotice handles PrivateStreamException 2016-01-04 21:38:41 +01:00
Mikael Nordfeldth
b4b57bba54 EmptyIdException to make sure we get the right in catch 2016-01-03 22:56:48 +01:00
Mikael Nordfeldth
7266a968f9 Err, forgot semicolon. 2016-01-03 22:22:58 +01:00
Mikael Nordfeldth
f467b89f40 Try-catch on profile deletion unsubscribe actions 2016-01-03 22:21:03 +01:00
Mikael Nordfeldth
c19964094b Pending subscription requests now work as they should
A slight layout issue with the buttons still persists
2016-01-03 20:27:53 +01:00