Beispiel #1
0
 .catch(() => this.kms.fetchKey({uri, onBehalfOf})
   .then(tap((key) => this.unboundedStorage.put(storageKey, JSON.stringify(key, replacer)))));
        return Promise.resolve(user ? this.spark.internal.user.asUUID(user) : null)
          .then((userId) => {
            if (userId) {
              Object.assign(params, {
                service: `conversation`,
                resource: `conversations/user/${userId}`
              });
            }
            else {
              params.uri = url;
            }
            return this.request(params);
          });
      })
      .then(tap((res) => this._recordUUIDs(res.body)))
      .then((res) => res.body);
  },

  /**
   * Leaves the conversation or removes the specified user from the specified
   * conversation
   * @param {Object} conversation
   * @param {Object|string} participant If not specified, defaults to current
   * user
   * @param {Object} activity Reference to the activity that will eventually be
   * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
   * provisional activity
   * @returns {Promise<Activity>}
   */
  leave(conversation, participant, activity) {