Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r9534: LJSUP-6859 (Twitter Digest // log enable...

Committer: ailyin
LJSUP-6859 (Twitter Digest // log enable/disable of the feature to statushistory)
U   trunk/cgi-bin/LJ/Setting/TwitterConnect.pm
Modified: trunk/cgi-bin/LJ/Setting/TwitterConnect.pm
===================================================================
--- trunk/cgi-bin/LJ/Setting/TwitterConnect.pm	2010-09-22 09:47:41 UTC (rev 9533)
+++ trunk/cgi-bin/LJ/Setting/TwitterConnect.pm	2010-09-22 09:54:16 UTC (rev 9534)
@@ -108,10 +108,22 @@
     }
 
     if ( $class->get_arg( $args, 'digest' ) ) {
-        LJ::TwitterDigest->set_next_post_time($u);
+        unless (LJ::TwitterDigest->turned_on_for_user($u)) {
+            LJ::statushistory_add( $u, $u,
+                                   'twitter_digest',
+                                   'Twitter Digest turned on' );
+
+            LJ::TwitterDigest->set_next_post_time($u);
+        }
     }
     else {
-        LJ::TwitterDigest->turn_off_for_user($u);
+        if (LJ::TwitterDigest->turned_on_for_user($u)) {
+            LJ::statushistory_add( $u, $u,
+                                   'twitter_digest',
+                                   'Twitter Digest turned off' );
+
+            LJ::TwitterDigest->turn_off_for_user($u);
+        }
     }
 
     return 1;

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

  • 4 comments