Commit 83c40948 authored by Morgan McMillian's avatar Morgan McMillian

avoid delete when user may not be authorized

issue #42
parent 55eb6177
......@@ -251,9 +251,13 @@ def delete_message(event, user):
logger.debug("- can't find the event to remove -")
return
r, meta = pnutpy.api.delete_message(e.pnut_chan_id, e.pnut_msg_id)
e.deleted = True
db_session.commit()
try:
r, meta = pnutpy.api.delete_message(e.pnut_chan_id, e.pnut_msg_id)
e.deleted = True
db_session.commit()
except pnutpy.errors.PnutPermissionDenied as e:
pass
def get_displayname(userid):
url = "http://localhost:8008/_matrix/client/r0/profile/" + userid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment