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 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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 🟢