avoid delete when user may not be authorized

issue #42
This commit is contained in:
Morgan McMillian 2019-02-02 15:20:30 -08:00
parent 55eb6177fe
commit 83c409481d

View file

@ -251,9 +251,13 @@ def delete_message(event, user):
logger.debug("- can't find the event to remove -") logger.debug("- can't find the event to remove -")
return return
r, meta = pnutpy.api.delete_message(e.pnut_chan_id, e.pnut_msg_id) try:
e.deleted = True r, meta = pnutpy.api.delete_message(e.pnut_chan_id, e.pnut_msg_id)
db_session.commit() e.deleted = True
db_session.commit()
except pnutpy.errors.PnutPermissionDenied as e:
pass
def get_displayname(userid): def get_displayname(userid):
url = "http://localhost:8008/_matrix/client/r0/profile/" + userid url = "http://localhost:8008/_matrix/client/r0/profile/" + userid