add get[Profile|Conversation]Attribute api #81
Loading…
Reference in New Issue
No description provided.
Delete Branch "getAttr"
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?
@ -1028,6 +1028,42 @@ func SetProfileAttribute(profileOnion string, key string, value string) {
}
}
type Attribute struct {
document
@ -1046,0 +1086,4 @@
return C.CString(GetConversationAttribute(profileOnion, int(conversation_id), key))
}
// GetGonversationAttribute provides a wrapper around profile.GetProfileAttribute
comment is wrong
@ -1046,0 +1091,4 @@
func GetConversationAttribute(profileOnion string, conversationID int, key string) string {
profile := application.GetPeer(profileOnion)
zone, key := attr.ParseZone(key)
res, exists := profile.GetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(zone.ConstructZonedPath(key)))
this will only get local attributes - some conversation attributes are non-local...probably worth using attr.ParseScope to fully resolve all possible keys.
@ -1046,0 +1092,4 @@
profile := application.GetPeer(profileOnion)
zone, key := attr.ParseZone(key)
res, exists := profile.GetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(zone.ConstructZonedPath(key)))
attr := Attribute{exists == nil, res}
exists is bool right? checking for nil seems wrong here. Use named parameters (
Attribute {Exists: x...
my bad, renamed to err, as this function returns an err, not a bool, hence the nil check
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/libcwtch-go/262
296146fa2b
tocfd8fe21c8
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/libcwtch-go/264