Commit Graph

5151 Commits

Author SHA1 Message Date
Joshua Judson Rosen
f29d8e0d5a Make daemons call setgid() *before* setuid() because doing it the other way around doesn't appear to work, at least on Linux. 2014-05-05 13:33:06 +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
e506b8f7f9 Installer database adjustments
We can't say we officially support PostgreSQL, unfortunately. There
are too many database calls with MySQL specific syntax. This would be
desirable for a 2.0 release, but too much work while maintaining 1.x.

The main difficulty is that we're using PEAR::DB which is aging. If
that's exchanged, maybe we could use PDO or something.
2014-05-01 02:59:09 +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
6d72d0c86f InlineAttachmentList had unnecessary function 2014-04-28 20:18:04 +02:00
Mikael Nordfeldth
b0cae37b0f Datetime representation aligned for microformats2
Read more at http://microformats.org/

Also, tooltip text on time representation for humans has been improved.
Unfortunately no standardised representation (like "RFC850") had 4-digit years.
2014-04-28 18:54:55 +02:00
Mikael Nordfeldth
5fd6053220 Code cleanup and enabling User object's etc. getUri() 2014-04-28 14:08:42 +02:00
Mikael Nordfeldth
030639d02d EmailAuthentication enabled by default
The login field said "Username or email address" already, so...
2014-04-28 12:39:57 +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
5fbb668855 Be more precise in return array from image scaling 2014-04-21 22:31:13 +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
49a7cb9d84 Action->int(...) never replied with integers 2014-04-21 14:46:41 +02:00
Mikael Nordfeldth
86ddf120d7 Better event name (creating thumbnail _source_) 2014-04-21 12:33:41 +02:00
Mikael Nordfeldth
cecec3b088 No need for common_notice_uri anymore 2014-04-18 23:36:07 +02:00
Mikael Nordfeldth
54f3b4be47 Thumbnails are now by default squares of 150px 2014-04-18 11:07:59 +02:00
Mikael Nordfeldth
07b232774d Enable square thumbnailing 2014-04-18 11:07:45 +02:00
Mikael Nordfeldth
71bda34e72 Thumbnail default set to 150px square 2014-04-17 15:15:12 +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
00aa3fa734 ImageFile unlink function referenced bad path 2014-04-16 20:08:21 +02:00
Mikael Nordfeldth
90a593718f HTML5 video/audio support in attachments 2014-04-14 14:06:11 +02:00
Mikael Nordfeldth
da06350a72 Added some free codecs for media attachments 2014-04-14 13:52:03 +02:00
Mikael Nordfeldth
a2a2105058 HTML5 required attribute for some input forms 2014-04-06 11:27:41 +02:00
Mikael Nordfeldth
710b7f61a2 Merge commit 'refs/merge-requests/12' of git://gitorious.org/statusnet/gnu-social into merge-requests/12 2014-03-31 12:36:55 +02:00
Florian Hülsmann
58d1300745 fixed config for php >=5; see php.net/array_merge 2014-03-30 16:56:48 +02:00
Mikael Nordfeldth
758ac0bdc5 Autoloaded library files do not need explicit require_once 2014-03-18 11:22:21 +01:00
Mikael Nordfeldth
d2104b89d9 Comment improvements with spl_autoload_register 2014-03-18 11:20:58 +01:00
Mikael Nordfeldth
3d0994bcca Updating Markdown class + use spl_autoload_register
spl_autoload_register now calls the GNUsocial_class_autoload function
instead of us replacing the magic __autoload($cls). This means we can
queue up other autoload functions, such as the one now used for extlib
functions which exist directly in the 'extlib/' folder or have proper
namespacing (which our new Markdown class does).
2014-03-18 10:52:17 +01:00
Mikael Nordfeldth
c00491cd7a Cosmetic changes to common_redirect, clientError, serverError
Since these functions exit (or throw exception) after running, there
is no need to have a 'return' statement or similar afterwards.
2014-03-10 00:25:57 +01:00
Mikael Nordfeldth
4f4abca338 OAuthException should be detected for autoloading
Or we may have conflicts with other filesin not in extlib.
2014-03-09 22:17:58 +01: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
6faed0e451 MediaFile loses dependency on PEAR::MIME
At the same time we remove the "filecommand" setting, since we will
likely not have use of it thanks to PECL fileinfo.

