]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.7.x' into 0.8.x
authorSarven Capadisli <csarven@csarven-laptop.(none)>
Fri, 8 May 2009 18:17:07 +0000 (14:17 -0400)
committerSarven Capadisli <csarven@csarven-laptop.(none)>
Fri, 8 May 2009 18:17:07 +0000 (14:17 -0400)
1  2 
actions/twittersettings.php
classes/Notice.php
db/notice_source.sql

index 1bce5769511734396822ea5f94e94382d85d2a69,0b98eef591ba086a3d8346907927eb0ae7c42456..2b742788eee55419112a718d271f6e4285960163
@@@ -138,7 -138,7 +138,7 @@@ class TwittersettingsAction extends Con
  
          $this->elementStart('ul', 'form_data');
          $this->elementStart('li');
 -        $this->checkbox('noticesync',
 +        $this->checkbox('noticesend',
                          _('Automatically send my notices to Twitter.'),
                          ($flink) ?
                          ($flink->noticesync & FOREIGN_NOTICE_SEND) :
                          ($flink->friendsync & FOREIGN_FRIEND_RECV) :
                          false);
          $this->elementEnd('li');
 +
 +        if (common_config('twitterbridge','enabled')) {
 +            $this->elementStart('li');
 +            $this->checkbox('noticerecv',
 +                            _('Import my Friends Timeline.'),
 +                            ($flink) ?
 +                            ($flink->noticesync & FOREIGN_NOTICE_RECV) :
 +                            false);
 +            $this->elementEnd('li');
 +        } else {
 +            // preserve setting even if bidrection bridge toggled off
 +            if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) {
 +                $this->hidden('noticerecv', true, 'noticerecv');
 +            }
 +        }
 +
          $this->elementEnd('ul');
  
          if ($flink) {
      {
          $screen_name = $this->trimmed('twitter_username');
          $password    = $this->trimmed('twitter_password');
 -        $noticesync  = $this->boolean('noticesync');
 +        $noticesend  = $this->boolean('noticesend');
 +        $noticerecv  = $this->boolean('noticerecv');
          $replysync   = $this->boolean('replysync');
          $friendsync  = $this->boolean('friendsync');
  
          $flink->credentials = $password;
          $flink->created     = common_sql_now();
  
 -        $flink->set_flags($noticesync, $replysync, $friendsync);
 +        $flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync);
  
          $flink_id = $flink->insert();
  
  
          if ($friendsync) {
              save_twitter_friends($user, $twit_user->id, $screen_name, $password);
+             $flink->last_friendsync = common_sql_now();
+             $flink->update();
          }
  
          $this->showForm(_('Twitter settings saved.'), true);
  
      function savePreferences()
      {
 -        $noticesync = $this->boolean('noticesync');
 +        $noticesend = $this->boolean('noticesend');
 +        $noticerecv = $this->boolean('noticerecv');
          $friendsync = $this->boolean('friendsync');
          $replysync  = $this->boolean('replysync');
  
  
          $original = clone($flink);
  
 -        $flink->set_flags($noticesync, $replysync, $friendsync);
 +        $flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync);
  
          $result = $flink->update($original);
  
diff --combined classes/Notice.php
index 19ae8313cdd731ec8c9b9b03bea2e9b8de47d53b,771a4e715f3d51811240c341defc381dced3fe33..382d160ab3fbe5c122f0e1cffa7b4bcc0ffc517a
@@@ -46,7 -46,6 +46,7 @@@ class Notice extends Memcached_DataObje
      public $reply_to;                        // int(4)
      public $is_local;                        // tinyint(1)
      public $source;                          // varchar(32)
 +    public $conversation;                    // int(4)
  
      /* Static get */
      function staticGet($k,$v=NULL) {
                $notice->source = $source;
                $notice->uri = $uri;
  
 +        if (!empty($reply_to)) {
 +            $reply_notice = Notice::staticGet('id', $reply_to);
 +            if (!empty($reply_notice)) {
 +                $notice->reply_to = $reply_to;
 +                $notice->conversation = $reply_notice->conversation;
 +            }
 +        }
 +
          if (Event::handle('StartNoticeSave', array(&$notice))) {
  
              $id = $notice->insert();
              $group_inbox->notice_id = $this->id;
              if ($group_inbox->find()) {
                  while ($group_inbox->fetch()) {
-                     $cache->delete(common_cache_key('group:notices:'.$group_inbox->group_id));
+                     $cache->delete(common_cache_key('user_group:notice_ids:' . $group_inbox->group_id));
                      if ($blowLast) {
-                         $cache->delete(common_cache_key('group:notices:'.$group_inbox->group_id.';last'));
+                         $cache->delete(common_cache_key('user_group:notice_ids:' . $group_inbox->group_id.';last'));
                      }
                      $member = new Group_member();
                      $member->group_id = $group_inbox->group_id;
              $tag->notice_id = $this->id;
              if ($tag->find()) {
                  while ($tag->fetch()) {
-                     $cache->delete(common_cache_key('notice_tag:notice_stream:' . $tag->tag));
-                     if ($blowLast) {
-                         $cache->delete(common_cache_key('notice_tag:notice_stream:' . $tag->tag . ';last'));
-                     }
+                     $tag->blowCache($blowLast);
                  }
              }
              $tag->free();
      {
          if ($this->is_local) {
              $cache = common_memcache();
-             if ($cache) {
-                 $cache->delete(common_cache_key('profile:notices:'.$this->profile_id));
+             if (!empty($cache)) {
+                 $cache->delete(common_cache_key('profile:notice_ids:'.$this->profile_id));
                  if ($blowLast) {
-                     $cache->delete(common_cache_key('profile:notices:'.$this->profile_id.';last'));
+                     $cache->delete(common_cache_key('profile:notice_ids:'.$this->profile_id.';last'));
                  }
              }
          }
              $reply->notice_id = $this->id;
              if ($reply->find()) {
                  while ($reply->fetch()) {
-                     $cache->delete(common_cache_key('user:replies:'.$reply->profile_id));
+                     $cache->delete(common_cache_key('reply:stream:'.$reply->profile_id));
                      if ($blowLast) {
-                         $cache->delete(common_cache_key('user:replies:'.$reply->profile_id.';last'));
+                         $cache->delete(common_cache_key('reply:stream:'.$reply->profile_id.';last'));
                      }
                  }
              }
              $fave->notice_id = $this->id;
              if ($fave->find()) {
                  while ($fave->fetch()) {
-                     $cache->delete(common_cache_key('user:faves:'.$fave->user_id));
+                     $cache->delete(common_cache_key('fave:ids_by_user:'.$fave->user_id));
                      if ($blowLast) {
-                         $cache->delete(common_cache_key('user:faves:'.$fave->user_id.';last'));
+                         $cache->delete(common_cache_key('fave:ids_by_user:'.$fave->user_id.';last'));
                      }
                  }
              }
                  if ($recipient_notice) {
                      $orig = clone($this);
                      $this->reply_to = $recipient_notice->id;
 +                    $this->conversation = $recipient_notice->conversation;
                      $this->update($orig);
                  }
              }
              }
          }
  
 +        // If it's not a reply, make it the root of a new conversation
 +
 +        if (empty($this->conversation)) {
 +            $orig = clone($this);
 +            $this->conversation = $this->id;
 +            $this->update($orig);
 +        }
 +
          foreach (array_keys($replied) as $recipient) {
              $user = User::staticGet('id', $recipient);
              if ($user) {
diff --combined db/notice_source.sql
index e6e2180a57288852c01f917f09dad165e48dcd71,17720028dcbc802c5549120579f57faca24c5495..f026679d50621d40318d68a3660356b1c3455bd4
@@@ -24,6 -24,7 +24,7 @@@ VALUE
      ('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()),
      ('Pikchur','Pikchur','http://www.pikchur.com/', now()),
      ('Ping.fm','Ping.fm','http://ping.fm/', now()),
+     ('pingvine','PingVine','http://pingvine.com/', now()),
      ('pocketwit','PockeTwit','http://code.google.com/p/pocketwit/', now()),
      ('posty','Posty','http://spreadingfunkyness.com/posty/', now()),
      ('royalewithcheese','Royale With Cheese','http://p.hellyeah.org/', now()),
@@@ -43,7 -44,6 +44,7 @@@
      ('twidge','Twidge','http://software.complete.org/twidge', now()),
      ('twidroid','twidroid','http://www.twidroid.com/', now()),
      ('twittelator','Twittelator','http://www.stone.com/iPhone/Twittelator/', now()),
 +    ('twitter','Twitter','http://twitter.com/', now()),
      ('twitterfeed','twitterfeed','http://twitterfeed.com/', now()),
      ('twitterphoto','TwitterPhoto','http://richfish.org/twitterphoto/', now()),
      ('twitterpm','Net::Twitter','http://search.cpan.org/dist/Net-Twitter/', now()),