Skip to content

Commit

Permalink
Fixing issue where message is unassigned
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamBrown42 authored Apr 21, 2018
1 parent 49593c8 commit e72def0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion magicked_admin/server/chat/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def run(self):
message_tree = html.fromstring(message_html)
# xpath returns a list but theres only ever one of each because i split earlier
username_arr = message_tree.xpath('//span[starts-with(@class,\'username\')]/text()')
message = message_tree.xpath('//span[@class="message"]/text()')[0]
if len(username_arr) < 1:
logger.debug("Message without username '{}' ({})"
.format(message, self.server.name))
Expand All @@ -68,7 +69,6 @@ def run(self):
continue
user_type = user_type_arr[0]

message = message_tree.xpath('//span[@class="message"]/text()')[0]
admin = True if "admin" in user_type else False

self.handle_message(username, message, admin)
Expand Down

0 comments on commit e72def0

Please sign in to comment.