Also the "supported" list for attachment mime types has changed
format, so we can keep track of at least some known file extensions.
2014-03-08 03:34:50 +01:00
Mikael Nordfeldth
0eb38b8f84 We only allow (and have) MIME types in supported list
$config['attachment']['supported'] may not use only the file extension.
2014-03-08 02:02:26 +01:00
Mikael Nordfeldth
6f6065e5e9 Only accept filenames for existing files in getUploadedFileType
Getting metadata from filehandles just meant duplicating work
2014-03-08 01:42:24 +01:00
Mikael Nordfeldth
074339ea13 WebM should be allowed to upload!
Evan had left _two_ "video/mpeg", just so you know.
2014-03-08 00:29:47 +01:00
Mikael Nordfeldth
1603b4f0bf PublicSite profile does not have inviteonly, but RegisterThrottle 2014-03-07 21:29:29 +01:00
Mikael Nordfeldth
a35bf227fb Site profile "community" should be invite-only by default
Because if you have your own local/closed community, likely you
don't want random newcomers that drop in, spam and leave dead
accounts.

The Admin can of course always override this by setting the config
"inviteonly" to false either in the config.php or on the website.
2014-03-07 20:57:33 +01:00
Mikael Nordfeldth
5842c59ba7 Get group attentions back into the "all" feed 2014-03-07 02:49:42 +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
36a55d8436 Use CachingNoticeStream for "All" feed (hope it works) 2014-03-06 11:47:27 +01:00
Mikael Nordfeldth
2272cc244d Removed Inbox from core (unused since 4b2a66ed29)
Added the following FIXME:
How should a Twitter user get their Inbox filled with foreign tweets?

Every imported Twitter user has a profile in the Profile table, so we
could setup a Subscription entry for each of those, meaning they get
collected in the InboxNoticeStream... But this would mean a lot of
unnecessary entries and listings that generally just point to the
locked down Twitter service.

Let's figure out a good relation so we can connect any profile to any
imported foreign notice, so it shows up in the "all" feed.
2014-03-06 04:46:29 +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
f0c718b1af Trying to remove Inbox, first steps 2014-03-06 02:43:28 +01:00
Mikael Nordfeldth
00db57949f Always queue inbox distribution 2014-03-06 01:50:54 +01:00
Mikael Nordfeldth
f83b2cf324 Handle removed profile more gracefully in noticelist
Just hide it from the visitor, but log a warning (and error, since
the exception itself logs that).
2014-03-05 01:27:27 +01:00
Mikael Nordfeldth
13736bbb89 Updating version check to match requirements
Also removing a legacy check for, nowadays, unsupported versions.
2014-03-01 16:19:00 +01:00
Mikael Nordfeldth
827d6018a7 Less StatusNet, more GNU social
We've still got stuff like the update-subscription thing to set up.
2014-03-01 14:14:39 +01:00
Mikael Nordfeldth
c514cac31d JSON is a required PHP extension for GNU social. 2014-03-01 13:58:03 +01:00
Jean Baptiste Favre
7f4e6aaafa Introduce new config option common_config('queue','daemon').Allows to dynamically enable scripts/queuedaemon.php into scripts/getvaliddaemons.php 2014-03-01 12:16:38 +01:00
Mikael Nordfeldth
bc554ea9c2 Bad route config (thanks brw12)
ben wheeler submitted this bug report with a patch for StatusNet.
2014-03-01 12:01:21 +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
c6bdafb3d0 nl2br so we get proper newlining when publishing \r, \n or \r\n 2014-02-24 18:00:53 +01:00
Mikael Nordfeldth
96b0cfe662 Don't discard XML in queue items
XMPP messages on -out at least were strings of XML that were stopped
because they weren't JSON.
2014-02-24 14:11:34 +01:00
Mikael Nordfeldth
1e37f374b3 Making us less dependant on javascript trust
Many of the microapps are pretty javascript dependant, but at least
we should allow users to get to the new notice field without allowing
javascript to run in the browser. :)
2014-02-24 02:05:31 +01:00
Mikael Nordfeldth
c0c8250ff7 minify removed from core (use plugin if desired)
My reasoning: Minifying makes third party review harder. A visitor on
a GNU social site should have no problem reading, understanding and
modifying javascripts for their own liking. A minified script is much
more difficult to use, reuse, modify and share.

