plugins/resolvejid.lua

Tue, 21 Oct 2014 17:53:04 +0200

author
Kim Alvefur <zash@zash.se>
date
Tue, 21 Oct 2014 17:53:04 +0200
changeset 114
d11cf84975c5
parent 105
4234c8789cc6
permissions
-rw-r--r--

plugins.ietf: HTTPS URLs (thanks darkrain)

function riddim.plugins.resolvejid(bot)
	function bot:resolvejid(jid, room)
		local nows = jid:match"%S+"
		local trimd = jid:match"^%s*(.-)%s*$"
		if room then
			local occupant = room.occupants[jid]
			or room.occupants[trimd]
			or room.occupants[nows]
			if occupant then return occupant.jid end
		end
		return nows
	end
end

mercurial