teamikl / ninjam-chat

NINJAM Chat gateway
http://teamikl.github.io/ninjam-chat
2 stars 1 forks source link

Sticky topic for chords #17

Closed teamikl closed 9 years ago

teamikl commented 9 years ago

This commit will resolve #5

teamikl commented 9 years ago
#!/usr/bin/env python3.4

def is_topic_message(msg):
    _, *xs = msg.splitlines()
    return xs and all(x.lstrip().startswith('|') for x in xs)

if __name__ == '__main__':
    # should pass
    msg = """TITLE\n| A | B | C \n| D | E | F"""
    assert is_topic_message(msg)

    # should fail
    msg = """TITLE\n"""
    assert not is_topic_message(msg)
teamikl commented 9 years ago

sticky-topic ブランチで merge master をしたのは、ローカルで rebase すべきだった