It's always the notice's author we want to check this for anyway.
I kept getting errors like, which are now fixed:
Trying to get property of non-object in /srv/www/vhosts/se/umeahackerspace/social/%/htdocs/local/plugins/Qvitter/QvitterPlugin.php on line 594
I guess it might also screw up (somehow?) if some future awesome
notice handling thing decided to run the StartNoticeDistribute event
when the session is not currently used by the notice's author. But
that's a bit far-fetched.
This uses the function in GNU social index.php which does the exact same
filtering as desired by Qvitter, but in a compatible way with both the
querystring and PATH_INFO rewrite rules for webservers.
I think the event handler should be doublechecked on more than one
point. For example the call arguments don't seem to include an array
argument which can include an option called "include_user". Also the
$scoped value is not necessarily always a Profile, it can be null too.
In older versions ->getUrl() actually just returns ->url, but newer
versions of GNU social have some logic which takes care of certain
issues with outdated URLs stored in the database tables etc.
GNU social will however make sure that whenever the event is called, User
_has_ been set, but for anyone not stalking the nightly branch they will
have less messages like this in their PHP error log:
PHP Notice: Trying to get property of non-object in [...]/Qvitter/QvitterPlugin.php on line 810
Plugin::path() needs its argument to actually be a file that exists
relative to the plugin base directory so that it can determine
whether the plugin is rooted in / or /local.
So don't include HTTP GET args in the path() argument--append them after
getting the value back from path().
I installed Qvitter in local/plugins/ rather than plugins/ which
meant that some statically assigned paths were incorrect. This patch
will instead find the current Qvitter directory when the plugin is
loaded and use that when finding ctime for files on the filesystem.