summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-08-14 17:12:02 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-08-18 08:33:12 -0700
commit2b80620cee554560ef5f6eb078c2c5f5d0532326 (patch)
tree4e45820127fc31d77d809021d4e26f127661aef8 /web/react/utils
parentfda8b01297e2d932ef0b90981341bd61efc89fbf (diff)
downloadchat-2b80620cee554560ef5f6eb078c2c5f5d0532326.tar.gz
chat-2b80620cee554560ef5f6eb078c2c5f5d0532326.tar.bz2
chat-2b80620cee554560ef5f6eb078c2c5f5d0532326.zip
Private message channels no longer refresh on creation/first use
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/client.jsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index ce044457a..1b9ad942e 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -438,6 +438,23 @@ module.exports.createChannel = function(channel, success, error) {
module.exports.track('api', 'api_channels_create', channel.type, 'name', channel.name);
};
+module.exports.createPMChannelIfNotExists = function(channel, userId, success, error) {
+ $.ajax({
+ url: '/api/v1/channels/create_direct',
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify({user_id: userId}),
+ success: success,
+ error: function(xhr, status, err) {
+ var e = handleError('createPMIfNotExists', xhr, status, err);
+ error(e);
+ }
+ });
+
+ module.exports.track('api', 'api_channels_create_direct', channel.type, 'name', channel.name);
+};
+
module.exports.updateChannel = function(channel, success, error) {
$.ajax({
url: "/api/v1/channels/update",