my.zulip: add message permalink

This commit is contained in:
Dima Gerasimov 2022-01-28 00:53:05 +00:00 committed by karlicoss
parent a39b5605ae
commit 673ee53a49

View file

@ -66,6 +66,15 @@ class Message:
server: Server
content: str
@property
def permalink(self) -> str:
# seems that these link to the same message
# https://memex.zulipchat.com/#narrow/stream/284580-python/topic/py-spy.20profiler/near/234798881
# https://memex.zulipchat.com/#narrow/stream/284580/near/234798881
# https://memex.zulipchat.com/#narrow/near/234798881
# however not sure how to correlate stream id and message/topic for now, so preferring the latter version
return f'https://{self.server.string_id}.zulipchat.com/#narrow/near/{self.id}'
from typing import Union
from itertools import count