browser.py: Include room message history links

This commit is contained in:
James Booth
2016-04-08 00:19:18 +01:00
parent 97b3995c59
commit e15ea30cf0

View File

@@ -121,3 +121,20 @@ def prof_post_room_message_display(room, nick, message):
prof.completer_add("/browser", _links[room])
# set last link for room
_lastlink[room] = links[len(links)-1]
def prof_on_room_history_message(room, nick, message, timestamp):
links = re.findall(r'(https?://\S+)', message)
if (len(links) > 0):
if room not in _links:
_links[room] = []
# add to list of links for room
for link in links:
if link not in _links[room]:
_links[room].append(link)
# add to autocompleter if in room
current_room = prof.get_current_muc()
if current_room == room:
prof.completer_add("/browser", _links[room])
# set last link for room
_lastlink[room] = links[len(links)-1]