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

[livejournal] r18735: LJSUP-8197 (SMS notifications does not a...

Committer: ailyin
LJSUP-8197 (SMS notifications does not appear after changing IP on settings page)
U   trunk/cgi-bin/LJ/NotificationMethod.pm
U   trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm
U   trunk/htdocs/manage/profile/index.bml
Modified: trunk/cgi-bin/LJ/NotificationMethod.pm
===================================================================
--- trunk/cgi-bin/LJ/NotificationMethod.pm	2011-03-30 03:52:27 UTC (rev 18734)
+++ trunk/cgi-bin/LJ/NotificationMethod.pm	2011-03-30 04:48:05 UTC (rev 18735)
@@ -116,4 +116,7 @@
     } @LJ::NOTIFY_TYPES;
 }
 
+# indicates that remote can use this one; may be overriden in subclasses
+sub remote_eligible { 1 }
+
 1;

Modified: trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm	2011-03-30 03:52:27 UTC (rev 18734)
+++ trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm	2011-03-30 04:48:05 UTC (rev 18735)
@@ -20,16 +20,7 @@
     my @groups = @{$opts->{'groups'}};
     my $u = $opts->{'u'} || LJ::get_remote();
 
-    my @ntypes = @LJ::NOTIFY_TYPES;
-    my $country = LJ::country_of_remote_ip();
-    my $phone = LJ::SMS::API::RU::Phone->get_phone($u->userid);
-    if ($LJ::DISABLED{smsru} or
-        ($country ne 'RU'
-        and not ($phone && LJ::SMS::API::RU::Phone->get_status($u->userid, $phone) ne 'verified')
-        )
-    ){
-        @ntypes = grep { $_ ne 'LJ::NotificationMethod::SMSru' ? 1 : 0 } @ntypes;
-    }
+    my @ntypes = grep { $_->remote_eligible } @LJ::NOTIFY_TYPES;
 
     my $colnum = scalar(@ntypes) + 1;
 

Modified: trunk/htdocs/manage/profile/index.bml
===================================================================
--- trunk/htdocs/manage/profile/index.bml	2011-03-30 03:52:27 UTC (rev 18734)
+++ trunk/htdocs/manage/profile/index.bml	2011-03-30 04:48:05 UTC (rev 18735)
@@ -490,16 +490,8 @@
         my $country = LJ::country_of_remote_ip();
         my $tminfo = LJ::TextMessage->tm_info($u, remap_result => 1);
 
-        my $ru_text_messaging;
+        my $ru_text_messaging = LJ::SMS::API::RU->remote_eligible;
 
-        {
-            my $phone = LJ::SMS::API::RU::Phone->normalize($tminfo->{'number'});
-            my $status = LJ::SMS::API::RU::Phone->get_status($u->{'userid'}, $phone);
-            $ru_text_messaging = $status eq 'verified'
-                              || ( $country =~ /^(?:RU|KZ)$/o
-                                && !$u->is_community );
-        }
-
         $ret .= "<a name='txtmsg'></a><div class='section_head'>" . 
             ($ru_text_messaging ? $ML{'.section.phone'} : $ML{'.section.textmsg'}) . "\n";
             

Tags: andy, bml, livejournal, 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 

  • 0 comments