changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[ljcom] r6976: LJSUP-2276: Events Atom Stream

Committer: ssafronova
LJSUP-2276: Events Atom Stream

U   trunk/cgi-bin/LJ/Hooks/EventsFeed.pm
Modified: trunk/cgi-bin/LJ/Hooks/EventsFeed.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/EventsFeed.pm	2009-01-14 10:17:18 UTC (rev 6975)
+++ trunk/cgi-bin/LJ/Hooks/EventsFeed.pm	2009-01-14 10:51:35 UTC (rev 6976)
@@ -7,24 +7,14 @@
 use LJ::Stream::Comment;
 use TheSchwartz::Job;
 
-LJ::register_hook('add_to_class', sub {
-    my ($u, $class) = @_;
-
-    my $bit = LJ::class_bit($class);
-    my $newcaps = $u->caps | (1 << $bit);
-
+LJ::register_hook('modify_caps', sub {
+    my $params = shift;
+    my $u = $params->{u};
+    my $newcaps = $params->{newcaps};
     LJ::EventsFeed::UserCaps->new($u, $newcaps)->fire;
+    return 1; # required to be defined
 });
 
-LJ::register_hook('remove_from_class', sub {
-    my ($u, $class) = @_;
-
-    my $bit = LJ::class_bit($class);
-    my $newcaps = $u->caps & ~(1 << $bit);
-
-    LJ::EventsFeed::UserCaps->new($u, $newcaps)->fire;
-});
-
 LJ::register_hook('account_delete', sub {
     my $u = shift;
     LJ::EventsFeed::UserDeleted->new($u)->fire;
@@ -125,4 +115,16 @@
     $sclient->insert_jobs($job) if $sclient and $job;
 });
 
+LJ::register_hook('account_will_be_visible', sub {
+    my $u = shift;
+    return unless $u->is_deleted;
+    LJ::EventsFeed::UserUnDeleted->new($u)->fire;
+});
+
+LJ::register_hook('post_email_change', sub {
+    my $params = shift;
+    my $u = $params->{user};
+    LJ::EventsFeed::EmailChanged->new($u)->fire;
+});
+
 1;

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments