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

[ljcom] r9409: LJSUP-6614 ('objToJson' obsoleted/not fo...

Committer: ailyin
LJSUP-6614 ('objToJson' obsoleted/not found)
U   trunk/bin/worker/find-friends-in-abook
U   trunk/bin/worker/mail-address-book
U   trunk/bin/worker/mail-address-book-otz
Modified: trunk/bin/worker/find-friends-in-abook
===================================================================
--- trunk/bin/worker/find-friends-in-abook	2010-08-26 08:11:58 UTC (rev 9408)
+++ trunk/bin/worker/find-friends-in-abook	2010-08-26 08:14:47 UTC (rev 9409)
@@ -13,7 +13,7 @@
 use LJ::SUP::MailAddressBook;
 use LJ::SUP::MailAddressBook::OctazenAddressBook;
 use Storable qw(freeze thaw); # safe across updating when use with simple structures only
-use JSON;
+use LJ::JSON;
 use LJ::LookEmails;
 
 sub declare { return [ 'find-friends-in-abook' => \&get_abook_and_filter ] }
@@ -30,16 +30,16 @@
     my $abook = LJ::SUP::MailAddressBook::OctazenAddressBook->new;
     my $web_addr = $abook->retrieve_and_parse($email, $password); 
 
-    return JSON::objToJson({error => $abook->error_key, email => $email}) 
+    return LJ::JSON->to_json({error => $abook->error_key, email => $email}) 
         unless defined $web_addr;
 
-    return JSON::objToJson({error => '.abook.empty', email => $email}) if scalar(@$web_addr) == 0;
+    return LJ::JSON->to_json({error => '.abook.empty', email => $email}) if scalar(@$web_addr) == 0;
 
     # here web addresses successfully loaded
 
     my $res = LJ::LookEmails::find_email_uids($userid, $web_addr);
     $res->{error} = '';
     $res->{email} = $email;
-    return JSON::objToJson($res);
+    return LJ::JSON->to_json($res);
 }
 

Modified: trunk/bin/worker/mail-address-book
===================================================================
--- trunk/bin/worker/mail-address-book	2010-08-26 08:11:58 UTC (rev 9408)
+++ trunk/bin/worker/mail-address-book	2010-08-26 08:14:47 UTC (rev 9409)
@@ -18,7 +18,7 @@
 use LJ::SUP::MailAddressBook::MailruFamilyAddressBook::ListruAddressBook;
 use LJ::SUP::MailAddressBook::GmailComAddressBook;
 use Storable qw(freeze thaw); # safe across updating when use with simple structures only
-use JSON;
+use LJ::JSON;
 
 sub declare { [ 'mail-address-book' => \&get_abook_and_filter ] }
 sub work    { [ 'save_result'       => 1 ] };
@@ -41,19 +41,19 @@
                         );
 
     my $abook = $abook_classes{$server};
-    return JSON::objToJson({error => '.error.abook.problem', subcode => LJ::SUP::MailAddressBook::ERR_DOMAIN}) 
+    return LJ::JSON->to_json({error => '.error.abook.problem', subcode => LJ::SUP::MailAddressBook::ERR_DOMAIN}) 
         unless defined $abook;
 
     $abook = $abook->new;
 
     my $web_addr = $abook->retrieve_and_parse($email, $password); 
 
-    return JSON::objToJson({error => $abook->error_key, subcode => $abook->error_key_subcode}) 
+    return LJ::JSON->to_json({error => $abook->error_key, subcode => $abook->error_key_subcode}) 
         unless defined $web_addr;
-    return JSON::objToJson({error => '.abook.empty'}) if scalar(@$web_addr) == 0;
+    return LJ::JSON->to_json({error => '.abook.empty'}) if scalar(@$web_addr) == 0;
 
         # here web addresses successfully loaded
 
-    return JSON::objToJson({error => '', data => $web_addr});
+    return LJ::JSON->to_json({error => '', data => $web_addr});
 }
 

Modified: trunk/bin/worker/mail-address-book-otz
===================================================================
--- trunk/bin/worker/mail-address-book-otz	2010-08-26 08:11:58 UTC (rev 9408)
+++ trunk/bin/worker/mail-address-book-otz	2010-08-26 08:14:47 UTC (rev 9409)
@@ -13,7 +13,7 @@
 use LJ::SUP::MailAddressBook;
 use LJ::SUP::MailAddressBook::OctazenAddressBook;
 use Storable qw(freeze thaw); # safe across updating when use with simple structures only
-use JSON;
+use LJ::JSON;
 
 sub declare { [ 'mail-address-book-otz' => \&get_abook_and_filter ] }
 sub work    { [ 'save_result'       => 1 ] };
@@ -28,19 +28,19 @@
     # key: invite.bml option value, value: retrieving class
 
     my $abook = LJ::SUP::MailAddressBook::OctazenAddressBook->new;
-    return JSON::objToJson({error => '.error.abook.try_again', subcode => LJ::SUP::MailAddressBook::ERR_DOMAIN}) 
+    return LJ::JSON->to_json({error => '.error.abook.try_again', subcode => LJ::SUP::MailAddressBook::ERR_DOMAIN}) 
         unless defined $abook;
 
     gearman_set_requester_id($userid);
     my $web_addr = $abook->retrieve_and_parse($email, $password); 
 
-    return JSON::objToJson({error => $abook->error_key, subcode => $abook->error_key_subcode}) 
+    return LJ::JSON->to_json({error => $abook->error_key, subcode => $abook->error_key_subcode}) 
         unless defined $web_addr;
 
-    return JSON::objToJson({error => '.abook.empty'}) if scalar(@$web_addr) == 0;
+    return LJ::JSON->to_json({error => '.abook.empty'}) if scalar(@$web_addr) == 0;
 
         # here web addresses successfully loaded
 
-    return JSON::objToJson({error => '', data => $web_addr});
+    return LJ::JSON->to_json({error => '', data => $web_addr});
 }
 

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