PostID
typeNOTE: a PostID is relative to the userPosts.
Value
social.PostID
Reaction
typeReaction is for the "enum" of ways to react to a post
Value
social.Reaction
Gnod
social.ReactionValue
<zero>
MaxReaction
social.ReactionValue
<zero>
Post
typeA Post is a "thread" or a "reply" depending on context. A thread is a Post of a UserPosts that holds other replies. This is similar to boards.Post except that this doesn't have a title.
Value
social.Post
newPost
func(userPosts *social.UserPosts, id social.PostID, creator .uverse.address, body string, threadID social.PostID, parentID social.PostID, repostUser .uverse.address) *social.Post- OID
- 060f00…6547:3
newPost details
validateReaction
func(reaction social.Reaction)- OID
- 060f00…6547:5
validateReaction details
getPosts
func(posts v0.BPTree, startIndex int, endIndex int) string- OID
- 060f00…6547:6
getPosts details
UserAndPostID
typeValue
social.UserAndPostID
PostMessage
func(body string) social.PostIDPost a message to the caller's main user posts. The caller must already be registered with /r/gnoland/users/v1 Register. Return the "thread ID" of the new post. (This is similar to boards.CreateThread, but no message title)
- OID
- 060f00…6547:7
PostMessage details
PostReply
func(userPostsAddr .uverse.address, threadid social.PostID, postid social.PostID, body string) social.PostIDPost a reply to the user posts of userPostsAddr where threadid is the ID returned by the original call to PostMessage. If postid == threadid then create another top-level post for the threadid, otherwise post a reply to the postid "sub reply". The caller must already be registered with /r/gnoland/users/v1 Register. Return the new post ID. (This is similar to boards.CreateReply.)
- OID
- 060f00…6547:9
PostReply details
RepostThread
func(userPostsAddr .uverse.address, threadid social.PostID, comment string) social.PostIDRepost the message from the user posts of userPostsAddr where threadid is the ID returned by the original call to PostMessage. This must be a top-level thread (not a reply). Return the new post ID. (This is similar to boards.CreateRepost.)
- OID
- 060f00…6547:10
RepostThread details
GetJsonTopPostsByID
func(addrAndIDs []social.UserAndPostID) stringFor each address/PostID in addrAndIDs, get the thread post. The Post ID must be for a a top-level thread (not a reply; to get reply posts, use GetThreadPosts). If the Post ID is not found, set the result for that Post ID to {}. The response is a JSON string.
- OID
- 060f00…6547:11
GetJsonTopPostsByID details
GetThreadPosts
func(userPostsAddr .uverse.address, threadID int, replyID int, startIndex int, endIndex int) stringGet posts in a thread for a user. A thread is the sequence of posts without replies. While each post has an an arbitrary id, it also has an index within the thread starting from 0. Limit the response to posts from startIndex up to (not including) endIndex within the thread. If you just want the total count, set startIndex and endIndex to 0 and see the response "n\_threads". If threadID is 0 then return the user's top-level posts. (Like render args "user".) If threadID is X and replyID is 0, then return the posts (without replies) in that thread. (Like render args "user/2".) If threadID is X and replyID is Y, then return the posts in the thread starting with replyID. (Like render args "user/2/5".) The response includes reposts by this user (only if threadID is 0), but not messages of other users that are being followed. (See GetJsonHomePosts.) The response is a JSON string.
- OID
- 060f00…6547:12
GetThreadPosts details
RefreshHomePosts
func(userPostsAddr .uverse.address) intUpdate the home posts by scanning all posts from all followed users and adding the followed posts since the last call to RefreshHomePosts (or since started following the user). Return the new count of home posts. The result is something like "(12 int)".
- OID
- 060f00…6547:13
RefreshHomePosts details
GetHomePostsCount
func(userPostsAddr .uverse.address) intGet the number of posts which GetJsonHomePosts will return. The result is something like "(12 int)". This returns the current count of the home posts (without need to pay gas). To include the latest followed posts, call RefreshHomePosts.
- OID
- 060f00…6547:14
GetHomePostsCount details
getHomePosts
func(userPostsAddr .uverse.address) *v0.BPTreeGet home posts for a user, which are the user's top-level posts plus all posts of all users being followed. The response is a map of postID -> \*Post. The bptree.BPTree sorts by the post ID which is unique for every post and increases in time. This must not be exported. Another realm holding this pointer could mutate the tree (and the posts in it) with this realm's authority.
- OID
- 060f00…6547:15
getHomePosts details
GetJsonHomePosts
func(userPostsAddr .uverse.address, startIndex int, endIndex int) stringGet home posts for a user, which are the user's top-level posts plus all posts of all users being followed. Limit the response to posts from startIndex up to (not including) endIndex within the home posts. If you just want the total count, use GetHomePostsCount. The response is a JSON string. This returns the current state of the home posts (without need to pay gas). To include the latest posts, call RefreshHomePosts.
- OID
- 060f00…6547:16
GetJsonHomePosts details
Follow
func(followedAddr .uverse.address) social.PostIDUpdate the caller to follow the user with followedAddr. See UserPosts.follow.
- OID
- 060f00…6547:17
Follow details
Unfollow
func(followedAddr .uverse.address)Update the caller to unfollow the user with followedAddr. See UserPosts.unfollow.
- OID
- 060f00…6547:18
Unfollow details
AddReaction
func(userPostsAddr .uverse.address, threadid social.PostID, postid social.PostID, reaction social.Reaction) boolAdd the reaction by the caller to the post of userPostsAddr, where threadid is the ID returned by the original call to PostMessage. If postid == threadid then add the reaction to a top-level post for the threadid, otherwise add the reaction to the postid "sub reply". (This function's arguments are similar to PostReply.) The caller must already be registered with /r/gnoland/users/v1 Register. Return a boolean indicating whether the userAddr was added. See Post.addReaction.
- OID
- 060f00…6547:19
AddReaction details
RemoveReaction
func(userPostsAddr .uverse.address, threadid social.PostID, postid social.PostID, reaction social.Reaction) boolRemove the reaction by the caller to the post of userPostsAddr, where threadid is the ID returned by the original call to PostMessage. If postid == threadid then remove the reaction from a top-level post for the threadid, otherwise remove the reaction from the postid "sub reply". (This function's arguments are similar to PostReply.) The caller must already be registered with /r/gnoland/users/v1 Register. Return a boolean indicating whether the userAddr was removed. See Post.removeReaction.
- OID
- 060f00…6547:20
RemoveReaction details
GetJsonUserByAddress
func(addr .uverse.address) stringCall users.ResolveAddress and return the result as JSON, or "" if not found. (This is a temporary utility until gno.land supports returning structured data directly.)
- OID
- 060f00…6547:21
GetJsonUserByAddress details
GetJsonUserByName
func(name string) stringCall users.ResolveName and return the result as JSON, or "" if not found. (This is a temporary utility until gno.land supports returning structured data directly.)
- OID
- 060f00…6547:22
GetJsonUserByName details
GetJsonUserPostsInfo
func(address .uverse.address) stringGet the UserPosts info for the user with the given address, including url, n\_threads, n\_followers and n\_following. If the user address is not found, return "". The name of this function has "Info" because it just returns the number of items, not the items themselves. To get the items, see GetJsonFollowers, etc. The response is a JSON string.
- OID
- 060f00…6547:23
GetJsonUserPostsInfo details
GetJsonFollowers
func(address .uverse.address, startIndex int, endIndex int) stringGet the UserPosts for the user with the given address, and return the list of followers. If the user address is not found, return "". Limit the response to entries from startIndex up to (not including) endIndex. The response is a JSON string.
- OID
- 060f00…6547:24
GetJsonFollowers details
GetJsonFollowing
func(address .uverse.address, startIndex int, endIndex int) stringGet the UserPosts for the user with the given address, and return the list of other users that this user is following. If the user address is not found, return "". Limit the response to entries from startIndex up to (not including) endIndex. The response is a JSON string.
- OID
- 060f00…6547:25
GetJsonFollowing details
ListUsersByPrefix
func(prefix string, maxResults int) []stringGet a list of user names starting from the given prefix. Limit the number of results to maxResults.
- OID
- 060f00…6547:26
ListUsersByPrefix details
ListJsonUsersByPrefix
func(prefix string, maxResults int) stringGet a list of user names starting from the given prefix. Limit the number of results to maxResults. The response is a JSON string.
- OID
- 060f00…6547:27
ListJsonUsersByPrefix details
resolveAddr
func(nameOrAddr string) .uverse.address- OID
- 060f00…6547:28
resolveAddr details
Render
func(path string) string- OID
- 060f00…6547:30
Render details
gUserPostsByAddress
v0.BPTree// user's address -> \*UserPosts
- OID
- 060f00…6547:32
gUserPostsByAddress details
gUserAddressByName
v0.BPTree// user's username -> address
- OID
- 060f00…6547:34
gUserAddressByName details
postsCtr
uint64// increments Post.id globally
Value
2
gRealmPath
stringValue
"/r/berty/social"
init.35
func()- OID
- 060f00…6547:37
init.35 details
FollowingInfo
typeValue
social.FollowingInfo
UserPosts
typeUserPosts is similar to boards.Board where each user has their own "board" for posts which come from the user. The list of posts is identified by the user's address . A user's "home feed" may contain other posts (from followed users, etc.) but this only has the top-level posts from the user (not replies to other user's posts).
Value
social.UserPosts
newUserPosts
func(url string, userAddr .uverse.address) *social.UserPostsCreate a new userPosts for the user. Panic if there is already a userPosts for the user.
- OID
- 060f00…6547:39
newUserPosts details
getUserPosts
func(userAddr .uverse.address) *social.UserPostsGet the UserPosts for the user.
- OID
- 060f00…6547:41
getUserPosts details
getOrCreateUserPosts
func(userAddr .uverse.address, username string) *social.UserPostsGet the UserPosts for the userAddr. If not found, add a new UserPosts to gUserPostsByAddress and update gUserAddressByName with the username. (The caller usually has already called usernameOf to get the username, but if it is "" then this will get it.)
- OID
- 060f00…6547:43
getOrCreateUserPosts details
padZero
func(u64 uint64, length int) string- OID
- 060f00…6547:44
padZero details
postIDKey
func(pid social.PostID) string- OID
- 060f00…6547:45
postIDKey details
reactionKey
func(reaction social.Reaction) string- OID
- 060f00…6547:46
reactionKey details
getOrCreateReactionValue
func(reactions *v0.BPTree, reaction social.Reaction) *v0.BPTreeIf reactions has an value for the given reaction, then return it. Otherwise, add the reaction key to reactions, set the value to an empty bptree.BPTree and return it.
- OID
- 060f00…6547:47
getOrCreateReactionValue details
listByteStringKeysByPrefix
func(tree v0.ITree, prefix string, maxResults int) []stringlistByteStringKeysByPrefix returns up to maxResults keys from tree that start with the given prefix, treating keys as byte strings (not Unicode runes). Inlined from gno.land/p/jefft0/avlhelpers which is not yet deployed.
- OID
- 060f00…6547:48
listByteStringKeysByPrefix details
indentBody
func(indent string, body string) string- OID
- 060f00…6547:49
indentBody details
summaryOf
func(str string, length int) stringNOTE: length must be greater than 3.
- OID
- 060f00…6547:50
summaryOf details
displayAddressMD
func(addr .uverse.address) string- OID
- 060f00…6547:51
displayAddressMD details
usernameOf
func(addr .uverse.address) string- OID
- 060f00…6547:52
usernameOf details
marshalJsonUser
func(user *users.UserData) stringReturn the User info as a JSON string. (This is a temporary utility until gno.land supports returning structured data directly.)
- OID
- 060f00…6547:53