about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-18 23:23:19 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-18 23:23:19 +0100
commit9a7485d03407b8177a51d900ac9aabbca893a2c1 (patch)
tree091b0c06c3031cc8b03f7453bc8c9a0eae9d8823
parent15476d505d7dfe4660281a326a9f620e94634ba8 (diff)
Fix typo on /api/accounts/:id/statuses, fix potential case-sensitivity issue
when registering incoming status mentions, add Travis CI file
-rw-r--r--.travis.yml9
-rw-r--r--README.md8
-rw-r--r--app/controllers/api/accounts_controller.rb2
-rw-r--r--app/models/account.rb6
-rw-r--r--app/services/process_feed_service.rb2
5 files changed, 19 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..e15efa97c
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,9 @@
+language: ruby
+cache: bundler
+
+rvm:
+  - 2.2.4
+
+bundler_args: --without development --retry=3 --jobs=3
+
+script: bundle exec rspec
diff --git a/README.md b/README.md
index 633aba040..e45e81c27 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 Mastodon
 ========
 
+[![Build Status](https://travis-ci.org/Gargron/mastodon.svg?branch=master)](https://travis-ci.org/Gargron/mastodon)
+
 Mastodon is a federated microblogging engine. An alternative implementation of the GNU Social project. Based on ActivityStreams, Webfinger, PubsubHubbub and Salmon.
 
 **Current status of the project is early development. Documentation &co will be added later**
@@ -18,12 +20,6 @@ Mastodon is a federated microblogging engine. An alternative implementation of t
 - Upload header image for profile page
 - Deleting statuses, deletion propagation
 
-Missing:
-
-- Media attachments (photos, videos)
-- Streaming API
-- Blocking users, blocking remote instances
-
 ## Configuration
 
 - `LOCAL_DOMAIN` should be the domain/hostname of your instance. This is **absolutely required** as it is used for generating unique IDs for everything federation-related
diff --git a/app/controllers/api/accounts_controller.rb b/app/controllers/api/accounts_controller.rb
index 782cc8102..f543ea98d 100644
--- a/app/controllers/api/accounts_controller.rb
+++ b/app/controllers/api/accounts_controller.rb
@@ -15,7 +15,7 @@ class Api::AccountsController < ApiController
   end
 
   def statuses
-    @statuses = @account.statuses.with_includes.with_counts.order('created_at desc')
+    @statuses = @account.statuses.with_includes.with_counters.order('created_at desc')
   end
 
   def follow
diff --git a/app/models/account.rb b/app/models/account.rb
index e4295d735..06f858c7c 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -104,6 +104,12 @@ class Account < ActiveRecord::Base
     self.where(table[:username].matches(username)).where(domain: nil).take!
   end
 
+  def self.find_local(username)
+    self.find_local!(username)
+  rescue ActiveRecord::RecordNotFound
+    nil
+  end
+
   before_create do
     if local?
       keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 1024 : 2048)
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 8962603cf..8fd0b3e68 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -45,7 +45,7 @@ class ProcessFeedService < BaseService
           href = Addressable::URI.parse(mention_link.attribute('href').value)
 
           if href.host == Rails.configuration.x.local_domain
-            mentioned_account = Account.find_by(username: href.path.gsub('/users/', ''), domain: nil)
+            mentioned_account = Account.find_local(href.path.gsub('/users/', ''))
 
             unless mentioned_account.nil?
               mentioned_account.mentions.first_or_create(status: status)