lib/ayadn/action.rb in ayadn-1.0.6 vs lib/ayadn/action.rb in ayadn-1.0.7
- old
+ new
@@ -605,11 +605,11 @@
end
def messages(channel_id, options)
begin
channel_id = get_channel_id_from_alias(channel_id)
- doing
+ doing(options)
resp = @api.get_messages(channel_id, options)
(no_new_posts unless Databases.has_new?(resp, "channel:#{channel_id}")) if options[:new]
Databases.save_max_id(resp)
if options[:raw]
@view.show_raw(resp)
@@ -677,20 +677,21 @@
def auto(options)
begin
@view.clear_screen
puts Status.auto
poster = Post.new
- platform = Settings.config[:platform]
- case platform
- when /mswin|mingw|cygwin/
- poster.auto_classic
- else
+ # platform = Settings.config[:platform]
+ # case platform
+ # when /mswin|mingw|cygwin/
+ # poster.auto_classic
+ # else
require "readline"
poster.auto_readline
- end
+ # end
rescue => e
- Errors.global_error("action/auto post", [options, platform], e)
+ #Errors.global_error("action/auto post", [options, platform], e)
+ Errors.global_error("action/auto post", [options], e)
ensure
Databases.close_all
end
end
@@ -788,11 +789,11 @@
end
end
def nowplaying
begin
- abort(Status.error_only_osx) unless Settings.config[:platform] =~ /darwin/
+ #abort(Status.error_only_osx) unless Settings.config[:platform] =~ /darwin/
itunes = get_track_infos
itunes.each do |el|
abort(Status.empty_fields) if el.length == 0
end
@view.clear_screen
@@ -1066,10 +1067,16 @@
end
end
def get_channel_id_from_alias(channel_id)
unless channel_id.is_integer?
- channel_id = Databases.get_channel_id(channel_id)
+ orig = channel_id
+ channel_id = Databases.get_channel_id(orig)
+ if channel_id.nil?
+ Errors.warn("Alias '#{orig}' doesn't exist.")
+ puts "\nThis alias doesn't exist.\n\n".color(:red)
+ exit
+ end
end
channel_id
end
def winsize