How to use the tinode-sdk.DEL_CHAR function in tinode-sdk

To help you get started, we’ve selected a few tinode-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinode / webapp / src / views / tinode-web.jsx View on Github external
handleTopicUpdateRequest(topicName, pub, priv, permissions) {
    const topic = this.tinode.getTopic(topicName);
    if (topic) {
      const params = {};
      if (pub) {
        params.public = pub;
      }
      if (priv) {
        params.private = (priv === Tinode.DEL_CHAR) ?
          Tinode.DEL_CHAR : {comment: priv};
      }
      if (permissions) {
        params.defacs = permissions;
      }
      topic.setMeta({desc: params}).catch((err) => {
        this.handleError(err.message, 'err');
      });
    }
  }
github tinode / webapp / src / widgets / search-contacts.jsx View on Github external
handleClear(e) {
    e.preventDefault();
    if (this.state.edited) {
      this.props.onSearchContacts(Tinode.DEL_CHAR);
    }
    this.setState({search: '', edited: false});
  }
github tinode / webapp / src / views / info-view.jsx View on Github external
handlePrivateUpdate(comment) {
    comment = comment.trim().substring(0, MAX_TITLE_LENGTH);
    if (this.state.private !== comment) {
      this.setState({private: comment});
      this.props.onTopicDescUpdate(this.props.topic, null, comment || Tinode.DEL_CHAR);
    }
  }
github tinode / webapp / src / views / edit-account-view.jsx View on Github external
handleImageChanged(img) {
    this.setState({avatar: img});
    this.props.onUpdateAccount(undefined, vcard(null, img || Tinode.DEL_CHAR));
  }
github tinode / webapp / src / views / tinode-web.jsx View on Github external
handleTopicUpdateRequest(topicName, pub, priv, permissions) {
    const topic = this.tinode.getTopic(topicName);
    if (topic) {
      const params = {};
      if (pub) {
        params.public = pub;
      }
      if (priv) {
        params.private = (priv === Tinode.DEL_CHAR) ?
          Tinode.DEL_CHAR : {comment: priv};
      }
      if (permissions) {
        params.defacs = permissions;
      }
      topic.setMeta({desc: params}).catch((err) => {
        this.handleError(err.message, 'err');
      });
    }
  }