Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[ljcom] r10720: LJSV-1659: Need events for suspend/unsus...

Committer: amyshkin
LJSV-1659: Need events for suspend/unsuspend
U   trunk/cgi-bin/LJ/EventsFeed/ApplyTheme.pm
U   trunk/cgi-bin/LJ/EventsFeed/EmailChanged.pm
U   trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm
U   trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm
U   trunk/cgi-bin/LJ/EventsFeed/ProfileSave.pm
U   trunk/cgi-bin/LJ/EventsFeed/UserCreated.pm
U   trunk/cgi-bin/LJ/EventsFeed/UserEvent.pm
U   trunk/cgi-bin/LJ/EventsFeed/UserSuspend.pm
U   trunk/cgi-bin/LJ/EventsFeed/UserUnSuspend.pm
U   trunk/cgi-bin/LJ/Hooks/EventsFeed.pm
Modified: trunk/cgi-bin/LJ/EventsFeed/ApplyTheme.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/ApplyTheme.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/ApplyTheme.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -3,5 +3,5 @@
 use strict;
 use base 'LJ::EventsFeed::UserEvent';
 sub xml_tag_name { return 'journal_style_changed'  }
- 
+
 1;

Modified: trunk/cgi-bin/LJ/EventsFeed/EmailChanged.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/EmailChanged.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/EmailChanged.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -3,5 +3,5 @@
 use strict;
 use base 'LJ::EventsFeed::UserEvent';
 sub xml_tag_name { return 'email_changed'  }
- 
+
 1;

Modified: trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -1,27 +1,9 @@
 package LJ::EventsFeed::EntryUpdated;
 
 use strict;
-use base 'LJ::EventsFeed';
+use base 'LJ::EventsFeed::EntryEvent';
 use Carp qw (croak);
 
-sub new {
-    my ($class, $u, $entry) = @_;
+sub xml_tag_name { return 'entry_updated' }
 
-    return $class->SUPER::new(
-                              userid      => $u->userid,
-                              userlogin   => $u->user,
-                              entry_url   => $entry->url,
-                             );
-}
-
-sub as_xml {
-    my $self = shift;
-    my $params = $self->params;
-
-    return $self->xml_head('entry_updated') 
-            . "<journal name='$params->{userlogin}' id='$params->{userid}' />"
-            . "<entry url='$params->{entry_url}' />"
-            . $self->xml_footer;
-}
-
 1;

Modified: trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -1,27 +1,9 @@
 package LJ::EventsFeed::NewEntry;
 
 use strict;
-use base 'LJ::EventsFeed';
+use base 'LJ::EventsFeed::EntryEvent';
 use Carp qw (croak);
 
-sub new {
-    my ($class, $u, $entry) = @_;
+sub xml_tag_name { 'new_entry' }
 
-    return $class->SUPER::new(
-                              userid      => $u->userid,
-                              userlogin   => $u->user,
-                              entry_url   => $entry->url,
-                             );
-}
-
-sub as_xml {
-    my $self = shift;
-    my $params = $self->params;
-
-    return $self->xml_head('new_entry') 
-            . "<journal name='$params->{userlogin}' id='$params->{userid}' />"
-            . "<entry url='$params->{entry_url}' />"
-            . $self->xml_footer;
-}
-
 1;

Modified: trunk/cgi-bin/LJ/EventsFeed/ProfileSave.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/ProfileSave.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/ProfileSave.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -2,7 +2,7 @@
 
 use strict;
 use base 'LJ::EventsFeed::UserEvent';
-sub xml_tag_name { return 'profile_updated'  }
- 
+sub xml_tag_name { return 'profile_updated' }
+
 1;
 

Modified: trunk/cgi-bin/LJ/EventsFeed/UserCreated.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/UserCreated.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/UserCreated.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -3,6 +3,6 @@
 use strict;
 use base 'LJ::EventsFeed::UserEvent';
 sub xml_tag_name { return 'created' }
- 
+
 1;
 

Modified: trunk/cgi-bin/LJ/EventsFeed/UserEvent.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/UserEvent.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/UserEvent.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -6,7 +6,7 @@
 use base 'LJ::EventsFeed';
 use Carp qw (croak);
 
-sub xml_tag_name { die "xml_tag_name must be overriden in child class"; } 
+sub xml_tag_name { die "xml_tag_name must be overriden in child class"; }
 
 sub new {
     my ($class, $u) = @_;
@@ -24,10 +24,10 @@
 sub as_xml {
     my $self = shift;
     my $params = $self->params;
-    
-    return $self->xml_head( $self->xml_tag_name ) . 
-            "<user id='$params->{'id'}' login='$params->{'login'}'" . 
-            " type='$params->{'type'}' caps='$params->{'caps'}'/>" . 
+
+    return $self->xml_head( $self->xml_tag_name ) .
+            "<user id='$params->{'id'}' login='$params->{'login'}'" .
+            " type='$params->{'type'}' caps='$params->{'caps'}'/>" .
             $self->xml_footer;
 }
 

Modified: trunk/cgi-bin/LJ/EventsFeed/UserSuspend.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/UserSuspend.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/UserSuspend.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -2,6 +2,6 @@
 
 use strict;
 use base 'LJ::EventsFeed::UserEvent';
-sub xml_tag_name { return 'user_suspend'  }
- 
+sub xml_tag_name { return 'user_suspend' }
+
 1;

Modified: trunk/cgi-bin/LJ/EventsFeed/UserUnSuspend.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/UserUnSuspend.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/EventsFeed/UserUnSuspend.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -3,5 +3,5 @@
 use strict;
 use base 'LJ::EventsFeed::UserEvent';
 sub xml_tag_name { return 'user_unsuspend' }
- 
+
 1;

Modified: trunk/cgi-bin/LJ/Hooks/EventsFeed.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/EventsFeed.pm	2011-06-30 09:18:16 UTC (rev 10719)
+++ trunk/cgi-bin/LJ/Hooks/EventsFeed.pm	2011-06-30 09:18:24 UTC (rev 10720)
@@ -127,7 +127,7 @@
 
 LJ::register_hook('edit_comment', sub {
     my ($journalid, $jitemid, $jtalkid) = @_;
-    
+
     return if $LJ::DISABLED{'commentsfeed'};
 
     if ($LJ::COMMENT_ATOM_STREAM{publish_method} eq 'schwartz'){
@@ -166,8 +166,8 @@
 LJ::register_hook('postpost', sub {
     my $params     = shift;
     my $entry    = $params->{entry};
-    my $journal  = $params->{journal}; 
-    
+    my $journal  = $params->{journal};
+
     return unless LJ::is_enabled('events-feed-post-events');
     LJ::EventsFeed::NewEntry->new($journal, $entry)->fire;
 });

Tags: ljcom, pm, zilogic
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