# HG changeset patch # User Kim Alvefur # Date 1289254797 -3600 # Node ID 85b3f2a96edbc9e0410638ff976242b8ebef0e87 # Parent ccce42f781de6610a36a90e0d6dd646296c4d3a4 plugins.version: Report own version in first person, and don't crash if it's not in a room diff -r ccce42f781de -r 85b3f2a96edb plugins/version.lua --- a/plugins/version.lua Mon Nov 08 23:06:48 2010 +0100 +++ b/plugins/version.lua Mon Nov 08 23:19:57 2010 +0100 @@ -10,7 +10,7 @@ }; bot:hook("commands/version", function (command) - local who, param = bot.stream.jid, command.param or (command.room and command.room.nick); + local who, param = bot.stream.jid, command.param; if param then if command.room and command.room.occupants[param] then who = command.room.occupants[param].jid; @@ -23,7 +23,7 @@ bot.stream:query_version(who, function (reply) if not reply.error then - local saywho = (who == command.sender.jid and "You are") or (param.." is"); + local saywho = (who == command.sender.jid and "You are") or (param and param.." is" or "I am"); command:reply(saywho.." running "..(reply.name or "something") .." version "..(reply.version or "unknown") .." on "..(reply.platform or "an unknown platform"));