Commit Graph

90 Commits

Author SHA1 Message Date
Nym Coy 1f866fcaed ActivityGenerationTests.php fails but doesn't crash anymore.
Fixed an error where a profile id was reused after another profile was
deleted, and the new profile still had the deleted role.

Fixed ActivityGenerationTests::testNoticeInfoRepeated() which was passing
User instead of Profile, throwing errors.

tests/ActivityGenerationTests.php now passes.

CommandInterpreterTest now passes.

Moved JidValidateTest to XmppValidateTest, since Jabber functionality has
moved to the XmppPlugin. Tests work but don't pass, but they are at least
skipped if XmppPlugin is not active.

LocationTest passes, but the tests are not very good. Lots of nulls.

MediaFileTest passes.

NicknameTest passes. Nickname::normalize() now throws an error if the
nickname is too long with underscores.

UserFeedParseTest passes.

URLDetectionTest passes if $config['linkify']['(bare_ipv4|bare_ipv6|
bare_domains)'] are false. Untested otherwise.

Fixed Nickname::isBlacklisted() so it does not throw an error if
$config['nickname]['blacklist'] not set.
2016-08-14 11:55:49 +05:30
Mikael Nordfeldth 1194c47c5d ksort on commands array to avoid converting to numerical array 2015-04-19 21:12:26 +02:00
Mikael Nordfeldth 940737a958 Finalize move of 'repeat' Command 2015-03-12 19:22:05 +01:00
Mikael Nordfeldth 046d070ad4 MessageCommand moved to DirectMessage plugin 2014-11-07 16:23:34 +01: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 b0cc9292b1 Notice->repeat() function takes Profile as argument now 2014-05-18 21:03:10 +02:00
Mikael Nordfeldth 34b570352f Fix Direct Message functionality. 2014-04-29 20:37:58 +02:00
Mikael Nordfeldth 9b6633698c Group discovery from text functions polished
Also removed the entirely unused saveGroups function.

Now avoiding multiGet and using listFind in Profile->getGroups()
so we don't have to deal with ArrayWrapper.
2013-10-29 13:40:14 +01:00
Mikael Nordfeldth fcba540a14 Removed legacy OMB. Use OStatus for remote profiles. 2013-10-28 16:22:09 +01:00
Mikael Nordfeldth 63306081bc Subscription "get by" functions now don't use ArrayWrappers
They were getting in the way of some strict-typing stuff.
2013-09-21 18:38:14 +02:00
Mikael Nordfeldth 747fe9d59b Tidying up getUser calls to profiles and some events
getUser calls are much more strict, and one place where this was found was
in the (un)subscribe start/end event handlers, which resulted in making the
Subscription class a bit stricter, regarding ::start and ::cancel at least.
Several minor fixes in many files were made due to this.

This does NOT touch the Foreign_link function, which should also have a more
strict getUser call. That is a future project.
2013-09-09 23:03:34 +02:00
Mikael Nordfeldth e5e3aeb4e6 newmessage (and Message class) fixed for FormAction
Also added a needLogin function to the Action class, which will do
redirect to login page with proper returnto setting.
2013-09-02 11:05:30 +02:00
Mikael Nordfeldth 2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Siebrand Mazeland 173d20e1f9 L10n updates. 2011-06-17 22:36:24 +02:00
Siebrand Mazeland f20ddaec56 Add plural support where needed for added/removed tags messages. 2011-04-13 13:30:21 +02:00
Siebrand Mazeland f0d762f196 Update/add translator documentation.
L10n/i18n updates.
Superfluous whitespace removed.
Add FIXME for a few i18n issues I couldn't solve this quickly.

Takes care of documentation for all core code added in merge of "people tags" feature (Commit:e75c9988ebe33822e493ac225859bc593ff9b855).
2011-04-10 19:59:55 +02:00
Shashi Gowda 57198a7464 Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	actions/tagother.php
	lib/subscriberspeopleselftagcloudsection.php
	lib/subscriptionspeopleselftagcloudsection.php
2011-04-04 13:26:27 +05:30
Siebrand Mazeland 7bd594e9d3 Use _m() instead of ngettext(). 2011-04-03 22:08:50 +02:00
Shashi Gowda 5a2bab07b2 Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	actions/tagother.php
	classes/Profile.php
	classes/Profile_tag.php
	js/util.min.js
2011-03-30 15:47:42 +05:30
Brion Vibber 9adbb49fc9 Consolidate some precondition checks for repeats, fix a couple bits in the repeat command.
Notice::saveNew() now does these checks directly when making a repeat:
* make sure the original is valid and existing
* stop you from repeating your own message
* stop you from repeating something you've previously repeated
* prevent repeats of any non-public messages
* explicit inScope() check to make sure you can read the original too (just in case there's a funky extension at play that changes scoping rules)

These error conditions throw exceptions, which the caller either uses as an error message or passes on up the stack, without having to duplicate the checks in each i/o channel.
2011-03-29 16:20:12 -07:00
Evan Prodromou 32145484c2 Disallow repeats (retweets) of private notices
We disallow repeating a notice (or whatever) if the scope of the
notice is too private. So, only notices that are public scope
(available to everyone in the world) or site scope (available to
everyone on the site) can be repeated.

Enforce this rule at a low level in Notice.php, and in the API,
commands, and Web UI. Repeat button doesn't appear on tightly-scoped
notices in the Web UI.
2011-03-29 11:53:26 -04:00
Shashi Gowda bf121a695a Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
Conflicts:
	classes/Profile.php
2011-03-22 07:59:06 +05:30
Shashi Gowda 31c1177970 Merge branch '1.0.x' into people_tags_rebase
Conflicts:
	EVENTS.txt
	actions/peopletag.php
	actions/tagother.php
	classes/Notice.php
	js/util.js
	js/util.min.js
	lib/accountprofileblock.php
	lib/action.php
	lib/activityobject.php
	lib/command.php
	lib/personalgroupnav.php
	plugins/OStatus/OStatusPlugin.php
2011-03-22 07:56:25 +05:30
Brion Vibber 541dfa04fe Switch things from calling Group_member::join & leave & calling events manually to running through Profile::joinGroup() && Profile::leaveGroup(), with the events encapsulated. 2011-03-21 14:35:29 -07:00
Brion Vibber bd12546984 Allow plugins to modify or append command help text; broke the command help down into pieces which also will aid translators in future, as the entire message blob won't change every time something gets fiddled with. 2011-03-16 17:07:06 -07:00
Shashi Gowda b176f0fb58 tag / untag commands for people tags 2011-03-07 00:46:42 +05:30
Brion Vibber e42db528e2 More fixes for 'fav' IM command: don't die with a fatal error if the notice has already been favored, and don't spew a warning when checking for user ID match. 2011-03-01 17:17:41 -08:00
Brion Vibber 9df856e667 Merge branch '0.9.x' into merge
Conflicts:
	README
	actions/hostmeta.php
	classes/File_redirection.php
	lib/common.php
	lib/designsettings.php
	lib/router.php
	lib/util.php
	lib/xmppmanager.php
	plugins/OStatus/OStatusPlugin.php
2010-12-07 10:50:05 -08:00
Brion Vibber aa96c3c1d9 Fix for tickets #2917, #2262: user URL shortening options not being applied in non-web channels
common_shorten_links() can only access the web session's logged-in user, so never properly took user options into effect for posting via XMPP, API, mail, etc.

Adds an optional $user parameter on common_shorten_links(), and a $user->shortenLinks() as a clearer interface for that.
Tweaked some lower-level functions so $user gets passed down -- making the $notice_id param previously there for saving URLs at notice save time generalized a little.

Note also ticket #2919: there's a lot of duplicate code calling the shortening, checking the length, and reporting near-identical error messages. These should be consolidated to aid in code and translation maintenance.
2010-12-02 13:41:56 -08:00
Brion Vibber 3be352551a Normalize username strings in command parsing 2010-11-29 16:44:40 -08:00
Brion Vibber b716d01a41 Merge branch '0.9.x' into 1.0.x 2010-11-03 16:09:49 -07:00
Siebrand Mazeland a65362f7fa Add context for different uses of "%1$s (%2$s)" 2010-11-02 23:08:59 +01:00
Brion Vibber 04ca706601 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts:
	actions/confirmaddress.php
	actions/othersettings.php
2010-11-02 15:02:10 -07:00
Siebrand Mazeland b89dfa3a5b Fix i18n issues that are solved by using plural. 2010-11-01 16:49:33 +01:00
Brion Vibber 59119482ca Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts:
	actions/hostmeta.php
	actions/imsettings.php
	classes/User.php
	lib/adminpanelaction.php
	lib/channel.php
	lib/default.php
	lib/router.php
	lib/util.php
2010-10-04 12:54:36 -07:00
Siebrand Mazeland b9177f5e2e * i18n/L10n and translator documentation updates.
* whitespace and indentation updates
2010-09-29 00:39:45 +02:00
Brion Vibber 20a0a4acff Explicitly mark a translator note on the command list help message that the command names must not be translated 2010-09-16 11:05:31 -07:00
Siebrand Mazeland d6be5be548 Move translator hint to where gettext will actually see it and replace tab by spaces. 2010-09-13 21:10:53 +02:00
Siebrand Mazeland a590f2cb0f Fix typos in translator comments. 2010-09-13 21:10:53 +02:00
Brion Vibber 2196d00b1b Merge branch '0.9.x' into 1.0.x
Conflicts:
	lib/command.php
2010-09-02 15:04:25 -07:00
Siebrand Mazeland f64fff379c * when using multiple parameters, number them
* fix double space to single space
* use consistent punctuation in messages
* complete translation hints for all commands
* add an i18n fixme for missing plural support
* trailing whitespace removed
2010-08-28 16:51:49 +02:00
Craig Andrews 39392e03a7 Merge branch '0.9.x' into 1.0.x
Conflicts:
	actions/confirmaddress.php
	actions/imsettings.php
2010-04-18 19:21:15 -04:00
Siebrand Mazeland c59e90b20b Number parameters 2010-04-11 23:57:18 +02:00
Siebrand Mazeland 8795b3546d Add translator documentation and number parameters if multiple are used in a message. 2010-04-11 23:39:24 +02:00
Brion Vibber c3ceaa893f Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 1.0.x 2010-03-24 14:11:01 -07:00
Brion Vibber 533a3bf6a3 Consistently send Profiles into Fave::addNew() 2010-03-23 11:06:37 -07:00
Brion Vibber e89908f261 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 1.0.x
Conflicts:
	lib/channel.php
	scripts/imdaemon.php
2010-03-22 13:56:16 -07:00
Craig Andrews 2179aae758 fubared a715271f84 - this is the fix 2010-03-11 21:02:41 -05:00
Craig Andrews a715271f84 reuse Subscription::cancel instead of reimplementing it.
I didn't know this method existed before... pretty neat.
2010-03-11 20:40:25 -05:00
Brion Vibber 8bf1b54abd Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-03-09 13:07:52 -08:00