get_about_messages #4
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: golgi-ssb/golgi#4
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
still thinking about how to get the about messages we need for a profile.
Based on models.js in goasis,
b7d92c6307/item/src/models.js (L93)
we can see here that they filter down to just messages where a certain key (e.g. description, or image) != undefined.
I think we may have to do the same thing in rust. I'm not sure if getSubset has capability to construct a query like that?
the tricky thing is that each individual about message may just have a particular key in it (e.g. just description, or just image), not all of them. To find the latest description, we need to look at all about messages from that auther that contain the field description, and choose the latest one.
so we could use getSubset to get the about messages by the author, and then filter in rust. does this also make sense to you @glyph and @cblgh or do you see another way?
hmm I'm also recalling that cryptix mentioned ssb-names https://github.com/ssbc/ssb-names,
but I can't find in notes or elsewhere, if there is a go-equivalent for this plugin or how to use it?
@notplants
Yes, we will have to filter the results of the
getSubset
query. The code you linked is usinggetSubset
(getMessagesOfType
is just a special case ofgetSubset
):L84:
partialReplication.getMessagesOfType
There's a little more context about
getMessagesOfType
in this issue.getSubset
has adescending
option which gives the latest message first. That will be useful when constructing these queries.Then you can iterate on the vector of messages and use
get
to index into each one andbreak
when you find what you're looking for.Closing this since this is done now.