-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for decoding roomID from Space events #55
Conversation
deprecates get_global_id in favour of try_global_id with error reporting
If the approach is ok, I will modify the examples to use |
src/types.rs
Outdated
if uuid.as_bytes()[7] == b'2' { | ||
uuid.replace_range(7..8, "0"); | ||
} else { | ||
panic!("Space created uuid {uuid} could not be not patched"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really do not like a panic, I would rather return an Error since we already are returning a Result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like
crate::error::ErrorKind::Api(
"Space created uuid {uuid} could not be not patched",
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes, that one slipped through the cracks from a previous version! I'll remove it
5e96902
to
d944c31
Compare
Space events have a different way to report the target room id than message events. It also varies based on the Space event type, and the Create event requires patching of the UUID. §
This PR includes changes to make this all transparent in the
get_global_id
.At the same time, it deprecates
get_global_id
in favour oftry_global_id
with error reporting.