feat(messages): expose sender name and send time on Message - #109
Merged
nickknissen merged 2 commits intoSep 26, 2026
Merged
Conversation
The API returns sender.fullName and sendDateTime for every message, but Message dropped them, so the JSON output of `aula messages` could not say who wrote a message or when. Both are optional and default to None.
Review follow-up: sender_name and send_datetime are keyword-only, so Message(id, html, attachments, raw) keeps meaning what it did. send_datetime goes through parse_api_datetime like Post's timestamps, giving None for a missing or unreadable value. Tests cover empty and odd senders, unreadable timestamps and the positional order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API returns
sender.fullNameandsendDateTimefor every message, butMessagedropped both, so neither the library nor the JSON output ofaula messagescould say who wrote a message or when it was sent.Changes:
Messagegainssender_name: str | None(fromsender.fullName) andsend_datetime: datetime | None(fromsendDateTime, parsed withparse_api_datetime, likePost's timestamps). Both default toNonefora missing, empty or unreadable value.
Message(id, content_html, attachments, _raw)means what it did before.dict(message)and--output jsoninclude them automatically, sinceAulaDataClass.__iter__covers every field except_raw.Tests:
tests/models/test_message.py: sender and time read from API data;missing sender;
senderasNone,{},{"fullName": None},{"fullName": ""}and a non-dict; unreadable timestamps (None,"",garbage, a number); positional construction unchanged.
ruff format --checkandruff checkclean.
time in
aula --output json messages.