vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17135: LJSUP-6482: SMS Notification RU

Committer: vsukhanov
LJSUP-6482: SMS Notification RU
U   trunk/cgi-bin/LJ/NotificationMethod.pm
U   trunk/cgi-bin/LJ/TextMessage.pm
U   trunk/cgi-bin/LJ/User.pm
U   trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm
U   trunk/htdocs/manage/profile/index.bml
U   trunk/htdocs/tools/textmessage.bml
Modified: trunk/cgi-bin/LJ/NotificationMethod.pm
===================================================================
--- trunk/cgi-bin/LJ/NotificationMethod.pm	2010-08-17 04:28:19 UTC (rev 17134)
+++ trunk/cgi-bin/LJ/NotificationMethod.pm	2010-08-17 05:53:55 UTC (rev 17135)
@@ -5,6 +5,7 @@
 use Class::Autouse qw (LJ::Typemap
                        LJ::NotificationMethod::Email
                        LJ::NotificationMethod::SMS
+                       LJ::NotificationMethod::SMSru
                        LJ::NotificationMethod::Inbox
                        LJ::NotificationMethod::IM
                        LJ::NotificationMethod::DebugLog

Modified: trunk/cgi-bin/LJ/TextMessage.pm
===================================================================
--- trunk/cgi-bin/LJ/TextMessage.pm	2010-08-17 04:28:19 UTC (rev 17134)
+++ trunk/cgi-bin/LJ/TextMessage.pm	2010-08-17 05:53:55 UTC (rev 17135)
@@ -882,6 +882,22 @@
         'msglimit'      => 480,
         'totlimit'      => 500,
     },
+    'beeline'   => {
+        'name'          => 'Beeline Russia',
+        'notes'         => 'Russia only',
+        'fromlimit'     => 0,
+        'msglimit'      => 0,
+        'totlimit'      => 0,
+        'api'           => 'LJ::SMS::API::RU',
+        },
+    'megafon'   => {
+        'name'          => 'Megafon Russia',
+        'notes'         => 'Russia only',
+        'fromlimit'     => 0,
+        'msglimit'      => 0,
+        'totlimit'      => 0,
+        'api'           => 'LJ::SMS::API::RU',
+        },
 
 );
 

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2010-08-17 04:28:19 UTC (rev 17134)
+++ trunk/cgi-bin/LJ/User.pm	2010-08-17 05:53:55 UTC (rev 17135)
@@ -5295,8 +5295,15 @@
 
     return 0 unless $u->get_cap("textmessaging");
 
-    my $security = LJ::TextMessage->tm_security($u);
+    my $tminfo = LJ::TextMessage->tm_info($u);
 
+    ## messaging is disabled for some providers
+    my $provider = $tminfo ? $tminfo->{provider} : '';
+    return 0 if $provider eq 'beeline';
+    return 0 if $provider eq 'megafon';
+
+    ##
+    my $security = $tminfo && $tminfo->{security} ? $tminfo->{security} : "none";
     return 0 if $security eq "none";
     return 1 if $security eq "all";
 

Modified: trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm	2010-08-17 04:28:19 UTC (rev 17134)
+++ trunk/cgi-bin/LJ/Widget/SubscribeInterface.pm	2010-08-17 05:53:55 UTC (rev 17135)
@@ -20,6 +20,12 @@
     my $u = $opts->{'u'} || LJ::get_remote();
 
     my @ntypes = @LJ::NOTIFY_TYPES;
+    my (undef, $country) = LJ::GeoLocation->ip_class;
+    if ($country eq 'ru'){
+        @ntypes = map { $_ eq 'LJ::NotificationMethod::SMS' ? 'LJ::NotificationMethod::SMSru' : $_ }
+                    @ntypes;
+    }
+
     my $colnum = scalar(@ntypes) + 1;
 
     my %ntypeids = map { $_ => $_->ntypeid } @ntypes;

Modified: trunk/htdocs/manage/profile/index.bml
===================================================================
--- trunk/htdocs/manage/profile/index.bml	2010-08-17 04:28:19 UTC (rev 17134)
+++ trunk/htdocs/manage/profile/index.bml	2010-08-17 05:53:55 UTC (rev 17135)
@@ -481,7 +481,8 @@
 
         ## TEXT MESSAGING
 
-        $ret .= "<a name='txtmsg'></a><div class='section_head'>$ML{'.section.textmsg'}\n";
+        $ret .= "<a name='txtmsg'></a><div class='section_head'>" . 
+            (LJ::GeoLocation->ip_country() eq 'RU' ? $ML{'.section.phone'} : $ML{'.section.textmsg'}) . "\n";
         unless (LJ::get_cap($u, "textmessaging")) {
             my $inline;
             if ($inline .= LJ::run_hook("cprod_inline", $u, 'TextMessaging')) {
@@ -514,6 +515,7 @@
                     my $info = LJ::TextMessage::provider_info($p);
                     push @opts, ($p, $info->{'name'});
                 }
+
                 $ret .= LJ::html_select({ 'name' => 'txtmsg_provider',
                                           'selected' => $tminfo->{'provider'}, },
                                           @opts);

Modified: trunk/htdocs/tools/textmessage.bml
===================================================================
--- trunk/htdocs/tools/textmessage.bml	2010-08-17 04:28:19 UTC (rev 17134)
+++ trunk/htdocs/tools/textmessage.bml	2010-08-17 05:53:55 UTC (rev 17135)
@@ -61,6 +61,13 @@
         return $ret;
     }
 
+    ## Text messaging is disabled for some providers
+    if ($tminfo->{provider} eq 'megafon' or $tminfo->{provider} eq 'beeline'){
+        $ret .= "<?h1 $ML{'.error.unavailable.head'} h1?> <br />";
+        add_footer();
+        return $ret;
+    }
+
     my $remote = LJ::get_remote();
     if ($tminfo->{'security'} ne "all") {
         my $andbefriend;

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