Free software is not minified.
2014-02-24 01:05:13 +01:00
GNU Social instance
398491b39b Remove util.min.js (minifying is EVIL) 2014-02-24 00:31:37 +01:00
Jean Baptiste Favre
28081e9115 Add various entry points to enhance compatibility with Twitter client like Twidere 2014-02-23 22:12:03 +01:00
Jean Baptiste Favre
703aa302b6 Add 'profile_image_url_https' to enhance compatiblity with Twitter clients since they now need https URLs instead of plain http 2014-02-23 22:12:03 +01:00
Mikael Nordfeldth
47fbe16562 stricter typing 2014-02-23 21:05:34 +01:00
Mikael Nordfeldth
5487c596fc Remove callback sneakery by StatusNet 2014-02-23 14:57:12 +01:00
Mikael Nordfeldth
02cbafb987 slightly less confusing inline if 2014-02-23 14:47:41 +01:00
Mikael Nordfeldth
4759365293 Merge commit 'refs/merge-requests/6' of git://gitorious.org/statusnet/gnu-social into merge-requests/6 2014-01-04 21:27:28 +01:00
Mikael Nordfeldth
9edde007b1 instanceof checks for better typing 2014-01-01 20:30:57 +01:00
root
95222df899 check local/plugins before plugins in Plugin::onAutoload 2013-12-31 23:56:56 +00:00
Mikael Nordfeldth
09e06bbc19 Queues should be enabled by default (thanks postblue) 2013-12-02 13:51:55 +01:00
Mikael Nordfeldth
7e638cb8da OpportunisticQM can't run as subsystem qm 2013-11-20 21:46:16 +01:00
Mikael Nordfeldth
9400795a5f Cron split into Cronish and OpportunisticQM
/main/cron changed to /main/runqueue

The key-required functionality is not throughly tested yet.
2013-11-20 21:20:42 +01:00
Mikael Nordfeldth
0cd93c2761 Cron plugin added and now default queue handler
Generally the Cron plugin will run if there's still execution time for
1 second since starting the Action processing. If you want to change
this (such as disabling, 0 seconds, or maybe running bigger chunks,
for like 4 seconds) you can do this, where 'n' is time in seconds.

   addPlugin('Cron', array('secs_per_action', n));

Add 'rel_to_pageload'=>false to the array if you want to run the queue
for a certain amount of seconds _despite_ maybe already having run that
long in the previous parts of Action processing.

Perhaps you want to run the cron script remotely, using a machine capable
of background processing (or locally, to avoid running daemon processes),
simply do an HTTP GET request to the route /main/cron of your GNU social.
Setting secs_per_action to 0 in the plugin config will imply that you run
all your queue handling by calling /main/cron (which runs as long as it can).

