Brion Vibber [Mon, 21 Feb 2011 19:42:32 +0000 (11:42 -0800)]
Fixes for ticket #3052: some commands started triggering when extra text is supposed to suppress them
Regressions caused by bad refactoring in commit 21feac3bea72b0ecd88a3.
Test cases in tests/CommandInterpreterTest.php were made against the pre-refactoring code, and now check out with the fixed code.
Failures were caused by not changing logic structure when moving from multiple exit points (each if point would return directly with a null or an object) to setting a result variable and then falling through to a common exit point. Without the if statements being restructured, the result variable would just get overridden by the next case.
Evan Prodromou [Mon, 21 Feb 2011 15:20:42 +0000 (10:20 -0500)]
Extend authorization framework to cover login and API use
I've extended the rights framework (centering on the Right class and Profile::hasRight()) to cover
Web login and API use. This will make it possible to prevent login and API use by users.
I added two new Right constants to the Right class: WEBLOGIN and API. I check these rights using
Profile::hasRight() when initializing users. If the rights check fails, I throw an exception.
I created a new AuthorizationException class for this particular
exception, in order to allow a different UI for these kinds of exceptions (or whatever).
* improve L10n consistency for English. For example proper punctuation for all button and label titles.
* fix some i18n bugs (in-message variables).
* update/add translator documentation.
* remove superfluous whitespace.
Brion Vibber [Fri, 11 Feb 2011 21:21:53 +0000 (13:21 -0800)]
Fix for failure/exception on subscription/subscriber lists when deleted profiles are stuck in cached list.
Workaround for deleted profiles still appearing in cached subscriptions/subscribers lists: if we couldn't fetch them, don't include them in the ArrayWrapper.
ArrayWrapper doesn't deal well with null entries, which aren't meant to happen in how it works. This code has recently changed from dying directly with a PHP fatal error in that case to throwing an exception, which allows tracking down the caller.
It looks like there might be some cases where profiles and their matching subscriptions get deleted, but the subscription entries don't get properly cleared from cache... that still bears further investigation. The regular code path looks ok; calls Subscription::cancel() from code called in Profile::delete(); but if they're batch-deleted instead of one row at a time, that could fail to trigger.
Brion Vibber [Thu, 10 Feb 2011 18:53:24 +0000 (10:53 -0800)]
Fix for ticket #3039: TwitterBridge was incorrectly sending repeats of Twitter-bound messages if the repeater has sending of things to Twitter disabled.
A repeat/retweet is roughly equivalent to an active direct post, so should follow the posting rules, rather than always sending over as we do for fave notifications.
Brion Vibber [Wed, 9 Feb 2011 21:46:48 +0000 (13:46 -0800)]
Partial revert of 073f3e99: restores the original non-hashbang URLs for twitter users as the remote profile.
Should fix issue #3027: twitter user avatars not getting imported.
Due to the change in URI, all twitter users that had been previously seen were getting new profile entries, which tried to save the same avatar. This would fail as Avatar.url has a unique index.
Note: now anything new seen in the last couple days in production will still potentially conflict.
Brion Vibber [Wed, 9 Feb 2011 06:28:23 +0000 (22:28 -0800)]
Revert jQuery Form to r2.17 -- the latest fails with our Meteor stuff the way it tweaks document.domain (which also causes other AJAX-related problems and needs to be destroyed one of these days...)
Evan Prodromou [Tue, 8 Feb 2011 16:33:36 +0000 (11:33 -0500)]
Make ShowmessageAction not be a subclass of MailboxAction
The ShowmessageAction was using the MailboxAction to do its display of
a single direct message. Since we redid the nickname management, this
was breaking (MailboxAction requires a nickname argument,
ShowmessageAction does not, and nickname validation that used to
quietly fail now throws an exception).
I've moved the message list processing to its own widget class, so the
need to subclass MailboxAction has disappeared. I've rewritten this
action to use the MessageListItem widget, and it works fine now.
Evan Prodromou [Tue, 8 Feb 2011 16:11:21 +0000 (11:11 -0500)]
Create and use MessageList widget
Our mailbox actions (inbox and outbox) were doing their own display of
messages. This was causing issues with especially showmessage, which
since the more rigourous nickname checks were added, no longer works as
a mailbox subclass.
I've taken the time to rip out the message listing code from MailboxAction
and moved it to a MessageList widget. The different mailboxes now have their
own subclasses that show the correct profile in the list.
Brion Vibber [Mon, 7 Feb 2011 22:38:35 +0000 (14:38 -0800)]
Issue #3025: string -> boolean for profile_background_tile entry in JSON user results from Twitter-compat API
This entry was using the strings 'true' and 'false' instead of literal booleans, which could confuse clients expecting literal booleans as in other places and on Twitter in this place.
Brion Vibber [Mon, 7 Feb 2011 20:39:40 +0000 (12:39 -0800)]
Add a brief explanation of what group inbox is at the top of the page (instructions section), plus a message to show when there are no private messages in the inbox.
Brion Vibber [Mon, 7 Feb 2011 20:18:41 +0000 (12:18 -0800)]
Fix group regexes that got missed in Nickname::DISPLAY_FMT update: fixes bug where group linking happened, but not actual delivery, when using _underscores_ in the !group_name