Skip to content

Commit

Permalink
Fix wrong private indexing
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Minari <yangm97@gmail.com>
  • Loading branch information
yangm97 committed Dec 17, 2018
1 parent 90fe0ca commit c5254eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/groupbutler/utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ local admins_permissions = {
}

local function set_creator_permissions(self, chat_id, user_id)
local red = self.red
local red = _p[self].red
local set = ("cache:chat:%s:%s:permissions"):format(chat_id, user_id)
for k, _ in pairs(admins_permissions) do
red:sadd(set, k)
Expand Down Expand Up @@ -393,7 +393,7 @@ function _M:resolve_user(username)
assert(username:byte(1) == string.byte('@'))
username = username:lower()

local stored_id = self.db:get_user_id(username)
local stored_id = _p[self].db:get_user_id(username)
if not stored_id then return false end

local user_obj = api:getChat(stored_id)
Expand All @@ -406,7 +406,7 @@ function _M:resolve_user(username)

-- Users could change their username
if username ~= '@' .. user_obj.username:lower() then
self.db:cache_user(user_obj)
_p[self].db:cache_user(user_obj)
-- And return false because this user not the same that asked
return false
end
Expand Down Expand Up @@ -780,7 +780,7 @@ function _M:getnames_complete(msg)
end

function _M:get_user_id(msg, blocks)
local i18n = self.i18n
local i18n = _p[self].i18n
--if no user id: returns false and the msg id of the translation for the problem
if not msg.reply and not blocks[2] then
return false, i18n("Reply to a user or mention them")
Expand Down

0 comments on commit c5254eb

Please sign in to comment.