Add get_profile_info function #13
Loading…
Reference in New Issue
No description provided.
Delete Branch "get_profile_info"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR might be an unnecessary optimization, but its pretty cool that it works.
It adds a function get_profile_info, which returns a HashMap<String, String> of keys to values, for the about information needed for a profile (currently with keys 'name', 'description' and 'image').
Whats interesting about it is it does this with one stream. It creates an about stream for that user, and then iterates through the messages from most recent to least recent.
When it has found values for all the keys its search for, or it reaches the end of the stream, whichever happens first, it exits.
Instead of making a different get_subset call to go-sbot for each value needed, it makes one call, with just one iteration through that stream, and gets all the info it needs.
This is awesome. I appreciate the thorough code comments and the elegance of using a single stream.
Good to merge 🟢