Commit Graph

196 Commits

Author SHA1 Message Date
Evan Prodromou
e26a843caf Offload inbox updates to a queue handler to speed up posting online
Moved much of the writing that happens when posting a notice to a new
queuehandler, distribqueuehandler. This updates tags, groups, replies
and inboxes at queue time (or at Web time, if queues are disabled).

To make this work well, I had to break up the monolithic
Notice::blowCaches() and make cache blowing happen closer to where
data is updated.

Squashed commit of the following:

commit 5257626c62750ac4ac1db0ce2b71410c5711cfa3
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 14:56:41 2010 -0500

    slightly better handling of blowing tag memory cache

commit 8a22a3cdf6ec28685da129a0313e7b2a0837c9ef
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 01:42:56 2010 -0500

    change 'distribute' to 'distrib' so not too long for dbqueue

commit 7a063315b0f7fad27cb6fbd2bdd74e253af83e4f
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 01:39:15 2010 -0500

    change handle_notice() to handle() in distributqueuehandler

commit 1a39ccd28b9994137d7bfd21bb4f230546938e77
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 16:05:25 2010 -0500

    error with queuemanager

commit e6b3bb93f305cfd2de71a6340b8aa6fb890049b7
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 01:11:34 2010 -0500

    Blow memcache at different point rather than one big function for Notice class

commit 94d557cdc016187d1d0647ae1794cd94d6fb8ac8
Author: Evan Prodromou <evan@status.net>
Date:   Mon Jan 25 00:48:44 2010 -0500

    Blow memcache at different point rather than one big function for Notice class

commit 1c781dd08c88a35dafc5c01230b4872fd6b95182
Author: Evan Prodromou <evan@status.net>
Date:   Wed Jan 20 08:54:18 2010 -0500

    move broadcasting and distributing to new queuehandler

commit da3e46d26b84e4f028f34a13fd2ee373e4c1b954
Author: Evan Prodromou <evan@status.net>
Date:   Wed Jan 20 08:53:12 2010 -0500

    Move distribution of notices to new distribute queue handler
2010-01-25 18:08:21 -05:00
Evan Prodromou
1bbd19169f unimplement repeatedToMe() until we figure out how 2010-01-13 00:44:29 -08:00
Evan Prodromou
1e7ec69190 some formatting changes to make inblobs work 2010-01-09 10:02:07 -08:00
Evan Prodromou
f2a403589c Use inbox instead of notice_inbox 2010-01-09 10:02:07 -08:00
Evan Prodromou
39bdda9c7e More configuration options for location sharing 2009-12-28 14:43:34 -08:00
Evan Prodromou
bb93d6b1c7 remove namespace setting from location; it's unused 2009-12-28 14:21:07 -08:00
Evan Prodromou
c07f221040 check if other user exists before unsub 2009-12-28 10:42:31 -08:00
Brion Vibber
fa0fbd0118 Fix for massively slow friends timeline query due to indexing bug introduced with repeats.
Sorting on notice.id when our primary selector was notice_inbox.user_id caused a filesort and table scan of the notice table.
Switchng to notice_inbox's notice_id means we can use our index, and everything comes right up.

Before:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice.id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
| id | select_type | table        | type   | possible_keys                      | key     | key_len | ref                           | rows   | Extra                                        |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
|  1 | SIMPLE      | notice_inbox | ref    | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4       | const                         | 102600 | Using index; Using temporary; Using filesort |
|  1 | SIMPLE      | notice       | eq_ref | PRIMARY                            | PRIMARY | 4       | stoica.notice_inbox.notice_id |      1 | Using index                                  |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+

After:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice_id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
| id | select_type | table        | type   | possible_keys                      | key     | key_len | ref                           | rows   | Extra                    |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
|  1 | SIMPLE      | notice_inbox | ref    | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4       | const                         | 102816 | Using where; Using index |
|  1 | SIMPLE      | notice       | eq_ref | PRIMARY,notice_repeatof_idx        | PRIMARY | 4       | stoica.notice_inbox.notice_id |      1 | Using where              |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
2009-12-22 20:30:41 -08:00
Brion Vibber
0ca80f78fb Add doc comments listing the array parameters for User::register() and Notice::saveNew() 2009-12-16 09:27:48 -05:00
Brion Vibber
a998bda4a5 Fix UserRightsTest unit tests 2009-12-16 09:27:48 -05:00
Evan Prodromou
2a8eee0e0b add friends_timeline with no repeats in it 2009-12-14 16:41:25 -05:00
Evan Prodromou
1ec54d3433 add statuses/retweeted_to_me to API 2009-12-12 16:15:23 -05:00
Evan Prodromou
cfe67a9c01 add statuses/retweets_of_me to API 2009-12-12 16:00:27 -05:00
Evan Prodromou
138ce0cd05 add statuses/retweeted_by_me api action 2009-12-12 15:35:05 -05:00
Zach Copley
d2b42577de Was deleting wrong subscription during block. Now deletes the blockee's sub if it exists. 2009-12-03 17:44:34 -08:00
Zach Copley
aef4cc0a59 Make it impossible to block (and thus unsubscribe from your
self-subscription) via the API.  Additionally, make it impossible
to block yourself or unsubscribe from yourself, period.

I also made User use the subs.php helper function for unsubscribing
during a block.

Hopefully, these changes will get rid of the problem of people
accidentally deleting their self-subscriptions once and for all
(knock on wood).
2009-12-03 17:06:58 -08:00
Evan Prodromou
6a1afda259 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	classes/statusnet.ini
2009-11-17 06:25:07 -05:00
Evan Prodromou
d2145a5b7f Move rights check to profile and add right for new notices
Added a right for new notices, realized that the hasRight() method
should be on the profile, and moved it.

