From a2cd248f43fafdd9f385e52403c145f4e5e9fc75 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 24 Jun 2008 15:47:40 +0200 Subject: [PATCH] lastfm plugin: code cleanup and warning suppression --- data/rbot/plugins/lastfm.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb index e14eb94b..628eb8d4 100644 --- a/data/rbot/plugins/lastfm.rb +++ b/data/rbot/plugins/lastfm.rb @@ -160,9 +160,9 @@ class LastFmPlugin < Plugin def now_playing(m, params) opts = { :cache => false } user = nil - if params[:who] then + if params[:who] user = params[:who].to_s - elsif @registry.has_key? ( m.sourcenick ) then + elsif @registry.has_key? m.sourcenick user = @registry[ m.sourcenick ] else # m.reply "I don't know who you are on last.fm. Use 'lastfm set username' to identify yourself." @@ -188,7 +188,7 @@ class LastFmPlugin < Plugin end else return if params[:recurs] - if @registry.has_key? ( user ) then + if @registry.has_key? user params[:who] = @registry[ user ] params[:recurs] = true now_playing(m, params) @@ -251,12 +251,12 @@ class LastFmPlugin < Plugin def get_user(m, params) nick = "" - if params[:who] then + if params[:who] nick = params[:who].to_s else nick = m.sourcenick end - if @registry.has_key?( nick ) then + if @registry.has_key? nick user = @registry[ nick ] m.reply "#{nick} is #{user} at last.fm" else @@ -270,7 +270,7 @@ class LastFmPlugin < Plugin user = nil if params[:user] then user = params[:user].to_s - elsif @registry.has_key? ( m.sourcenick ) then + elsif @registry.has_key? m.sourcenick user = @registry[ m.sourcenick ] else # m.reply "I don't know who you are on last.fm. Use 'lastfm set username' to identify yourself." -- 2.39.2