slack: Clarify var naming of sanitize text function.
This commit is contained in:
parent
ce51d99c6a
commit
46fd234824
|
@ -226,13 +226,14 @@ def channelmessage2zerver_message(slack_dir, channel, added_users, added_channel
|
||||||
token = token.replace('<@', ' ')
|
token = token.replace('<@', ' ')
|
||||||
token = token.replace('>', ' ')
|
token = token.replace('>', ' ')
|
||||||
token = token.replace('|', ' ')
|
token = token.replace('|', ' ')
|
||||||
length = len(token.split(' '))
|
morphemes = token.split(' ')
|
||||||
|
length = len(morphemes)
|
||||||
if length > 1:
|
if length > 1:
|
||||||
try:
|
if length > 2:
|
||||||
short_name = token.split(' ')[2]
|
short_name = morphemes[2]
|
||||||
except IndexError:
|
else:
|
||||||
short_name = ''
|
short_name = ''
|
||||||
token = token.split(' ')[1]
|
token = morphemes[1]
|
||||||
for user in users:
|
for user in users:
|
||||||
if (user['id'] == token and user['name'] == short_name and length == 4) or \
|
if (user['id'] == token and user['name'] == short_name and length == 4) or \
|
||||||
(user['id'] == token and length == 3):
|
(user['id'] == token and length == 3):
|
||||||
|
|
Loading…
Reference in a new issue