Makes this a less atomic commit but that's the way it goes sometimes.
2009-11-16 19:03:59 +01:00
Craig Andrews
7177585630 getGroups was not handling the case where limit=null correctly 2009-11-16 11:22:45 -05:00
Evan Prodromou
3e08309826 change uses of User_role to Profile_role 2009-11-16 16:06:52 +01:00
Evan Prodromou
792590bcdc move role functions to Profile class 2009-11-16 15:52:33 +01:00
Evan Prodromou
c9475c76a8 define rights around how to silence, sandbox, and delete a user 2009-11-15 15:59:10 +01:00
Craig Andrews
ed690615de Added a User_username table that links the external username with a StatusNet user_id
Added EmailAuthenticationPlugin
Added ReverseUsernameAuthenticationPlugin
Changed the StartChangePassword and EndChangePassword events to take a user, instead of a nickname
User::allowed_nickname was declared non-static, but used as if it was static, so I made the declaration static
2009-11-12 20:12:36 -05:00
Brion Vibber
088081675f Revert "Remove more contractions"
This reverts commit 5ab709b739.

Missed this one yesterday...
2009-11-09 20:01:46 +01:00
Siebrand Mazeland
5ab709b739 Remove more contractions
* doesn't
* won't
* isn't
* don't
2009-11-08 23:32:15 +01:00
Evan Prodromou
111f6a775d Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2009-11-08 17:06:41 -05:00
Brion Vibber
8d44b6a5a2 Fix bug 1962: deleteuser.php regression when OpenID plugin not enabled
The User_openid data object was explicitly listed as a related field to delete from in User::delete(); this class doesn't exist anymore by default since OpenID was broken out to a plugin.
Added UserDeleteRelated event for plugins to add related tables to delete from at user delete time.
2009-11-08 14:40:30 +01:00
Evan Prodromou
38833af6f1 use upper-case constants for roles and rights in hasRight() 2009-11-07 19:16:54 -05:00
Evan Prodromou
a2b8303925 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	classes/User.php
2009-11-02 18:13:04 -05:00
Evan Prodromou
61419038e5 Merge branch '0.8.x' into 0.9.x
Conflicts:
	README
2009-11-02 18:11:45 -05:00
Craig Andrews
15d0055c6f allowed_nickname blocks top level url router names 2009-11-02 15:18:56 -05:00
Evan Prodromou
6664528244 Revert "Blacklist all files and directories in the web root (INSTALLDIR). Much more elegant than manually keep tracking of these invalid usernames."
This reverts commit 15f9c80c28.

So, so, elegant! And so, so, incorrect!

We can't have a user named 'notice' because that would interfere with
URLs like /notice/1234. However, there is no file named 'notice' in
the Web root.

If there were a way to automatically pull out the virtual paths in the
root dir, this may make sense. Until then, we keep track here.
2009-11-01 11:09:14 -05:00
Evan Prodromou
b73d6d18ba Merge branch '0.9.x' into location 2009-10-28 17:24:53 -04:00
Carlos Perilla
bf701b8235 Enable welcome bot to broadcast it's notices 2009-10-27 23:38:08 -04:00
Evan Prodromou
943b2bea09 update location while registering 2009-10-23 11:46:44 -04:00
Evan Prodromou
4f5badda94 remove inboxes option 2009-10-13 17:38:27 -04:00
Evan Prodromou
c5047fd90a Merge branch '0.8.x' into 0.9.x
Conflicts:
	classes/Profile.php
2009-10-04 03:07:37 -04:00
Evan Prodromou
94e3f6bb09 also delete blocks 2009-10-02 15:29:57 -04:00
Evan Prodromou
b3b3af9a2e Merge branch '0.8.x' into deleteuser 2009-10-02 15:27:55 -04:00
Evan Prodromou
38345d0783 let hooks override standard user rights 2009-09-27 21:11:45 -04:00
Evan Prodromou
6c069312e2 user rights 2009-09-27 21:11:45 -04:00
Evan Prodromou
8284b3cb82 Merge branch '0.8.x' into 0.9.x
Conflicts:
	actions/requesttoken.php
	classes/File.php
	install.php
	lib/noticeform.php
2009-09-23 09:45:22 -04:00
Craig Andrews
15f9c80c28 Blacklist all files and directories in the web root (INSTALLDIR). Much more elegant than manually keep tracking of these invalid usernames. 2009-09-18 17:53:06 -04:00
Brenda Wallace
815630fe63 used standard SQL that mysql and pgsql both like 2009-08-28 20:45:12 +12:00
Brenda Wallace
b9ea2bf1bc used standard SQL that mysql and pgsql both like 2009-08-28 20:44:11 +12:00
Brenda Wallace
b833b725a8 make use of common_database_tablename() 2009-08-28 20:42:13 +12:00
Evan Prodromou
522008dee5 methods on User to grant, check, and revoke roles 2009-08-27 11:38:31 -07:00
Evan Prodromou
5d09b6b3f0 Merge branch '0.8.x' into 0.9.x
Conflicts:
	EVENTS.txt
	actions/finishremotesubscribe.php
	actions/postnotice.php
	actions/public.php
	actions/remotesubscribe.php
	actions/showstream.php
	actions/updateprofile.php
	actions/userauthorization.php
	classes/laconica.ini
	lib/common.php
	lib/oauthstore.php
	lib/omb.php
2009-08-27 11:16:45 -07:00
Evan Prodromou
df86aa7214 define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
Evan Prodromou
865b716f09 change LACONICA to STATUSNET 2009-08-25 18:42:34 -04:00