From 70057ab323733b459c3ed91b90cea83d09d9387f Mon Sep 17 00:00:00 2001 From: Steven van Loef Date: Wed, 8 Jul 2015 15:08:15 +0200 Subject: [PATCH 1/4] Channels for saving muted hashtags, threads and clients --- channel-types/net.muting.posts.clients | 65 ++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 channel-types/net.muting.posts.clients diff --git a/channel-types/net.muting.posts.clients b/channel-types/net.muting.posts.clients new file mode 100644 index 0000000..e2c98ce --- /dev/null +++ b/channel-types/net.muting.posts.clients @@ -0,0 +1,65 @@ + +# Channels for saving muted hashtags, threads and clients + + +> ### net.muting.posts.clients +> ### net.muting.posts.threads +> ### net.muting.posts.hashtags + + +Based on discussions with [@matigo](https://app.net/matigo) and [@33mhz](https://app.net/33mhz) I came up with this setup, for each type of mutable object one channel per user. In this case 3 channels: Hashtags, Threads and Clients. Each channel will have an annotation because those are mutable. The annotation holds an array of muted ids (tags, thread ids, client ids) for that particular object. I used id for all 3 objects to make the naming convention a bit more uniform. For the channel name I tried to make it generic and 'ready for future’. For example net.muting.messages.threads would be possible. I don’t want to put a product name in the channel or annotation types but keep things generic. But in the end it doesn’t really matter of course. The values are what matters. + +This is how Chimp stores it now, just 3 arrays of ids. At the moment there is no option for a user to see the lists of muted ids in Chimp, but ids can be unmuted by the user by touch&holding a particular muted post. Chimp shows muted posts as such in one line of text which states the type of mute and who created the post. A single tap on it will just show that one post and keep all the rest muted. + +##Hashtags + +###Channel +“type”: "net.muting.posts.hashtags" + +###Annotation +"type": “muted.tags" +"value": { + "ids": [{’superbowl2016’:1464739200}, {‘crap’:0}, {‘spam’:0}] +} + +##Threads + +###Channel +“type”: "net.muting.posts.threads" + +###Annotation +"type": “muted.threads" +"value": { + "ids": [{‘12345’:0}, {‘666’:0}, {‘98765’:0}] +} + +##Clients + +###Channel +“type”: "net.muting.posts.clients" + +###Annotation +"type": “muted.clients" +"value": { + "ids": [{‘decaffe’:0}, {‘1337af’:0}, {‘def789’:0}] +} + +##Creating the channels + +First find users’ subscribed channels of type X, use first one ever created to make sure no rogue channel is used +If no channel of type X found, create it. public: false + +If something goes wrong during development/testing of a channel be sure to deactivate the channel https://developers.app.net/reference/resources/channel/lifecycle/#deactivate-a-channel This way it won't show up in the query for the channels anymore. + + +## Maintainers +* [Steven van Loef](http://www.yellowdice.com/) ([@ludolphus](https://app.net/ludolphus)) + + +## Used by +* [Chimp](http://chimp.li/chimp) + + +## Related entries +* net.muting.posts.hashtags +* net.muting.posts.threads From c11774dc50e1e15682abf821f58b0f4345947b29 Mon Sep 17 00:00:00 2001 From: Steven van Loef Date: Wed, 8 Jul 2015 15:09:04 +0200 Subject: [PATCH 2/4] rename to .md --- .../{net.muting.posts.clients => net.muting.posts.clients.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename channel-types/{net.muting.posts.clients => net.muting.posts.clients.md} (100%) diff --git a/channel-types/net.muting.posts.clients b/channel-types/net.muting.posts.clients.md similarity index 100% rename from channel-types/net.muting.posts.clients rename to channel-types/net.muting.posts.clients.md From 241ceb27abcced27bd182649a4b8d653d220555f Mon Sep 17 00:00:00 2001 From: Steven van Loef Date: Sun, 12 Jul 2015 21:03:49 +0200 Subject: [PATCH 3/4] Channel Avatar annotation Add an avatar to channels of type patter and broadcast (potentially other channels as well) --- annotations/net.app.channel.avatar_image.md | 43 +++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 annotations/net.app.channel.avatar_image.md diff --git a/annotations/net.app.channel.avatar_image.md b/annotations/net.app.channel.avatar_image.md new file mode 100644 index 0000000..05d1d0f --- /dev/null +++ b/annotations/net.app.channel.avatar_image.md @@ -0,0 +1,43 @@ + +# Channel Avatar + + +> ### net.app.channel.avatar_image + + +Add an avatar to channels of type patter and broadcast (potentially other channels as well) + + +## Example + +### Provided to App.net +~~~ js +{ + "type": "net.app.channel.avatar_image", + "value": { + { + "url": 'URL_TO_AVATAR', + "width": '200', + "height": '200', + } + } +} +~~~ + + +## Fields + +| Field | Required? | Type | Description | +| ----- | --------- | ---- | ----------- | +| url | Required | string | url pointing to the avatar image | +| width | Required | string | width of the avatar, clients can scale as needed | +| height | Required | string | height of the avatar | + + +## Maintainers +* [@ludolphus](https://alpha.app.net/ludolphus) + + +## Used by + +* [Chimp](http://chimp.li) for Patter and Broadcast channels Chimp provides a UI to set the avatar From 989040c4f1540765fa087e633999343a981c2a68 Mon Sep 17 00:00:00 2001 From: Steven van Loef Date: Sat, 25 Jul 2015 16:08:39 +0200 Subject: [PATCH 4/4] updated annotations for muting --- channel-types/net.muting.posts.clients.md | 74 ++++++++++++++++++++--- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/channel-types/net.muting.posts.clients.md b/channel-types/net.muting.posts.clients.md index e2c98ce..b55540d 100644 --- a/channel-types/net.muting.posts.clients.md +++ b/channel-types/net.muting.posts.clients.md @@ -7,47 +7,102 @@ > ### net.muting.posts.hashtags -Based on discussions with [@matigo](https://app.net/matigo) and [@33mhz](https://app.net/33mhz) I came up with this setup, for each type of mutable object one channel per user. In this case 3 channels: Hashtags, Threads and Clients. Each channel will have an annotation because those are mutable. The annotation holds an array of muted ids (tags, thread ids, client ids) for that particular object. I used id for all 3 objects to make the naming convention a bit more uniform. For the channel name I tried to make it generic and 'ready for future’. For example net.muting.messages.threads would be possible. I don’t want to put a product name in the channel or annotation types but keep things generic. But in the end it doesn’t really matter of course. The values are what matters. +The app.net API provides muting options for users and channels but not for any other object types. We thought it would be useful to have more muting options available to the user to prevent spam in post timelines and other unwanted content. We decided to add muting options for hashtags, threads and clients. + +Based on discussions with [@matigo](https://app.net/matigo) and [@33mhz](https://app.net/33mhz) I ([@ludolphus](https://app.net/ludolphus)) came up with this setup, for each type of mutable object one channel per user. In this case 3 channels: Hashtags, Threads and Clients. Each channel will have an annotation because those are mutable. The annotation holds an array of muted ids (tags, thread ids, client ids) for that particular object. For the channel name I tried to make it generic and 'ready for future’. For example net.muting.messages.threads would be possible. I don’t want to put a product name in the channel or annotation types but keep things generic. But in the end it doesn’t really matter of course. The keys and values are what matters. This is how Chimp stores it now, just 3 arrays of ids. At the moment there is no option for a user to see the lists of muted ids in Chimp, but ids can be unmuted by the user by touch&holding a particular muted post. Chimp shows muted posts as such in one line of text which states the type of mute and who created the post. A single tap on it will just show that one post and keep all the rest muted. +Broadsword has support for hashtag muting based on this specification. + ##Hashtags ###Channel “type”: "net.muting.posts.hashtags" ###Annotation +``` "type": “muted.tags" "value": { - "ids": [{’superbowl2016’:1464739200}, {‘crap’:0}, {‘spam’:0}] + "ids": [ + { + 'name':'superbowl2016', + 'expire_at':1464739200 + }, + { + 'name':'crap', + 'expire_at':0 + }, + { + 'name':'spam', + 'expire_at':0 + } + ] } - +``` +The key 'expire_at' is optional (or set to 0), it doesn't have to be written or used by a client. If used it specifies a timestamp in UNIX epoch when the muting for the object should expire. In this case a client may decide to remove to muted object from the annotation. ##Threads ###Channel “type”: "net.muting.posts.threads" ###Annotation +``` "type": “muted.threads" "value": { - "ids": [{‘12345’:0}, {‘666’:0}, {‘98765’:0}] + "ids": [ + { + 'id':'12345', + 'expire_at': 0 + }, + { + 'id':'666', + 'expire_at':0 + }, + { + 'id':'98765', + 'expire_at':0 + } + ] } +``` +The key 'expire_at' is optional (or set to 0), it doesn't have to be written or used by a client. If used it specifies a timestamp in UNIX epoch when the muting for the object should expire. In this case a client may decide to remove to muted object from the annotation. +Suggestion for a UI to manage muted threads: use the [Retrieve multiple posts endpoint](https://developers.app.net/reference/resources/post/lookup/#retrieve-multiple-posts) to retrieve the first post of all muted threads. Show these to the user and let them unmute the thread(s). ##Clients - ###Channel “type”: "net.muting.posts.clients" ###Annotation +``` "type": “muted.clients" "value": { - "ids": [{‘decaffe’:0}, {‘1337af’:0}, {‘def789’:0}] + "ids": [ + { + 'name': 'Alpha', + 'id': 'caYWDBvjwt2e9HWMm6qyKS6KcATHUkzQ', + 'expire_at':0 + }, + { + 'name': 'dlvrit', + 'id': 'AnL26PHsjb4MbzDkwJcJD9qUMsem56dP', + 'expire_at':0 + }, + { + 'name': 'IFTTT', + 'id': 'GzJVygE6vpLbabgBtEKzEKH8ASzS6mF3', + 'expire_at':0 + } + ] } +``` +For clients the 'name' key is added to make it easier for a UI that manages muted objects to show the user which clients are muted. The 'id' key should be used when filtering posts. +The key 'expire_at' is optional (or set to 0), it doesn't have to be written or used by a client. If used it specifies a timestamp in UNIX epoch when the muting for the object should expire. In this case a client may decide to remove to muted object from the annotation. ##Creating the channels First find users’ subscribed channels of type X, use first one ever created to make sure no rogue channel is used -If no channel of type X found, create it. public: false +If no channel of type X found, create it. Make sure to set the public key to false (this makes the channel private to the user). If something goes wrong during development/testing of a channel be sure to deactivate the channel https://developers.app.net/reference/resources/channel/lifecycle/#deactivate-a-channel This way it won't show up in the query for the channels anymore. @@ -55,9 +110,14 @@ If something goes wrong during development/testing of a channel be sure to deact ## Maintainers * [Steven van Loef](http://www.yellowdice.com/) ([@ludolphus](https://app.net/ludolphus)) +## Contributors +* [@33mhz](https://app.net/33mhz) +* [@matigo](https://app.net/matigo) + ## Used by * [Chimp](http://chimp.li/chimp) +* [Broadsword](http://broadsword.io/) ## Related entries