Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'otherfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
ltworf committed Mar 22, 2024
2 parents 764c8cb + c7d38ed commit ea7e12c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1.30
* Do not crash when encountering graves of deleted files

1.29
* Do not crash when encountering deleted files
Expand Down
9 changes: 4 additions & 5 deletions control.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ async def handle_sendfile(ircclient: "IrcClient", reader, writer) -> None:
async def handle_client(ircclient: "IrcClient", reader, writer) -> None:
command = (await reader.readline()).strip()

match command:
case b"sendfile":
await handle_sendfile(ircclient, reader, writer)
case b"write":
await handle_write(ircclient, reader, writer)
if command == b"sendfile":
await handle_sendfile(ircclient, reader, writer)
elif command == b"write":
await handle_write(ircclient, reader, writer)

async def listen(socket_path: str, ircclient: "IrcClient") -> None:
server = await asyncio.start_unix_server(lambda r,w: handle_client(ircclient, r, w), socket_path)
Expand Down
14 changes: 12 additions & 2 deletions slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ class File:
title: Optional[str] = None
mimetype: Optional[str] = None

@dataclass
class TabutuFile:
"""
'un sacciu chi minchia è sta cosa.
Sacciu sulu ca slack u manna
"""
id: str
mode: Literal['tombstone']


class Topic(NamedTuple):
"""
Expand Down Expand Up @@ -300,7 +310,7 @@ class HistoryBotMessage:
bot_id: Optional[str]
username: str = 'bot'
ts: float = 0
files: list[File | DeletedFile] = field(default_factory=list)
files: list[File | DeletedFile | TabutuFile] = field(default_factory=list)
thread_ts: Optional[str] = None
attachments: list[dict[str, Any]] = field(default_factory=list)

Expand All @@ -311,7 +321,7 @@ class HistoryMessage:
user: str
text: str
ts: float
files: list[File | DeletedFile] = field(default_factory=list)
files: list[File | DeletedFile | TabutuFile] = field(default_factory=list)
thread_ts: Optional[str] = None


Expand Down

0 comments on commit ea7e12c

Please sign in to comment.