示例#1
0
def undeletemsg(hash):
    try:
        m = Message.select().where(Message.block_hash  == hash).get()
        Message.update(hidden = False).where(Message.id == m.id).execute()
        click.echo(f"Un-hid message: {hash}")
    except Message.DoesNotExist:
        click.echo(f"Couldn't find message with has {hash}")
示例#2
0
def deletemsg(hash):
    try:
        m = Message.select().where(Message.block_hash  == hash).get()
        Message.update(hidden = True).where(Message.id == m.id).execute()
        emit('delete_message', json.dumps(Message.format_message(m)), namespace='/mtchannel', broadcast=True)
        click.echo(f"deleted message: {hash}")
    except Message.DoesNotExist:
        click.echo(f"Couldn't find message with has {hash}")