/main/cron will output "0" if it has finished processing, "1" if it should
be called again to complete processing (because it ran out of time due to
PHP's max_execution_time INI setting).

The Cron plugin also runs events as close to hourly, daily and weekly
as you get, based on the opportunistic method of running whenever a user
visits the site. This means of course that the cron events should be as
fast as possible, not only to avoid delaying page load for users but
also to minimize the risk of running into PHP's max_execution_time. One
suggestion is to only use the events to add new queue items for later processing.

These events are called CronHourly, CronDaily, CronWeekly - however there
is no guarantee that all events will execute, so some kind of failsafe,
transaction-ish method must be implemented in the future.
2013-11-19 14:13:33 +01:00
Mikael Nordfeldth
5998825458 We haven't added the cron plugin yet 2013-11-19 14:02:53 +01:00
Mikael Nordfeldth
450ae3043b Plugins should be initialized with an empty array, not null 2013-11-19 13:52:41 +01:00
Mikael Nordfeldth
c942bdcb43 Comment and typing improvements
To make the StatusNet::addPlugin() accept only arrays,
the lib/default.php had to be changed because all plugins
had 'null' as default value instead of an array.
2013-11-19 13:29:26 +01:00
Mikael Nordfeldth
06b068d43b Don't allow double plugin loading 2013-11-19 13:25:02 +01:00
Mikael Nordfeldth
048a435a5e GNUSOCIAL, not STATUSNET. Too many changes to be backwards compatible 2013-11-19 13:21:09 +01:00
Mikael Nordfeldth
1a0e17fea6 Minor queue fixes, probably not very important. Preparing for cron 2013-11-13 18:15:21 +01:00
Mikael Nordfeldth
0a93fa68f3 Slightly better indication that notice section shows incomplete text
Must still be improved somehow.
2013-11-11 13:18:23 +01:00
Mikael Nordfeldth
a987db2c55 Section notices should not take up too much space.
No configuration options for the max amount of characters yet.
2013-11-11 00:47:41 +01:00
Mikael Nordfeldth
1349eb349a curly braces to pick a character in string is not recommended 2013-11-11 00:45:30 +01:00
Mikael Nordfeldth
a480ff5605 Group mentions got the wrong class. Now lists get their own too! 2013-11-07 08:20:41 +01:00
Mikael Nordfeldth
5176f19f7d Cache key lead is 'gnusocial' now (restart daemons!) 2013-11-04 17:38:09 +01:00
Mikael Nordfeldth
413f040673 Profile->getGroupCount() should be used for groupcounts
This was found in the PHP error log as:
    "Trying to get property of non-object in %HTDOCS%/lib/profileaction.php on line 270"
2013-11-02 20:17:14 +01:00
Mikael Nordfeldth
2cecfe8f82 We can only handle Memcached_DataObject in NoResultException 2013-11-02 18:48:28 +01:00
Mikael Nordfeldth
5e054bfdb3 Minor typing stuff and syntax fixes 2013-11-02 17:28:11 +01:00
Mikael Nordfeldth
d289ccb7f2 Minor PHP stylistic features and typing stuff 2013-11-02 13:05:08 +01:00
Mikael Nordfeldth
25e61916f9 There are no LaconicaScripts left 2013-11-02 00:35:59 +01:00
Mikael Nordfeldth
bd86519d50 Minor labeling things for StatusNet to GNU social migration 2013-11-01 14:04:40 +01:00
Mikael Nordfeldth
6bc11b63e3 What was that NewMenu plugin doing there anyway? 2013-11-01 13:57:31 +01:00
Mikael Nordfeldth
f110fc5c9a Using GNUSOCIAL_VERSION instead of STATUSNET_VERSION 2013-11-01 13:51:41 +01:00
Mikael Nordfeldth
255943d78f User agents and generators changed to GNU social 2013-11-01 13:46:05 +01:00
Mikael Nordfeldth
ca66860a4f Better typing and minor fixes to OStatus related stuff 2013-11-01 13:20:45 +01:00
Mikael Nordfeldth
810495708d Version name strings updated, StatusNet only retained for copyright 2013-10-30 16:37:13 +01:00
Mikael Nordfeldth
58717fa6c5 Forgot to catch no-parent-exception
Unfortunately not a specific Exception right now, but we're getting to that.
2013-10-30 14:56:27 +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
e45edd6ae2 Use addPlugin! (esp. XMPP folks should do this)
If you're using XMPP by setting $config['xmpp'][*] then you should do:

    addPlugin('Xmpp', $config['xmpp']);

because setting it directly in $config[''] won't do anything.

Also, default resource for XMPP is now 'gnusocial'. If you want something
more random, set it in your addPlugin config array.
2013-10-30 12:28:39 +01:00
Mikael Nordfeldth
8dafce34c3 LoginAction somewhat converted to FormAction 2013-10-30 12:23:10 +01:00
Mikael Nordfeldth
f7c6dd4f6e mentioned was an array, not a single object 2013-10-29 15:06:02 +01:00