summaryrefslogtreecommitdiffstats
path: root/webapp/client/client.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-04-27 16:02:58 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-04-27 16:02:58 -0400
commitfa807d8e436e87b8c1749ea54c293a15c67f7f29 (patch)
tree9557bb5342425dffd3606cb03f1378de5f5cc032 /webapp/client/client.jsx
parentd962e175f838817f4db060227cf8b5e2258b887c (diff)
downloadchat-fa807d8e436e87b8c1749ea54c293a15c67f7f29.tar.gz
chat-fa807d8e436e87b8c1749ea54c293a15c67f7f29.tar.bz2
chat-fa807d8e436e87b8c1749ea54c293a15c67f7f29.zip
Fixing permalinks to channels your not a memeber of (#2805)
Diffstat (limited to 'webapp/client/client.jsx')
-rw-r--r--webapp/client/client.jsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index 98e660227..53a514082 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -71,6 +71,10 @@ export default class Client {
return `${this.url}${this.urlVersion}/teams/${this.getTeamId()}/channels`;
}
+ getChannelNameRoute(channelName) {
+ return `${this.url}${this.urlVersion}/teams/${this.getTeamId()}/channels/name/${channelName}`;
+ }
+
getChannelNeededRoute(channelId) {
return `${this.url}${this.urlVersion}/teams/${this.getTeamId()}/channels/${channelId}`;
}
@@ -1042,6 +1046,17 @@ export default class Client {
this.track('api', 'api_channels_join');
}
+ joinChannelByName = (name, success, error) => {
+ request.
+ post(`${this.getChannelNameRoute(name)}/join`).
+ set(this.defaultHeaders).
+ type('application/json').
+ accept('application/json').
+ end(this.handleResponse.bind(this, 'joinChannelByName', success, error));
+
+ this.track('api', 'api_channels_join_name');
+ }
+
deleteChannel = (channelId, success, error) => {
request.
post(`${this.getChannelNeededRoute(channelId)}/delete`).
@@ -1212,6 +1227,17 @@ export default class Client {
this.track('api', 'api_posts_create', post.channel_id, 'length', post.message.length);
}
+ // This is a temporary route to get around a problem with the permissions system that
+ // will be fixed in 3.1 or 3.2
+ getPermalinkTmp = (postId, success, error) => {
+ request.
+ get(`${this.getTeamNeededRoute()}/pltmp/${postId}`).
+ set(this.defaultHeaders).
+ type('application/json').
+ accept('application/json').
+ end(this.handleResponse.bind(this, 'getPermalinkTmp', success, error));
+ }
+
getPostById = (postId, success, error) => {
request.
get(`${this.getTeamNeededRoute()}/posts/${postId}`).