]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing
authorBrion Vibber <brion@pobox.com>
Tue, 23 Mar 2010 19:13:32 +0000 (12:13 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 23 Mar 2010 19:13:32 +0000 (12:13 -0700)
1  2 
lib/command.php
lib/util.php

diff --combined lib/command.php
index f7421269d0aad3c4bc4771fe2b32e85d458c609e,8080fb8bc0071de9f4a4b991d1fb7f6a524ea69b..216f9e649a33af4660bdc4fcaa2965571d0b1d0c
@@@ -273,7 -273,7 +273,7 @@@ class FavCommand extends Comman
      function handle($channel)
      {
          $notice = $this->getNotice($this->other);
-         $fave = Fave::addNew($this->user, $notice);
+         $fave = Fave::addNew($this->user->getProfile(), $notice);
  
          if (!$fave) {
              $channel->error($this->user, _('Could not create favorite.'));
@@@ -711,34 -711,6 +711,34 @@@ class LoginCommand extends Comman
      }
  }
  
 +class LoseCommand extends Command
 +{
 +
 +    var $other = null;
 +
 +    function __construct($user, $other)
 +    {
 +        parent::__construct($user);
 +        $this->other = $other;
 +    }
 +
 +    function execute($channel)
 +    {
 +        if(!$this->other) {
 +            $channel->error($this->user, _('Specify the name of the user to unsubscribe from'));
 +            return;
 +        }
 +
 +        $result = Subscription::cancel($this->getProfile($this->other), $this->user->getProfile());
 +
 +        if ($result) {
 +            $channel->output($this->user, sprintf(_('Unsubscribed  %s'), $this->other));
 +        } else {
 +            $channel->error($this->user, $result);
 +        }
 +    }
 +}
 +
  class SubscriptionsCommand extends Command
  {
      function handle($channel)
@@@ -821,7 -793,6 +821,7 @@@ class HelpCommand extends Comman
                             "d <nickname> <text> - direct message to user\n".
                             "get <nickname> - get last notice from user\n".
                             "whois <nickname> - get profile info on user\n".
 +                           "lose <nickname> - force user to stop following you\n".
                             "fav <nickname> - add user's last notice as a 'fave'\n".
                             "fav #<notice_id> - add notice with the given id as a 'fave'\n".
                             "repeat #<notice_id> - repeat a notice with a given id\n".
diff --combined lib/util.php
index a30d69100289f08a94ba8e850bbcb1ed6f127e2e,3d4ed087f9a74a42e78b7af926a5069a27af41dd..795997868305ff09b2ada3614cf7a9a8d1089cf3
@@@ -1493,15 -1493,7 +1493,15 @@@ function common_copy_args($from
      $to = array();
      $strip = get_magic_quotes_gpc();
      foreach ($from as $k => $v) {
 -        $to[$k] = ($strip) ? stripslashes($v) : $v;
 +        if($strip) {
 +            if(is_array($v)) {
 +                $to[$k] = common_copy_args($v);
 +            } else {
 +                $to[$k] = stripslashes($v);
 +            }
 +        } else {
 +            $to[$k] = $v;
 +        }
      }
      return $to;
  }
@@@ -1529,7 -1521,8 +1529,8 @@@ function common_user_uri(&$user
  function common_notice_uri(&$notice)
  {
      return common_local_url('shownotice',
-                             array('notice' => $notice->id));
+                             array('notice' => $notice->id),
+                             null, null, false);
  }
  
  // 36 alphanums - lookalikes (0, O, 1, I) = 32 chars = 5 bits