audio messages are correctly formed and sent
This commit is contained in:
@@ -44,7 +44,7 @@ More translations are welcome. See [instructions](https://github.com/tinode/chat
|
|||||||
|
|
||||||
## Not done yet
|
## Not done yet
|
||||||
|
|
||||||
* Voice or video messages, video or audio calling.
|
* Video or audio calling.
|
||||||
* End-to-End encryption.
|
* End-to-End encryption.
|
||||||
* Emoji support is weak.
|
* Emoji support is weak.
|
||||||
* Mentions, hashtags.
|
* Mentions, hashtags.
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export function fileToBase64(file) {
|
|||||||
export function blobToBase64(blob) {
|
export function blobToBase64(blob) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.onerror = (evt) => {
|
reader.onerror = _ => {
|
||||||
reject(reader.error);
|
reject(reader.error);
|
||||||
};
|
};
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// Odds and ends
|
// Odds and ends
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
// Make shortcut icon appear with a green dot + show unread count in title.
|
// Make shortcut icon appear with a green dot + show unread count in title.
|
||||||
export function updateFavicon(count) {
|
export function updateFavicon(count) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import { APP_NAME, LINK_CONTACT_US, LINK_PRIVACY_POLICY, LINK_TERMS_OF_SERVICE } from '../config.js';
|
import { APP_NAME, LINK_CONTACT_US, LINK_PRIVACY_POLICY, LINK_TERMS_OF_SERVICE } from '../config.js';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import AvatarUpload from '../widgets/avatar-upload.jsx';
|
import AvatarUpload from '../widgets/avatar-upload.jsx';
|
||||||
import BadgeList from '../widgets/badge-list.jsx';
|
import BadgeList from '../widgets/badge-list.jsx';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import { APP_NAME } from '../config.js';
|
import { APP_NAME } from '../config.js';
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Drafty, Tinode } from 'tinode-sdk';
|
||||||
const Drafty = Tinode.Drafty;
|
|
||||||
|
|
||||||
import ChatMessage from '../widgets/chat-message.jsx';
|
import ChatMessage from '../widgets/chat-message.jsx';
|
||||||
import ContactBadges from '../widgets/contact-badges.jsx';
|
import ContactBadges from '../widgets/contact-badges.jsx';
|
||||||
@@ -92,6 +91,7 @@ class MessagesView extends React.Component {
|
|||||||
this.retrySend = this.retrySend.bind(this);
|
this.retrySend = this.retrySend.bind(this);
|
||||||
this.sendImageAttachment = this.sendImageAttachment.bind(this);
|
this.sendImageAttachment = this.sendImageAttachment.bind(this);
|
||||||
this.sendFileAttachment = this.sendFileAttachment.bind(this);
|
this.sendFileAttachment = this.sendFileAttachment.bind(this);
|
||||||
|
this.sendAudioAttachment = this.sendAudioAttachment.bind(this);
|
||||||
this.sendKeyPress = this.sendKeyPress.bind(this);
|
this.sendKeyPress = this.sendKeyPress.bind(this);
|
||||||
this.subscribe = this.subscribe.bind(this);
|
this.subscribe = this.subscribe.bind(this);
|
||||||
this.handleScrollReference = this.handleScrollReference.bind(this);
|
this.handleScrollReference = this.handleScrollReference.bind(this);
|
||||||
@@ -189,7 +189,7 @@ class MessagesView extends React.Component {
|
|||||||
|
|
||||||
if (topic && ((this.state.topic != prevState.topic) || !prevProps.ready)) {
|
if (topic && ((this.state.topic != prevState.topic) || !prevProps.ready)) {
|
||||||
if (topic._new) {
|
if (topic._new) {
|
||||||
console.log('Fetching new topic description');
|
console.log('DEBUG: Fetching new topic description');
|
||||||
// topic.getMeta(topic.startMetaQuery().withDesc().build());
|
// topic.getMeta(topic.startMetaQuery().withDesc().build());
|
||||||
} else {
|
} else {
|
||||||
this.subscribe(topic);
|
this.subscribe(topic);
|
||||||
@@ -744,6 +744,10 @@ class MessagesView extends React.Component {
|
|||||||
if (file.size > maxInbandAttachmentSize) {
|
if (file.size > maxInbandAttachmentSize) {
|
||||||
// Too large to send inband - uploading out of band and sending as a link.
|
// Too large to send inband - uploading out of band and sending as a link.
|
||||||
const uploader = this.props.tinode.getLargeFileHelper();
|
const uploader = this.props.tinode.getLargeFileHelper();
|
||||||
|
if (!uploader) {
|
||||||
|
this.props.onError(this.props.intl.formatMessage(messages.cannot_initiate_upload));
|
||||||
|
return;
|
||||||
|
}
|
||||||
const uploadCompletionPromise = uploader.upload(file);
|
const uploadCompletionPromise = uploader.upload(file);
|
||||||
const msg = Drafty.attachFile(null, {
|
const msg = Drafty.attachFile(null, {
|
||||||
mime: file.type,
|
mime: file.type,
|
||||||
@@ -761,7 +765,7 @@ class MessagesView extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleAttachFile method is called when [Attach file] button is clicked.
|
// handleAttachFile method is called when [Attach file] button is clicked: launch attachment preview.
|
||||||
handleAttachFile(file) {
|
handleAttachFile(file) {
|
||||||
const maxExternAttachmentSize = this.props.tinode.getServerLimit('maxFileUploadSize', MAX_EXTERN_ATTACHMENT_SIZE);
|
const maxExternAttachmentSize = this.props.tinode.getServerLimit('maxFileUploadSize', MAX_EXTERN_ATTACHMENT_SIZE);
|
||||||
|
|
||||||
@@ -846,7 +850,7 @@ class MessagesView extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleAttachImage method is called when [Attach image] button is clicked.
|
// handleAttachImage method is called when [Attach image] button is clicked: launch image preview.
|
||||||
handleAttachImage(file) {
|
handleAttachImage(file) {
|
||||||
const maxExternAttachmentSize = this.props.tinode.getServerLimit('maxFileUploadSize', MAX_EXTERN_ATTACHMENT_SIZE);
|
const maxExternAttachmentSize = this.props.tinode.getServerLimit('maxFileUploadSize', MAX_EXTERN_ATTACHMENT_SIZE);
|
||||||
|
|
||||||
@@ -867,6 +871,41 @@ class MessagesView extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sendAudioAttachment sends audio bits inband as Drafty message (no preview).
|
||||||
|
sendAudioAttachment(url, duration) {
|
||||||
|
// Server-provided limit reduced for base64 encoding and overhead.
|
||||||
|
const maxInbandAttachmentSize = (this.props.tinode.getServerLimit(
|
||||||
|
'maxMessageSize', MAX_INBAND_ATTACHMENT_SIZE) * 0.75 - 1024) | 0;
|
||||||
|
fetch(url).then(result => {
|
||||||
|
return result.blob();
|
||||||
|
}).then(blob => {
|
||||||
|
if (blob.size > maxInbandAttachmentSize) {
|
||||||
|
// Too large to send inband - uploading out of band and sending as a link.
|
||||||
|
const uploader = this.props.tinode.getLargeFileHelper();
|
||||||
|
if (!uploader) {
|
||||||
|
this.props.onError(this.props.intl.formatMessage(messages.cannot_initiate_upload));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const uploadCompletionPromise = uploader.upload(blob);
|
||||||
|
const msg = Drafty.appendAudio(null, {
|
||||||
|
mime: blob.type,
|
||||||
|
size: blob.size,
|
||||||
|
duration: duration,
|
||||||
|
urlPromise: uploadCompletionPromise
|
||||||
|
});
|
||||||
|
// Pass data and the uploader to the TinodeWeb.
|
||||||
|
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
||||||
|
} else {
|
||||||
|
// Small enough to send inband.
|
||||||
|
blobToBase64(blob)
|
||||||
|
.then(b64 => {
|
||||||
|
this.sendMessage(Drafty.appendAudio(null, {mime: b64.mime, data: b64.bits, duration: duration}))
|
||||||
|
})
|
||||||
|
.catch(err => {this.props.onError(err)});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
handleCancelUpload(seq, uploader) {
|
handleCancelUpload(seq, uploader) {
|
||||||
const topic = this.props.tinode.getTopic(this.state.topic);
|
const topic = this.props.tinode.getTopic(this.state.topic);
|
||||||
const found = topic.findMessage(seq);
|
const found = topic.findMessage(seq);
|
||||||
@@ -1176,6 +1215,7 @@ class MessagesView extends React.Component {
|
|||||||
onSendMessage={this.sendMessage}
|
onSendMessage={this.sendMessage}
|
||||||
onAttachFile={this.props.forwardMessage ? null : this.handleAttachFile}
|
onAttachFile={this.props.forwardMessage ? null : this.handleAttachFile}
|
||||||
onAttachImage={this.props.forwardMessage ? null : this.handleAttachImage}
|
onAttachImage={this.props.forwardMessage ? null : this.handleAttachImage}
|
||||||
|
onAttachAudio={this.sendAudioAttachment}
|
||||||
onError={this.props.onError}
|
onError={this.props.onError}
|
||||||
reply={this.state.reply}
|
reply={this.state.reply}
|
||||||
onQuoteClick={this.handleQuoteClick}
|
onQuoteClick={this.handleQuoteClick}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import ContactList from '../widgets/contact-list.jsx';
|
import ContactList from '../widgets/contact-list.jsx';
|
||||||
import NewTopicById from '../widgets/new-topic-by-id.jsx';
|
import NewTopicById from '../widgets/new-topic-by-id.jsx';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { initializeApp as firebaseInitApp } from 'firebase/app';
|
|||||||
import { getMessaging as firebaseGetMessaging, getToken as firebaseGetToken,
|
import { getMessaging as firebaseGetMessaging, getToken as firebaseGetToken,
|
||||||
deleteToken as firebaseDelToken, onMessage as firebaseOnMessage } from 'firebase/messaging';
|
deleteToken as firebaseDelToken, onMessage as firebaseOnMessage } from 'firebase/messaging';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Drafty, Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import Alert from '../widgets/alert.jsx';
|
import Alert from '../widgets/alert.jsx';
|
||||||
import ContextMenu from '../widgets/context-menu.jsx';
|
import ContextMenu from '../widgets/context-menu.jsx';
|
||||||
@@ -987,7 +987,7 @@ class TinodeWeb extends React.Component {
|
|||||||
// If there are unsent messages, try sending them now.
|
// If there are unsent messages, try sending them now.
|
||||||
topic.queuedMessages((pub) => {
|
topic.queuedMessages((pub) => {
|
||||||
if (!pub._sending && topic.isSubscribed()) {
|
if (!pub._sending && topic.isSubscribed()) {
|
||||||
this.sendMessage(pub);
|
topic.publishMessage(pub);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1443,7 +1443,7 @@ class TinodeWeb extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Publish spam report.
|
// Publish spam report.
|
||||||
this.tinode.publish(Tinode.TOPIC_SYS, Tinode.Drafty.attachJSON(null, {
|
this.tinode.publish(Tinode.TOPIC_SYS, Drafty.attachJSON(null, {
|
||||||
'action': 'report',
|
'action': 'report',
|
||||||
'target': topicName
|
'target': topicName
|
||||||
}));
|
}));
|
||||||
@@ -1474,16 +1474,11 @@ class TinodeWeb extends React.Component {
|
|||||||
this.handleSidepanelCancel();
|
this.handleSidepanelCancel();
|
||||||
}
|
}
|
||||||
const header = '➦ ' + params.userName;
|
const header = '➦ ' + params.userName;
|
||||||
const content = typeof params.content == 'string' ?
|
const content = typeof params.content == 'string' ? Drafty.init(params.content) : Drafty.forwardedContent(params.content);
|
||||||
Tinode.Drafty.init(params.content) : Tinode.Drafty.forwardedContent(params.content);
|
const preview = Drafty.preview(content, FORWARDED_PREVIEW_LENGTH, undefined, params.forwarded != null);
|
||||||
const preview = Tinode.Drafty.preview(content, FORWARDED_PREVIEW_LENGTH,
|
const msg = Drafty.append(Drafty.appendLineBreak(Drafty.mention(header, params.userFrom)), content);
|
||||||
undefined, params.forwarded != null);
|
|
||||||
const msg = Tinode.Drafty.append(
|
|
||||||
Tinode.Drafty.appendLineBreak(
|
|
||||||
Tinode.Drafty.mention(header, params.userFrom)),
|
|
||||||
content);
|
|
||||||
|
|
||||||
const msgPreview = Tinode.Drafty.quote(header, params.userFrom, preview);
|
const msgPreview = Drafty.quote(header, params.userFrom, preview);
|
||||||
const head = {
|
const head = {
|
||||||
forwarded: params.topicName + ':' + params.seq
|
forwarded: params.topicName + ':' + params.seq
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
import { Drafty } from 'tinode-sdk';
|
import { Drafty, Tinode } from 'tinode-sdk';
|
||||||
import Tinode from 'tinode-sdk';
|
|
||||||
|
|
||||||
import Contact from './contact.jsx';
|
import Contact from './contact.jsx';
|
||||||
import ContactAction from './contact-action.jsx';
|
import ContactAction from './contact-action.jsx';
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ class ContextMenu extends React.Component {
|
|||||||
(() => {
|
(() => {
|
||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return topic.delTopic(true).catch((err) => {
|
return topic.delTopic(true).catch((err) => {
|
||||||
@@ -258,7 +258,7 @@ class ContextMenu extends React.Component {
|
|||||||
handler: (params, errorHandler) => {
|
handler: (params, errorHandler) => {
|
||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return topic.archive(true).catch((err) => {
|
return topic.archive(true).catch((err) => {
|
||||||
@@ -274,7 +274,7 @@ class ContextMenu extends React.Component {
|
|||||||
handler: (params, errorHandler) => {
|
handler: (params, errorHandler) => {
|
||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return topic.archive(false).catch((err) => {
|
return topic.archive(false).catch((err) => {
|
||||||
@@ -296,7 +296,7 @@ class ContextMenu extends React.Component {
|
|||||||
handler: (params, errorHandler) => {
|
handler: (params, errorHandler) => {
|
||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
if (!topic || !params.user) {
|
if (!topic || !params.user) {
|
||||||
console.log("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
|
console.warn("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return topic.delSubscription(params.user).catch((err) => {
|
return topic.delSubscription(params.user).catch((err) => {
|
||||||
@@ -378,7 +378,7 @@ class ContextMenu extends React.Component {
|
|||||||
deleteMessages(all, hard, params, errorHandler) {
|
deleteMessages(all, hard, params, errorHandler) {
|
||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ class ContextMenu extends React.Component {
|
|||||||
topicPermissionSetter(mode, params, errorHandler) {
|
topicPermissionSetter(mode, params, errorHandler) {
|
||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found", params.topicName);
|
console.warn("Topic not found", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import ContactList from './contact-list.jsx';
|
import ContactList from './contact-list.jsx';
|
||||||
import SearchContacts from './search-contacts.jsx';
|
import SearchContacts from './search-contacts.jsx';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import { idToColorClass } from '../lib/strformat.js';
|
import { idToColorClass } from '../lib/strformat.js';
|
||||||
import { sanitizeImageUrl } from '../lib/utils.js';
|
import { sanitizeImageUrl } from '../lib/utils.js';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import { deliveryMarker } from '../lib/utils.js';
|
import { deliveryMarker } from '../lib/utils.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
export default class SearchContacts extends React.PureComponent {
|
export default class SearchContacts extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|||||||
@@ -132,8 +132,7 @@ class SendMessage extends React.PureComponent {
|
|||||||
|
|
||||||
handleAttachAudio(url, duration) {
|
handleAttachAudio(url, duration) {
|
||||||
this.setState({audioRec: false});
|
this.setState({audioRec: false});
|
||||||
console.log("this.props.onAttachAudio", url, duration);
|
this.props.onAttachAudio(url, duration);
|
||||||
// this.props.onAttachAudio(url, duration);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSend(e) {
|
handleSend(e) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import Tinode from 'tinode-sdk';
|
import { Tinode } from 'tinode-sdk';
|
||||||
|
|
||||||
import AvatarCrop from './avatar-crop.jsx';
|
import AvatarCrop from './avatar-crop.jsx';
|
||||||
import AvatarUpload from './avatar-upload.jsx';
|
import AvatarUpload from './avatar-upload.jsx';
|
||||||
|
|||||||
+114
-74
@@ -2266,7 +2266,7 @@ function blobToBase64(blob) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
|
|
||||||
reader.onerror = evt => {
|
reader.onerror = _ => {
|
||||||
reject(reader.error);
|
reject(reader.error);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3162,7 +3162,7 @@ function theCard(fn, imageUrl, imageMimeType, note) {
|
|||||||
|
|
||||||
if (typeof note == 'string') {
|
if (typeof note == 'string') {
|
||||||
card = card || {};
|
card = card || {};
|
||||||
card.note = note ? note : (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().DEL_CHAR);
|
card.note = note ? note : tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.DEL_CHAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imageUrl) {
|
if (imageUrl) {
|
||||||
@@ -3174,11 +3174,11 @@ function theCard(fn, imageUrl, imageMimeType, note) {
|
|||||||
mimeType = matches[1];
|
mimeType = matches[1];
|
||||||
card.photo = {
|
card.photo = {
|
||||||
data: imageUrl.substring(imageUrl.indexOf(',') + 1),
|
data: imageUrl.substring(imageUrl.indexOf(',') + 1),
|
||||||
ref: (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().DEL_CHAR)
|
ref: tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.DEL_CHAR
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
card.photo = {
|
card.photo = {
|
||||||
data: (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().DEL_CHAR),
|
data: tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.DEL_CHAR,
|
||||||
ref: imageUrl
|
ref: imageUrl
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -3276,28 +3276,28 @@ function sanitizeImageUrl(url) {
|
|||||||
}
|
}
|
||||||
function deliveryMarker(received) {
|
function deliveryMarker(received) {
|
||||||
switch (received) {
|
switch (received) {
|
||||||
case (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().MESSAGE_STATUS_SENDING):
|
case tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.MESSAGE_STATUS_SENDING:
|
||||||
return {
|
return {
|
||||||
name: 'access_time'
|
name: 'access_time'
|
||||||
};
|
};
|
||||||
|
|
||||||
case (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().MESSAGE_STATUS_FAILED):
|
case tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.MESSAGE_STATUS_FAILED:
|
||||||
return {
|
return {
|
||||||
name: 'warning',
|
name: 'warning',
|
||||||
color: 'danger-color'
|
color: 'danger-color'
|
||||||
};
|
};
|
||||||
|
|
||||||
case (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().MESSAGE_STATUS_SENT):
|
case tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.MESSAGE_STATUS_SENT:
|
||||||
return {
|
return {
|
||||||
name: 'done'
|
name: 'done'
|
||||||
};
|
};
|
||||||
|
|
||||||
case (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().MESSAGE_STATUS_RECEIVED):
|
case tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.MESSAGE_STATUS_RECEIVED:
|
||||||
return {
|
return {
|
||||||
name: 'done_all'
|
name: 'done_all'
|
||||||
};
|
};
|
||||||
|
|
||||||
case (tinode_sdk__WEBPACK_IMPORTED_MODULE_0___default().MESSAGE_STATUS_READ):
|
case tinode_sdk__WEBPACK_IMPORTED_MODULE_0__.Tinode.MESSAGE_STATUS_READ:
|
||||||
return {
|
return {
|
||||||
name: 'done_all',
|
name: 'done_all',
|
||||||
color: 'blue'
|
color: 'blue'
|
||||||
@@ -3750,7 +3750,7 @@ class AccSupportView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
|||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "SDK:"
|
"value": "SDK:"
|
||||||
}]
|
}]
|
||||||
})), tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().getLibrary()), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
})), tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.getLibrary()), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||||
className: "panel-form-row"
|
className: "panel-form-row"
|
||||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
|
||||||
className: "small"
|
className: "small"
|
||||||
@@ -4600,7 +4600,7 @@ class InfoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
this.setState({
|
this.setState({
|
||||||
avatar: img
|
avatar: img
|
||||||
});
|
});
|
||||||
this.props.onTopicDescUpdate(this.props.topic, (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_15__.theCard)(null, img || (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().DEL_CHAR)), null);
|
this.props.onTopicDescUpdate(this.props.topic, (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_15__.theCard)(null, img || tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.DEL_CHAR), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleMuted(ignored, checked) {
|
handleMuted(ignored, checked) {
|
||||||
@@ -4663,7 +4663,7 @@ class InfoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
if (this.state.owner) {
|
if (this.state.owner) {
|
||||||
toSkip = 'O';
|
toSkip = 'O';
|
||||||
} else {
|
} else {
|
||||||
toSkip = tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().AccessMode.encode(tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().AccessMode.diff('ASDO', this.state.modeGiven));
|
toSkip = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.AccessMode.encode(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.AccessMode.diff('ASDO', this.state.modeGiven));
|
||||||
|
|
||||||
if (this.state.channel) {
|
if (this.state.channel) {
|
||||||
toSkip += 'W';
|
toSkip += 'W';
|
||||||
@@ -5234,7 +5234,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
|
|
||||||
class LogoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
|
class LogoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComponent) {
|
||||||
render() {
|
render() {
|
||||||
const version = _config_js__WEBPACK_IMPORTED_MODULE_3__.APP_NAME + ' (' + tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().getLibrary() + ')';
|
const version = _config_js__WEBPACK_IMPORTED_MODULE_3__.APP_NAME + ' (' + tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.getLibrary() + ')';
|
||||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||||
id: "dummy-view"
|
id: "dummy-view"
|
||||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
|
||||||
@@ -5299,7 +5299,6 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const Drafty = (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().Drafty);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -5402,6 +5401,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
this.retrySend = this.retrySend.bind(this);
|
this.retrySend = this.retrySend.bind(this);
|
||||||
this.sendImageAttachment = this.sendImageAttachment.bind(this);
|
this.sendImageAttachment = this.sendImageAttachment.bind(this);
|
||||||
this.sendFileAttachment = this.sendFileAttachment.bind(this);
|
this.sendFileAttachment = this.sendFileAttachment.bind(this);
|
||||||
|
this.sendAudioAttachment = this.sendAudioAttachment.bind(this);
|
||||||
this.sendKeyPress = this.sendKeyPress.bind(this);
|
this.sendKeyPress = this.sendKeyPress.bind(this);
|
||||||
this.subscribe = this.subscribe.bind(this);
|
this.subscribe = this.subscribe.bind(this);
|
||||||
this.handleScrollReference = this.handleScrollReference.bind(this);
|
this.handleScrollReference = this.handleScrollReference.bind(this);
|
||||||
@@ -5467,7 +5467,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
const topic = this.props.tinode ? this.props.tinode.getTopic(this.state.topic) : undefined;
|
const topic = this.props.tinode ? this.props.tinode.getTopic(this.state.topic) : undefined;
|
||||||
|
|
||||||
if (this.state.topic != prevState.topic) {
|
if (this.state.topic != prevState.topic) {
|
||||||
if (prevState.topic && !tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().isNewGroupTopicName(prevState.topic)) {
|
if (prevState.topic && !tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isNewGroupTopicName(prevState.topic)) {
|
||||||
this.leave(prevState.topic);
|
this.leave(prevState.topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5489,7 +5489,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
|
|
||||||
if (topic && (this.state.topic != prevState.topic || !prevProps.ready)) {
|
if (topic && (this.state.topic != prevState.topic || !prevProps.ready)) {
|
||||||
if (topic._new) {
|
if (topic._new) {
|
||||||
console.log('Fetching new topic description');
|
console.log('DEBUG: Fetching new topic description');
|
||||||
} else {
|
} else {
|
||||||
this.subscribe(topic);
|
this.subscribe(topic);
|
||||||
}
|
}
|
||||||
@@ -5904,7 +5904,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
|
|
||||||
const status = topic.msgStatus(msg, true);
|
const status = topic.msgStatus(msg, true);
|
||||||
|
|
||||||
if (status >= (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().MESSAGE_STATUS_SENT) && msg.from != this.props.myUserId) {
|
if (status >= tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.MESSAGE_STATUS_SENT && msg.from != this.props.myUserId) {
|
||||||
this.postReadNotification(msg.seq);
|
this.postReadNotification(msg.seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5971,7 +5971,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
|
|
||||||
handleFormResponse(action, text, data) {
|
handleFormResponse(action, text, data) {
|
||||||
if (action == 'pub') {
|
if (action == 'pub') {
|
||||||
this.sendMessage(Drafty.attachJSON(Drafty.parse(text), data));
|
this.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.attachJSON(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.parse(text), data));
|
||||||
} else if (action == 'url') {
|
} else if (action == 'url') {
|
||||||
const url = new URL(data.ref);
|
const url = new URL(data.ref);
|
||||||
const params = url.searchParams;
|
const params = url.searchParams;
|
||||||
@@ -6061,10 +6061,10 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (typeof msg == 'string') {
|
if (typeof msg == 'string') {
|
||||||
msg = Drafty.parse(msg);
|
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.parse(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = Drafty.append(Drafty.sanitizeEntities(this.state.reply.content), msg);
|
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.append(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.sanitizeEntities(this.state.reply.content), msg);
|
||||||
this.handleCancelReply();
|
this.handleCancelReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6080,8 +6080,14 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
|
|
||||||
if (file.size > maxInbandAttachmentSize) {
|
if (file.size > maxInbandAttachmentSize) {
|
||||||
const uploader = this.props.tinode.getLargeFileHelper();
|
const uploader = this.props.tinode.getLargeFileHelper();
|
||||||
|
|
||||||
|
if (!uploader) {
|
||||||
|
this.props.onError(this.props.intl.formatMessage(messages.cannot_initiate_upload));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const uploadCompletionPromise = uploader.upload(file);
|
const uploadCompletionPromise = uploader.upload(file);
|
||||||
const msg = Drafty.attachFile(null, {
|
const msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.attachFile(null, {
|
||||||
mime: file.type,
|
mime: file.type,
|
||||||
filename: file.name,
|
filename: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
@@ -6089,7 +6095,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
});
|
});
|
||||||
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
||||||
} else {
|
} else {
|
||||||
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.fileToBase64)(file).then(b64 => this.sendMessage(Drafty.attachFile(null, {
|
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.fileToBase64)(file).then(b64 => this.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.attachFile(null, {
|
||||||
mime: b64.mime,
|
mime: b64.mime,
|
||||||
data: b64.bits,
|
data: b64.bits,
|
||||||
filename: b64.name
|
filename: b64.name
|
||||||
@@ -6134,7 +6140,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
|
|
||||||
const uploadCompletionPromise = uploader.upload(blob);
|
const uploadCompletionPromise = uploader.upload(blob);
|
||||||
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.imageScaled)(blob, _config_js__WEBPACK_IMPORTED_MODULE_15__.IMAGE_PREVIEW_DIM, _config_js__WEBPACK_IMPORTED_MODULE_15__.IMAGE_PREVIEW_DIM, -1, false).then(scaled => (0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.blobToBase64)(scaled.blob)).then(b64 => {
|
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.imageScaled)(blob, _config_js__WEBPACK_IMPORTED_MODULE_15__.IMAGE_PREVIEW_DIM, _config_js__WEBPACK_IMPORTED_MODULE_15__.IMAGE_PREVIEW_DIM, -1, false).then(scaled => (0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.blobToBase64)(scaled.blob)).then(b64 => {
|
||||||
let msg = Drafty.insertImage(null, 0, {
|
let msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.insertImage(null, 0, {
|
||||||
mime: mime,
|
mime: mime,
|
||||||
_tempPreview: b64.bits,
|
_tempPreview: b64.bits,
|
||||||
width: width,
|
width: width,
|
||||||
@@ -6145,8 +6151,8 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (caption) {
|
if (caption) {
|
||||||
msg = Drafty.appendLineBreak(msg);
|
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.appendLineBreak(msg);
|
||||||
msg = Drafty.append(msg, Drafty.parse(caption));
|
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.append(msg, tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.parse(caption));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
||||||
@@ -6157,7 +6163,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
}
|
}
|
||||||
|
|
||||||
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.blobToBase64)(blob).then(b64 => {
|
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.blobToBase64)(blob).then(b64 => {
|
||||||
let msg = Drafty.insertImage(null, 0, {
|
let msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.insertImage(null, 0, {
|
||||||
mime: b64.mime,
|
mime: b64.mime,
|
||||||
preview: b64.bits,
|
preview: b64.bits,
|
||||||
width: width,
|
width: width,
|
||||||
@@ -6167,8 +6173,8 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (caption) {
|
if (caption) {
|
||||||
msg = Drafty.appendLineBreak(msg);
|
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.appendLineBreak(msg);
|
||||||
msg = Drafty.append(msg, Drafty.parse(caption));
|
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.append(msg, tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.parse(caption));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendMessage(msg);
|
this.sendMessage(msg);
|
||||||
@@ -6194,6 +6200,41 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendAudioAttachment(url, duration) {
|
||||||
|
const maxInbandAttachmentSize = this.props.tinode.getServerLimit('maxMessageSize', _config_js__WEBPACK_IMPORTED_MODULE_15__.MAX_INBAND_ATTACHMENT_SIZE) * 0.75 - 1024 | 0;
|
||||||
|
fetch(url).then(result => {
|
||||||
|
return result.blob();
|
||||||
|
}).then(blob => {
|
||||||
|
if (blob.size > maxInbandAttachmentSize) {
|
||||||
|
const uploader = this.props.tinode.getLargeFileHelper();
|
||||||
|
|
||||||
|
if (!uploader) {
|
||||||
|
this.props.onError(this.props.intl.formatMessage(messages.cannot_initiate_upload));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadCompletionPromise = uploader.upload(blob);
|
||||||
|
const msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.appendAudio(null, {
|
||||||
|
mime: blob.type,
|
||||||
|
size: blob.size,
|
||||||
|
duration: duration,
|
||||||
|
urlPromise: uploadCompletionPromise
|
||||||
|
});
|
||||||
|
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
||||||
|
} else {
|
||||||
|
(0,_lib_blob_helpers_js__WEBPACK_IMPORTED_MODULE_16__.blobToBase64)(blob).then(b64 => {
|
||||||
|
this.sendMessage(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.appendAudio(null, {
|
||||||
|
mime: b64.mime,
|
||||||
|
data: b64.bits,
|
||||||
|
duration: duration
|
||||||
|
}));
|
||||||
|
}).catch(err => {
|
||||||
|
this.props.onError(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
handleCancelUpload(seq, uploader) {
|
handleCancelUpload(seq, uploader) {
|
||||||
const topic = this.props.tinode.getTopic(this.state.topic);
|
const topic = this.props.tinode.getTopic(this.state.topic);
|
||||||
const found = topic.findMessage(seq);
|
const found = topic.findMessage(seq);
|
||||||
@@ -6214,17 +6255,17 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
content = typeof content == 'string' ? Drafty.init(content) : content;
|
content = typeof content == 'string' ? tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.init(content) : content;
|
||||||
|
|
||||||
if (Drafty.isValid(content)) {
|
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.isValid(content)) {
|
||||||
content = Drafty.replyContent(content, _config_js__WEBPACK_IMPORTED_MODULE_15__.QUOTED_REPLY_LENGTH);
|
content = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.replyContent(content, _config_js__WEBPACK_IMPORTED_MODULE_15__.QUOTED_REPLY_LENGTH);
|
||||||
} else {
|
} else {
|
||||||
content = Drafty.append(Drafty.init('\u26A0 '), Drafty.wrapInto(this.props.intl.formatMessage(messages.invalid_content), 'EM'));
|
content = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.append(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.init('\u26A0 '), tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.wrapInto(this.props.intl.formatMessage(messages.invalid_content), 'EM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
reply: {
|
reply: {
|
||||||
content: Drafty.quote(senderName, senderId, content),
|
content: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.quote(senderName, senderId, content),
|
||||||
seq: seq
|
seq: seq
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -6414,7 +6455,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
} else {
|
} else {
|
||||||
const cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
|
const cont = this.props.tinode.getMeTopic().getContact(this.state.topic);
|
||||||
|
|
||||||
if (cont && tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().isP2PTopicName(cont.topic)) {
|
if (cont && tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isP2PTopicName(cont.topic)) {
|
||||||
if (cont.online) {
|
if (cont.online) {
|
||||||
lastSeen = formatMessage(messages.online_now);
|
lastSeen = formatMessage(messages.online_now);
|
||||||
} else if (cont.seen) {
|
} else if (cont.seen) {
|
||||||
@@ -6531,6 +6572,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
onSendMessage: this.sendMessage,
|
onSendMessage: this.sendMessage,
|
||||||
onAttachFile: this.props.forwardMessage ? null : this.handleAttachFile,
|
onAttachFile: this.props.forwardMessage ? null : this.handleAttachFile,
|
||||||
onAttachImage: this.props.forwardMessage ? null : this.handleAttachImage,
|
onAttachImage: this.props.forwardMessage ? null : this.handleAttachImage,
|
||||||
|
onAttachAudio: this.sendAudioAttachment,
|
||||||
onError: this.props.onError,
|
onError: this.props.onError,
|
||||||
reply: this.state.reply,
|
reply: this.state.reply,
|
||||||
onQuoteClick: this.handleQuoteClick,
|
onQuoteClick: this.handleQuoteClick,
|
||||||
@@ -6638,7 +6680,7 @@ class NewTopicView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
handleSearchContacts(query) {
|
handleSearchContacts(query) {
|
||||||
this.props.onSearchContacts(query);
|
this.props.onSearchContacts(query);
|
||||||
this.setState({
|
this.setState({
|
||||||
searchQuery: tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().isNullValue(query) ? null : query
|
searchQuery: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isNullValue(query) ? null : query
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7638,7 +7680,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static tnSetup(serverAddress, transport, locale, persistentCache, onSetupCompleted) {
|
static tnSetup(serverAddress, transport, locale, persistentCache, onSetupCompleted) {
|
||||||
const tinode = new (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default())({
|
const tinode = new tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode({
|
||||||
appName: _config_js__WEBPACK_IMPORTED_MODULE_11__.APP_NAME,
|
appName: _config_js__WEBPACK_IMPORTED_MODULE_11__.APP_NAME,
|
||||||
host: serverAddress,
|
host: serverAddress,
|
||||||
apiKey: _config_js__WEBPACK_IMPORTED_MODULE_11__.API_KEY,
|
apiKey: _config_js__WEBPACK_IMPORTED_MODULE_11__.API_KEY,
|
||||||
@@ -7656,7 +7698,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
|
|
||||||
switch (data.what) {
|
switch (data.what) {
|
||||||
case 'msg':
|
case 'msg':
|
||||||
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().isChannelTopicName(data.topic)) {
|
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.isChannelTopicName(data.topic)) {
|
||||||
this.tinode.oobNotification('msg', data.topic, data.seq, 'fake-uid');
|
this.tinode.oobNotification('msg', data.topic, data.seq, 'fake-uid');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7819,7 +7861,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
let topicName = hash.path[1] || null;
|
let topicName = hash.path[1] || null;
|
||||||
|
|
||||||
if (topicName != this.state.topicSelected) {
|
if (topicName != this.state.topicSelected) {
|
||||||
if (!tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().topicType(topicName)) {
|
if (!tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.topicType(topicName)) {
|
||||||
topicName = null;
|
topicName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7997,7 +8039,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cred = tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().credential(cred);
|
cred = tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.credential(cred);
|
||||||
let promise = null;
|
let promise = null;
|
||||||
let token = this.tinode.getAuthToken();
|
let token = this.tinode.getAuthToken();
|
||||||
|
|
||||||
@@ -8174,7 +8216,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
const merged = {};
|
const merged = {};
|
||||||
|
|
||||||
for (const c of chatList) {
|
for (const c of chatList) {
|
||||||
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().isP2PTopicName(c.topic)) {
|
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.isP2PTopicName(c.topic)) {
|
||||||
merged[c.topic] = {
|
merged[c.topic] = {
|
||||||
user: c.topic,
|
user: c.topic,
|
||||||
updated: c.updated,
|
updated: c.updated,
|
||||||
@@ -8226,7 +8268,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
tnData(data) {
|
tnData(data) {
|
||||||
const topic = this.tinode.getTopic(data.topic);
|
const topic = this.tinode.getTopic(data.topic);
|
||||||
|
|
||||||
if (topic.msgStatus(data, true) >= (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().MESSAGE_STATUS_SENT) && data.from != this.state.myUserId) {
|
if (topic.msgStatus(data, true) >= tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.MESSAGE_STATUS_SENT && data.from != this.state.myUserId) {
|
||||||
clearTimeout(this.receivedTimer);
|
clearTimeout(this.receivedTimer);
|
||||||
this.receivedTimer = setTimeout(() => {
|
this.receivedTimer = setTimeout(() => {
|
||||||
this.receivedTimer = undefined;
|
this.receivedTimer = undefined;
|
||||||
@@ -8337,7 +8379,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
promise = promise.then(() => topic.subscribe()).then(() => {
|
promise = promise.then(() => topic.subscribe()).then(() => {
|
||||||
topic.queuedMessages(pub => {
|
topic.queuedMessages(pub => {
|
||||||
if (!pub._sending && topic.isSubscribed()) {
|
if (!pub._sending && topic.isSubscribed()) {
|
||||||
this.sendMessage(pub);
|
topic.publishMessage(pub);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -8421,7 +8463,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
return this.tinode.createAccountBasic(login_, password_, {
|
return this.tinode.createAccountBasic(login_, password_, {
|
||||||
public: public_,
|
public: public_,
|
||||||
tags: tags_,
|
tags: tags_,
|
||||||
cred: tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().credential(cred_)
|
cred: tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.credential(cred_)
|
||||||
});
|
});
|
||||||
}).then(ctrl => {
|
}).then(ctrl => {
|
||||||
if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {
|
if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {
|
||||||
@@ -8623,7 +8665,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
|
|
||||||
const params = {};
|
const params = {};
|
||||||
|
|
||||||
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().isP2PTopicName(topicName)) {
|
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.isP2PTopicName(topicName)) {
|
||||||
params.sub = {
|
params.sub = {
|
||||||
mode: _config_js__WEBPACK_IMPORTED_MODULE_11__.DEFAULT_P2P_ACCESS_MODE
|
mode: _config_js__WEBPACK_IMPORTED_MODULE_11__.DEFAULT_P2P_ACCESS_MODE
|
||||||
};
|
};
|
||||||
@@ -8674,10 +8716,10 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
|
|
||||||
if (pub) {
|
if (pub) {
|
||||||
if (pub.photo) {
|
if (pub.photo) {
|
||||||
if (pub.photo.ref && pub.photo.ref != (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().DEL_CHAR)) {
|
if (pub.photo.ref && pub.photo.ref != tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.DEL_CHAR) {
|
||||||
attachments = [pub.photo.ref];
|
attachments = [pub.photo.ref];
|
||||||
} else if (!pub.photo.data || pub.photo.data == (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().DEL_CHAR)) {
|
} else if (!pub.photo.data || pub.photo.data == tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.DEL_CHAR) {
|
||||||
pub.photo = (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().DEL_CHAR);
|
pub.photo = tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.DEL_CHAR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8685,7 +8727,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof priv == 'string') {
|
if (typeof priv == 'string') {
|
||||||
params.private = priv === (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().DEL_CHAR) ? (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().DEL_CHAR) : {
|
params.private = priv === tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.DEL_CHAR ? tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.DEL_CHAR : {
|
||||||
comment: priv
|
comment: priv
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -8857,7 +8899,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tinode.publish((tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().TOPIC_SYS), tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.attachJSON(null, {
|
this.tinode.publish(tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.TOPIC_SYS, tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.attachJSON(null, {
|
||||||
'action': 'report',
|
'action': 'report',
|
||||||
'target': topicName
|
'target': topicName
|
||||||
}));
|
}));
|
||||||
@@ -8887,10 +8929,10 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const header = '➦ ' + params.userName;
|
const header = '➦ ' + params.userName;
|
||||||
const content = typeof params.content == 'string' ? tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.init(params.content) : tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.forwardedContent(params.content);
|
const content = typeof params.content == 'string' ? tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.init(params.content) : tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.forwardedContent(params.content);
|
||||||
const preview = tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.preview(content, _config_js__WEBPACK_IMPORTED_MODULE_11__.FORWARDED_PREVIEW_LENGTH, undefined, params.forwarded != null);
|
const preview = tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.preview(content, _config_js__WEBPACK_IMPORTED_MODULE_11__.FORWARDED_PREVIEW_LENGTH, undefined, params.forwarded != null);
|
||||||
const msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.append(tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.appendLineBreak(tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.mention(header, params.userFrom)), content);
|
const msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.append(tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.appendLineBreak(tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.mention(header, params.userFrom)), content);
|
||||||
const msgPreview = tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().Drafty.quote(header, params.userFrom, preview);
|
const msgPreview = tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Drafty.quote(header, params.userFrom, preview);
|
||||||
const head = {
|
const head = {
|
||||||
forwarded: params.topicName + ':' + params.seq
|
forwarded: params.topicName + ':' + params.seq
|
||||||
};
|
};
|
||||||
@@ -9797,9 +9839,8 @@ class AudioRecorder extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanUp() {
|
cleanUp() {
|
||||||
this.stream.getTracks().forEach(track => track.stop());
|
|
||||||
this.audioInput.disconnect();
|
this.audioInput.disconnect();
|
||||||
this.audioContext.close();
|
this.stream.getTracks().forEach(track => track.stop());
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -10758,7 +10799,6 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
const messages = (0,react_intl__WEBPACK_IMPORTED_MODULE_1__.defineMessages)({
|
||||||
badge_you: {
|
badge_you: {
|
||||||
id: "badge_you",
|
id: "badge_you",
|
||||||
@@ -10814,7 +10854,7 @@ class ContactList extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isChannel = tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().isChannelTopicName(key);
|
const isChannel = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isChannelTopicName(key);
|
||||||
const selected = showCheckmark ? this.props.topicSelected.indexOf(key) > -1 : this.props.topicSelected === key;
|
const selected = showCheckmark ? this.props.topicSelected.indexOf(key) > -1 : this.props.topicSelected === key;
|
||||||
const badges = [];
|
const badges = [];
|
||||||
|
|
||||||
@@ -11370,7 +11410,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
|
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11389,7 +11429,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
|
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11407,7 +11447,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
|
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11430,7 +11470,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
|
|
||||||
if (!topic || !params.user) {
|
if (!topic || !params.user) {
|
||||||
console.log("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
|
console.warn("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11511,7 +11551,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
|
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found: ", params.topicName);
|
console.warn("Topic not found: ", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11546,7 +11586,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
|||||||
const topic = this.props.tinode.getTopic(params.topicName);
|
const topic = this.props.tinode.getTopic(params.topicName);
|
||||||
|
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
console.log("Topic not found", params.topicName);
|
console.warn("Topic not found", params.topicName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12146,7 +12186,7 @@ class ForwardDialog extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compon
|
|||||||
|
|
||||||
handleSearchContacts(query) {
|
handleSearchContacts(query) {
|
||||||
this.setState({
|
this.setState({
|
||||||
query: tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().isNullValue(query) ? null : query
|
query: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isNullValue(query) ? null : query
|
||||||
});
|
});
|
||||||
this.props.onSearchContacts(query);
|
this.props.onSearchContacts(query);
|
||||||
}
|
}
|
||||||
@@ -13101,7 +13141,7 @@ class LetterTile extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompo
|
|||||||
let avatar;
|
let avatar;
|
||||||
|
|
||||||
if (this.props.avatar === true) {
|
if (this.props.avatar === true) {
|
||||||
const isGroup = tinode_sdk__WEBPACK_IMPORTED_MODULE_1___default().isGroupTopicName(this.props.topic);
|
const isGroup = tinode_sdk__WEBPACK_IMPORTED_MODULE_1__.Tinode.isGroupTopicName(this.props.topic);
|
||||||
const iconColor = (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_2__.idToColorClass)(this.props.topic, isGroup);
|
const iconColor = (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_2__.idToColorClass)(this.props.topic, isGroup);
|
||||||
|
|
||||||
if (this.props.topic && this.props.title && this.props.title.trim()) {
|
if (this.props.topic && this.props.title && this.props.title.trim()) {
|
||||||
@@ -13993,9 +14033,9 @@ class ReceivedMarker extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
|||||||
} = this.props.intl;
|
} = this.props.intl;
|
||||||
let timestamp;
|
let timestamp;
|
||||||
|
|
||||||
if (this.props.received <= (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().MESSAGE_STATUS_SENDING)) {
|
if (this.props.received <= tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.MESSAGE_STATUS_SENDING) {
|
||||||
timestamp = formatMessage(messages.message_sending);
|
timestamp = formatMessage(messages.message_sending);
|
||||||
} else if (this.props.received == (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().MESSAGE_STATUS_FAILED)) {
|
} else if (this.props.received == tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.MESSAGE_STATUS_FAILED) {
|
||||||
timestamp = formatMessage(messages.message_sending_failed);
|
timestamp = formatMessage(messages.message_sending_failed);
|
||||||
} else {
|
} else {
|
||||||
timestamp = this.props.timestamp.toLocaleTimeString(this.props.intl.locale, {
|
timestamp = this.props.timestamp.toLocaleTimeString(this.props.intl.locale, {
|
||||||
@@ -14055,7 +14095,7 @@ class SearchContacts extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
|||||||
search: '',
|
search: '',
|
||||||
edited: false
|
edited: false
|
||||||
});
|
});
|
||||||
this.props.onSearchContacts((tinode_sdk__WEBPACK_IMPORTED_MODULE_1___default().DEL_CHAR));
|
this.props.onSearchContacts(tinode_sdk__WEBPACK_IMPORTED_MODULE_1__.Tinode.DEL_CHAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14071,14 +14111,14 @@ class SearchContacts extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
|
|||||||
this.setState({
|
this.setState({
|
||||||
edited: query.length > 0
|
edited: query.length > 0
|
||||||
});
|
});
|
||||||
this.props.onSearchContacts(query.length > 0 ? query : (tinode_sdk__WEBPACK_IMPORTED_MODULE_1___default().DEL_CHAR));
|
this.props.onSearchContacts(query.length > 0 ? query : tinode_sdk__WEBPACK_IMPORTED_MODULE_1__.Tinode.DEL_CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClear(e) {
|
handleClear(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (this.state.edited) {
|
if (this.state.edited) {
|
||||||
this.props.onSearchContacts((tinode_sdk__WEBPACK_IMPORTED_MODULE_1___default().DEL_CHAR));
|
this.props.onSearchContacts(tinode_sdk__WEBPACK_IMPORTED_MODULE_1__.Tinode.DEL_CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -14294,7 +14334,7 @@ class SendMessage extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp
|
|||||||
this.setState({
|
this.setState({
|
||||||
audioRec: false
|
audioRec: false
|
||||||
});
|
});
|
||||||
console.log("this.props.onAttachAudio", url, duration);
|
this.props.onAttachAudio(url, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSend(e) {
|
handleSend(e) {
|
||||||
@@ -15038,7 +15078,7 @@ class TopicDescEdit extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compon
|
|||||||
const topic = this.props.tinode.getTopic(this.props.topic);
|
const topic = this.props.tinode.getTopic(this.props.topic);
|
||||||
const acs = topic.getAccessMode();
|
const acs = topic.getAccessMode();
|
||||||
this.state = {
|
this.state = {
|
||||||
isMe: tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().isMeTopicName(this.props.topic),
|
isMe: tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.isMeTopicName(this.props.topic),
|
||||||
owner: acs && acs.isOwner(),
|
owner: acs && acs.isOwner(),
|
||||||
fullName: topic.public ? topic.public.fn : undefined,
|
fullName: topic.public ? topic.public.fn : undefined,
|
||||||
private: topic.private ? topic.private.comment : null,
|
private: topic.private ? topic.private.comment : null,
|
||||||
@@ -15095,7 +15135,7 @@ class TopicDescEdit extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compon
|
|||||||
this.setState({
|
this.setState({
|
||||||
private: comment
|
private: comment
|
||||||
});
|
});
|
||||||
this.props.onUpdateTopicDesc(this.props.topic, null, comment || (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().DEL_CHAR));
|
this.props.onUpdateTopicDesc(this.props.topic, null, comment || tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.DEL_CHAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15120,7 +15160,7 @@ class TopicDescEdit extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compon
|
|||||||
this.setState({
|
this.setState({
|
||||||
avatar: null
|
avatar: null
|
||||||
});
|
});
|
||||||
this.props.onUpdateTopicDesc(this.props.topic, (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_9__.theCard)(null, (tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default().DEL_CHAR)));
|
this.props.onUpdateTopicDesc(this.props.topic, (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_9__.theCard)(null, tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Tinode.DEL_CHAR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4192
-6278
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user