atig 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +3 -2
- data/Gemfile +2 -0
- data/README.mkdn +2 -0
- data/Rakefile +0 -6
- data/atig.gemspec +21 -20
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/{bin → exe}/atig +0 -0
- data/lib/atig/agent/agent.rb +4 -4
- data/lib/atig/agent/dm.rb +4 -4
- data/lib/atig/agent/following.rb +3 -3
- data/lib/atig/agent/list.rb +2 -2
- data/lib/atig/agent/list_status.rb +6 -6
- data/lib/atig/agent/stream_follow.rb +2 -2
- data/lib/atig/agent/user_stream.rb +3 -3
- data/lib/atig/basic_twitter.rb +1 -3
- data/lib/atig/bitly.rb +1 -1
- data/lib/atig/channel/channel.rb +1 -1
- data/lib/atig/channel/list.rb +3 -3
- data/lib/atig/channel/retweet.rb +1 -1
- data/lib/atig/channel/timeline.rb +1 -1
- data/lib/atig/command/autofix.rb +4 -4
- data/lib/atig/command/destroy.rb +1 -1
- data/lib/atig/command/dm.rb +2 -2
- data/lib/atig/command/favorite.rb +1 -1
- data/lib/atig/command/info.rb +2 -2
- data/lib/atig/command/reply.rb +2 -2
- data/lib/atig/command/retweet.rb +2 -2
- data/lib/atig/command/search.rb +2 -2
- data/lib/atig/command/status.rb +3 -3
- data/lib/atig/command/user.rb +3 -3
- data/lib/atig/command/version.rb +3 -3
- data/lib/atig/db/followings.rb +5 -6
- data/lib/atig/db/statuses.rb +12 -10
- data/lib/atig/db/transaction.rb +1 -1
- data/lib/atig/gateway/channel.rb +1 -2
- data/lib/atig/gateway/session.rb +13 -13
- data/lib/atig/http.rb +4 -4
- data/lib/atig/ifilter/expand_url.rb +1 -1
- data/lib/atig/ifilter/retweet.rb +1 -1
- data/lib/atig/ifilter/retweet_time.rb +1 -1
- data/lib/atig/ifilter/sanitize.rb +1 -1
- data/lib/atig/ifilter/strip.rb +1 -1
- data/lib/atig/ifilter/xid.rb +1 -1
- data/lib/atig/oauth.rb +3 -3
- data/lib/atig/ofilter/escape_url.rb +1 -1
- data/lib/atig/ofilter/footer.rb +1 -1
- data/lib/atig/ofilter/geo.rb +1 -1
- data/lib/atig/ofilter/short_url.rb +1 -1
- data/lib/atig/option.rb +1 -1
- data/lib/atig/optparse.rb +22 -11
- data/lib/atig/search.rb +4 -2
- data/lib/atig/stream.rb +1 -1
- data/lib/atig/twitter.rb +5 -4
- data/lib/atig/update_checker.rb +2 -2
- data/lib/atig/url_escape.rb +1 -1
- data/lib/atig/version.rb +1 -1
- data/lib/memory_profiler.rb +1 -1
- data/spec/command/autofix_spec.rb +7 -8
- data/spec/command/destroy_spec.rb +12 -13
- data/spec/command/dm_spec.rb +5 -6
- data/spec/command/favorite_spec.rb +11 -12
- data/spec/command/limit_spec.rb +6 -7
- data/spec/command/location_spec.rb +4 -5
- data/spec/command/name_spec.rb +2 -3
- data/spec/command/option_spec.rb +28 -29
- data/spec/command/refresh_spec.rb +3 -4
- data/spec/command/reply_spec.rb +22 -23
- data/spec/command/retweet_spec.rb +17 -18
- data/spec/command/spam_spec.rb +4 -5
- data/spec/command/status_spec.rb +19 -20
- data/spec/command/thread_spec.rb +20 -21
- data/spec/command/time_spec.rb +18 -21
- data/spec/command/uptime_spec.rb +17 -18
- data/spec/command/user_info_spec.rb +13 -16
- data/spec/command/user_spec.rb +13 -14
- data/spec/command/version_spec.rb +25 -29
- data/spec/command/whois_spec.rb +25 -26
- data/spec/command_helper.rb +2 -2
- data/spec/db/followings_spec.rb +22 -23
- data/spec/db/listenable_spec.rb +2 -3
- data/spec/db/lists_spec.rb +16 -17
- data/spec/db/roman_spec.rb +3 -5
- data/spec/db/sized_uniq_array_spec.rb +13 -14
- data/spec/db/statuses_spec.rb +69 -70
- data/spec/ifilter/expand_url_spec.rb +18 -20
- data/spec/ifilter/retweet_spec.rb +4 -5
- data/spec/ifilter/retweet_time_spec.rb +4 -5
- data/spec/ifilter/sanitize_spec.rb +5 -6
- data/spec/ifilter/sid_spec.rb +6 -7
- data/spec/ifilter/strip_spec.rb +3 -4
- data/spec/ifilter/tid_spec.rb +6 -7
- data/spec/levenshtein_spec.rb +2 -3
- data/spec/ofilter/escape_url_spec.rb +13 -14
- data/spec/ofilter/footer_spec.rb +10 -11
- data/spec/ofilter/geo_spec.rb +12 -13
- data/spec/ofilter/short_url_spec.rb +28 -29
- data/spec/option_spec.rb +23 -24
- data/spec/sized_hash_spec.rb +5 -6
- data/spec/spec_helper.rb +8 -6
- data/spec/update_checker_spec.rb +14 -15
- metadata +9 -32
- data/docs/_static/allow.png +0 -0
- data/docs/_static/emacs.png +0 -0
- data/docs/_static/irc_setting.png +0 -0
- data/docs/_static/irssi.png +0 -0
- data/docs/_static/limechat.png +0 -0
- data/docs/_static/limechat_s.png +0 -0
- data/docs/_static/oauth_channel.png +0 -0
- data/docs/_static/screenshot.png +0 -0
- data/docs/_static/structure.png +0 -0
- data/docs/_static/verify.png +0 -0
- data/docs/changelog.rst +0 -233
- data/docs/commandline_options.rst +0 -21
- data/docs/commands.rst +0 -84
- data/docs/conf.py +0 -194
- data/docs/config.rst +0 -159
- data/docs/feature.rst +0 -41
- data/docs/hacking_guide.rst +0 -43
- data/docs/index.rst +0 -102
- data/docs/irc.rst +0 -31
- data/docs/options.rst +0 -76
- data/docs/quickstart.rst +0 -96
- data/docs/resize.sh +0 -7
- data/docs/tiarra.rst +0 -2
- data/docs/tig.rst +0 -21
- data/requirements.txt +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7289f78b0e27eb209b0db4dd0c8521c2f815def7
|
4
|
+
data.tar.gz: dafd598ceb3604b19b2504644f606497e5aa23c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1c26f3096adff2dfd36b4ab023a1bd1c03cf2748ce7a763ddc2e1981f1ec7f08afbf57a42e0657c3e6b2b75bf846f08c449efb9c2e5f95d292d32a64117adae
|
7
|
+
data.tar.gz: edb161638ae3aaa32c39cb45739fde1f1cfd77087f4f4f4f539ed2ec11ae35144d9d1f341b63302d888e9ab7f19531926007e7c2c4b2b338e6927cbe738e07e9
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.mkdn
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Atig.rb - Another Twitter Irc Gateway
|
2
2
|
===========================================
|
3
3
|
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/atig.png)](https://rubygems.org/gems/atig) [![Code Climate](https://codeclimate.com/github/atig/atig.png)](https://codeclimate.com/github/atig/atig) [![Build Status](https://travis-ci.org/atig/atig.png)](https://travis-ci.org/atig/atig)
|
5
|
+
|
4
6
|
OVERVIEW
|
5
7
|
--------
|
6
8
|
Atig.rb is Twitter Irc Gateway.
|
data/Rakefile
CHANGED
@@ -17,10 +17,4 @@ RSpec::Core::RakeTask.new do |t|
|
|
17
17
|
t.pattern = 'spec/**/*_spec.rb'
|
18
18
|
end
|
19
19
|
|
20
|
-
desc "building document with sphinx"
|
21
|
-
task :docs do
|
22
|
-
build_dir = "docs/_build"
|
23
|
-
`LC_CTYPE=C sphinx-build -b html -d #{build_dir}/doctrees -D latex_paper_size=a4 docs #{build_dir}/html`
|
24
|
-
end
|
25
|
-
|
26
20
|
task :default => [:spec, :clean]
|
data/atig.gemspec
CHANGED
@@ -1,28 +1,29 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
require File.expand_path('../lib/atig/version', __FILE__)
|
3
3
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
gem.homepage = "https://github.com/mzp/atig"
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "atig"
|
6
|
+
spec.version = Atig::VERSION
|
7
|
+
spec.authors = ["MIZUNO Hiroki", "SHIBATA Hiroshi", ]
|
8
|
+
spec.email = ["mzp@ocaml.jp", "shibata.hiroshi@gmail.com"]
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
gem.name = "atig"
|
15
|
-
gem.require_paths = ["lib"]
|
16
|
-
gem.version = Atig::VERSION
|
10
|
+
spec.summary = %q{Atig.rb is forked from cho45's tig.rb. We improve some features of tig.rb.}
|
11
|
+
spec.description = %q{Atig.rb is Twitter Irc Gateway.}
|
12
|
+
spec.homepage = "https://github.com/atig/atig"
|
17
13
|
|
18
|
-
|
14
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
+
spec.bindir = "exe"
|
16
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
+
spec.require_paths = ["lib"]
|
18
|
+
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
spec.add_dependency 'sqlite3', ['>= 1.3.2']
|
22
|
+
spec.add_dependency 'net-irc', ['>= 0']
|
23
|
+
spec.add_dependency 'oauth', ['>= 0']
|
24
|
+
spec.add_dependency 'twitter-text', ['~> 1.7.0']
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'rake'
|
28
|
+
spec.add_development_dependency 'coveralls'
|
28
29
|
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "atig"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/{bin → exe}/atig
RENAMED
File without changes
|
data/lib/atig/agent/agent.rb
CHANGED
@@ -15,18 +15,18 @@ module Atig
|
|
15
15
|
log :info, "initialize"
|
16
16
|
|
17
17
|
@api.repeat( interval ) do|t|
|
18
|
-
q = { :
|
18
|
+
q = { count: 200 }
|
19
19
|
if @prev
|
20
|
-
q.update :
|
20
|
+
q.update since_id: @prev
|
21
21
|
else
|
22
|
-
q.update :
|
22
|
+
q.update count: 20
|
23
23
|
end
|
24
24
|
|
25
25
|
sources = t.get( path, q)
|
26
26
|
|
27
27
|
sources.reverse_each do|s|
|
28
28
|
db.statuses.transaction do|d|
|
29
|
-
d.add :
|
29
|
+
d.add source: source, status: s, user: s.user
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/lib/atig/agent/dm.rb
CHANGED
@@ -15,18 +15,18 @@ module Atig
|
|
15
15
|
log :info, "initialize"
|
16
16
|
|
17
17
|
@api.repeat(600) do|t|
|
18
|
-
q = { :
|
18
|
+
q = { count: 200 }
|
19
19
|
if @prev
|
20
|
-
q.update :
|
20
|
+
q.update since_id: @prev
|
21
21
|
else
|
22
|
-
q.update :
|
22
|
+
q.update count: 1
|
23
23
|
end
|
24
24
|
dms = t.get("direct_messages", q)
|
25
25
|
log :debug, "You have #{dms.size} dm."
|
26
26
|
|
27
27
|
dms.reverse_each do|dm|
|
28
28
|
db.dms.transaction do|d|
|
29
|
-
d.add :
|
29
|
+
d.add status: dm, user: dm.sender
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
data/lib/atig/agent/following.rb
CHANGED
@@ -22,15 +22,15 @@ module Atig
|
|
22
22
|
|
23
23
|
def update(api)
|
24
24
|
if @db.followings.empty?
|
25
|
-
friends = api.page("friends/list", :users, {:
|
25
|
+
friends = api.page("friends/list", :users, {user_id: @db.me.id, count: 100})
|
26
26
|
else
|
27
27
|
@db.me = api.post("account/update_profile")
|
28
28
|
return if @db.me.friends_count == @db.followings.size
|
29
|
-
friends = api.page("friends/list", :users, {:
|
29
|
+
friends = api.page("friends/list", :users, {user_id: @db.me.id, count: 100})
|
30
30
|
end
|
31
31
|
|
32
32
|
if @opts.only
|
33
|
-
followers = api.page("friends/ids", :ids, {:
|
33
|
+
followers = api.page("friends/ids", :ids, {user_id: @db.me.id, count: 2500})
|
34
34
|
friends.each do|friend|
|
35
35
|
friend[:only] = !followers.include?(friend.id)
|
36
36
|
end
|
data/lib/atig/agent/list.rb
CHANGED
@@ -18,7 +18,7 @@ module Atig
|
|
18
18
|
if name == :all then
|
19
19
|
full_update t
|
20
20
|
else
|
21
|
-
@db.lists[name].update t.page("lists/members", :users, {:
|
21
|
+
@db.lists[name].update t.page("lists/members", :users, {owner_screen_name: @db.me.screen_name, slug: name})
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -41,7 +41,7 @@ module Atig
|
|
41
41
|
end
|
42
42
|
begin
|
43
43
|
users[name] =
|
44
|
-
t.page("lists/members", :users, {:
|
44
|
+
t.page("lists/members", :users, {owner_screen_name: list.user.screen_name, slug: list.slug})
|
45
45
|
rescue => e
|
46
46
|
log :error, e.inspect
|
47
47
|
users[name] =
|
@@ -18,17 +18,17 @@ class Atig::Agent::ListStatus
|
|
18
18
|
db.lists.each do |name, _|
|
19
19
|
log :debug, "retrieve #{name} statuses"
|
20
20
|
q = {}
|
21
|
-
q.update(:
|
21
|
+
q.update(since_id: @prev[name]) if @prev.key?(name)
|
22
22
|
|
23
23
|
screen_name, slug = parse name
|
24
|
-
q.update(:
|
24
|
+
q.update(owner_screen_name: screen_name, slug: slug)
|
25
25
|
statuses = t.get("lists/statuses", q)
|
26
26
|
statuses.reverse_each do|status|
|
27
27
|
db.statuses.transaction do|d|
|
28
|
-
d.add(:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
28
|
+
d.add(status: status,
|
29
|
+
user: status.user,
|
30
|
+
source: :list,
|
31
|
+
list: name)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
@prev[name] = statuses[0].id if statuses && statuses.size > 0
|
@@ -24,10 +24,10 @@ module Atig
|
|
24
24
|
|
25
25
|
@api.stream do|t|
|
26
26
|
Thread.pass until @follows
|
27
|
-
t.watch('statuses/filter', :
|
27
|
+
t.watch('statuses/filter', follow: @follows) do |status|
|
28
28
|
if status and status.user
|
29
29
|
db.transaction do|d|
|
30
|
-
d.statuses.add :
|
30
|
+
d.statuses.add status: status, user: status.user, source: :stream_follow
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -16,7 +16,7 @@ module Atig
|
|
16
16
|
log :info, "initialize"
|
17
17
|
|
18
18
|
@api.stream do|t|
|
19
|
-
options = context.opts.allreplies ? {:
|
19
|
+
options = context.opts.allreplies ? {replies: :all} : {}
|
20
20
|
|
21
21
|
t.watch('user', options) do |status|
|
22
22
|
# @log.debug status.inspect
|
@@ -24,11 +24,11 @@ module Atig
|
|
24
24
|
if status.direct_message
|
25
25
|
dm = status.direct_message
|
26
26
|
db.dms.transaction do|d|
|
27
|
-
d.add :
|
27
|
+
d.add status: dm, user: dm.sender
|
28
28
|
end
|
29
29
|
elsif status and status.user
|
30
30
|
db.statuses.transaction do|d|
|
31
|
-
d.add :
|
31
|
+
d.add status: status, user: status.user, source: :user_stream
|
32
32
|
end
|
33
33
|
elsif status and status.event
|
34
34
|
case status.event
|
data/lib/atig/basic_twitter.rb
CHANGED
@@ -29,8 +29,6 @@ module Atig
|
|
29
29
|
uri.path += ".json" if path != "users/username_available"
|
30
30
|
uri.query = query.to_query_str unless query.empty?
|
31
31
|
|
32
|
-
header = {}
|
33
|
-
|
34
32
|
begin
|
35
33
|
ret = request(uri, opts)
|
36
34
|
rescue OpenSSL::SSL::SSLError => e
|
@@ -99,7 +97,7 @@ module Atig
|
|
99
97
|
methods.each do |m|
|
100
98
|
self.module_eval <<END
|
101
99
|
def #{m}(path, query = {}, opts = {})
|
102
|
-
opts.update( :
|
100
|
+
opts.update( method: :#{m})
|
103
101
|
api path, query, opts
|
104
102
|
end
|
105
103
|
END
|
data/lib/atig/bitly.rb
CHANGED
@@ -27,7 +27,7 @@ module Atig
|
|
27
27
|
if @login and @key
|
28
28
|
bitly.path = "/shorten"
|
29
29
|
bitly.query = {
|
30
|
-
:
|
30
|
+
format: "json", longUrl: url, login: @login, apiKey: @key,
|
31
31
|
}.to_query_str(";")
|
32
32
|
req = @http.req(:get, bitly, {})
|
33
33
|
res = @http.http(bitly, 5, 10).request(req)
|
data/lib/atig/channel/channel.rb
CHANGED
data/lib/atig/channel/list.rb
CHANGED
@@ -12,14 +12,14 @@ module Atig
|
|
12
12
|
def on_invite(api, nick)
|
13
13
|
return if @name.include? '^'
|
14
14
|
|
15
|
-
api.post("lists/members/create", :
|
15
|
+
api.post("lists/members/create", screen_name: nick, owner_screen_name: @db.me.screen_name, slug: @name )
|
16
16
|
@db.lists.invalidate @name
|
17
17
|
end
|
18
18
|
|
19
19
|
def on_kick(api, nick)
|
20
20
|
return if @name.include? '^'
|
21
21
|
|
22
|
-
api.post("lists/members/destroy", :
|
22
|
+
api.post("lists/members/destroy", screen_name: nick, owner_screen_name: @db.me.screen_name, slug: @name )
|
23
23
|
@db.lists.invalidate @name
|
24
24
|
end
|
25
25
|
|
@@ -31,7 +31,7 @@ module Atig
|
|
31
31
|
|
32
32
|
def initialize(context, gateway, db)
|
33
33
|
@channels = Hash.new do|hash,name|
|
34
|
-
channel = gateway.channel "##{name}", :
|
34
|
+
channel = gateway.channel "##{name}", handler: Handler.new(db, name)
|
35
35
|
channel.join_me
|
36
36
|
hash[name] = channel
|
37
37
|
end
|
data/lib/atig/channel/retweet.rb
CHANGED
@@ -16,7 +16,7 @@ module Atig
|
|
16
16
|
@channel.notify "Client options: #{context.opts.marshal_dump.inspect}"
|
17
17
|
|
18
18
|
# つないだときに発言がないとさみしいので
|
19
|
-
db.statuses.find_all(:
|
19
|
+
db.statuses.find_all(limit:50).reverse_each do|entry|
|
20
20
|
case entry.source
|
21
21
|
when :timeline, :me
|
22
22
|
@channel.message entry
|
data/lib/atig/command/autofix.rb
CHANGED
@@ -31,17 +31,17 @@ module Atig
|
|
31
31
|
return
|
32
32
|
end
|
33
33
|
text = mesg.split(" ", 2)[1]
|
34
|
-
q = gateway.output_message(:
|
34
|
+
q = gateway.output_message(status: text)
|
35
35
|
|
36
|
-
prev,*_ = db.statuses.find_by_user( db.me, :
|
36
|
+
prev,*_ = db.statuses.find_by_user( db.me, limit: 1)
|
37
37
|
|
38
38
|
unless fix?(command, q[:status], prev) then
|
39
|
-
api.delay(0, :
|
39
|
+
api.delay(0, retry:3) do|t|
|
40
40
|
ret = t.post("statuses/update", q)
|
41
41
|
gateway.update_status ret, target
|
42
42
|
end
|
43
43
|
else
|
44
|
-
api.delay(0, :
|
44
|
+
api.delay(0, retry:3) do|t|
|
45
45
|
yield "Similar update in previous. Conclude that it has error."
|
46
46
|
yield "And overwrite previous as new status: #{q[:status]}"
|
47
47
|
|
data/lib/atig/command/destroy.rb
CHANGED
@@ -18,7 +18,7 @@ module Atig
|
|
18
18
|
if entry = Info.find_status(db, tid)
|
19
19
|
if entry.user.id == db.me.id
|
20
20
|
api.delay(0) do|t|
|
21
|
-
|
21
|
+
t.post("statuses/destroy/#{entry.status.id}")
|
22
22
|
yield "Destroyed: #{entry.status.text}"
|
23
23
|
|
24
24
|
db.statuses.transaction do|d|
|
data/lib/atig/command/dm.rb
CHANGED
@@ -14,7 +14,7 @@ module Atig
|
|
14
14
|
args.each do|tid|
|
15
15
|
if entry = Info.find_status(db, tid)
|
16
16
|
api.delay(0){|t|
|
17
|
-
|
17
|
+
t.post("favorites/#{method}", {id: entry.status.id})
|
18
18
|
yield "#{command.upcase}: #{entry.user.screen_name}: #{entry.status.text}"
|
19
19
|
}
|
20
20
|
else
|
data/lib/atig/command/info.rb
CHANGED
@@ -21,7 +21,7 @@ module Atig
|
|
21
21
|
api.delay(0) do|t|
|
22
22
|
status = t.get "statuses/show/#{id}"
|
23
23
|
db.statuses.transaction do|d|
|
24
|
-
d.add :
|
24
|
+
d.add status: status, user: status.user, source: :thread
|
25
25
|
f.call d.find_by_status_id(id)
|
26
26
|
end
|
27
27
|
end
|
@@ -30,7 +30,7 @@ module Atig
|
|
30
30
|
|
31
31
|
def find_status(db, tid_or_screen_name)
|
32
32
|
find = lambda do|x|
|
33
|
-
xs = db.statuses.find_by_screen_name(x, :
|
33
|
+
xs = db.statuses.find_by_screen_name(x, limit:1)
|
34
34
|
unless xs.empty? then
|
35
35
|
xs.first
|
36
36
|
else
|
data/lib/atig/command/reply.rb
CHANGED
@@ -21,8 +21,8 @@ module Atig
|
|
21
21
|
|
22
22
|
text = "@#{name} #{text}" if text.nil? or not text.include?("@#{name}")
|
23
23
|
|
24
|
-
q = gateway.output_message(:
|
25
|
-
:
|
24
|
+
q = gateway.output_message(status: text,
|
25
|
+
in_reply_to_status_id: entry.status.id)
|
26
26
|
|
27
27
|
api.delay(0) do|t|
|
28
28
|
ret = t.post("statuses/update", q)
|