recv ackns moved to the SDK
This commit is contained in:
+1
-3
@@ -17,10 +17,8 @@ export const LOGGING_ENABLED = true;
|
|||||||
|
|
||||||
// Minimum time between two keypress notifications, milliseconds.
|
// Minimum time between two keypress notifications, milliseconds.
|
||||||
export const KEYPRESS_DELAY = 3_000;
|
export const KEYPRESS_DELAY = 3_000;
|
||||||
// Delay before sending a {note} for reciving a message, milliseconds.
|
|
||||||
export const RECEIVED_DELAY = 500;
|
|
||||||
// Delay before sending a read notification, milliseconds.
|
// Delay before sending a read notification, milliseconds.
|
||||||
export const READ_DELAY = 1000;
|
export const READ_DELAY = 1_500;
|
||||||
|
|
||||||
// The default shortest allowed tag length. Matches the value on the server.
|
// The default shortest allowed tag length. Matches the value on the server.
|
||||||
export const MIN_TAG_LENGTH = 2;
|
export const MIN_TAG_LENGTH = 2;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import MessagesView from './messages-view.jsx';
|
|||||||
import SidepanelView from './sidepanel-view.jsx';
|
import SidepanelView from './sidepanel-view.jsx';
|
||||||
|
|
||||||
import { API_KEY, APP_NAME, DEFAULT_P2P_ACCESS_MODE, FORWARDED_PREVIEW_LENGTH, LOGGING_ENABLED,
|
import { API_KEY, APP_NAME, DEFAULT_P2P_ACCESS_MODE, FORWARDED_PREVIEW_LENGTH, LOGGING_ENABLED,
|
||||||
MEDIA_BREAKPOINT, RECEIVED_DELAY } from '../config.js';
|
MEDIA_BREAKPOINT } from '../config.js';
|
||||||
import { CALL_STATE_NONE, CALL_STATE_OUTGOING_INITATED,
|
import { CALL_STATE_NONE, CALL_STATE_OUTGOING_INITATED,
|
||||||
CALL_STATE_INCOMING_RECEIVED, CALL_STATE_IN_PROGRESS,
|
CALL_STATE_INCOMING_RECEIVED, CALL_STATE_IN_PROGRESS,
|
||||||
CALL_HEAD_STARTED } from '../constants.js';
|
CALL_HEAD_STARTED } from '../constants.js';
|
||||||
@@ -786,7 +786,9 @@ class TinodeWeb extends React.Component {
|
|||||||
if (cont.unread > 0 && this.state.messageSounds && !archived) {
|
if (cont.unread > 0 && this.state.messageSounds && !archived) {
|
||||||
// Skip update if the topic is currently open, otherwise the badge will annoyingly flash.
|
// Skip update if the topic is currently open, otherwise the badge will annoyingly flash.
|
||||||
if (document.hidden || this.state.topicSelected != cont.topic) {
|
if (document.hidden || this.state.topicSelected != cont.topic) {
|
||||||
POP_SOUND.play();
|
POP_SOUND.play().catch(_ => {
|
||||||
|
// play() throws if the user did not click the app first: https://goo.gl/xX8pDD.
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Reorder contact list to use possibly updated 'touched'.
|
// Reorder contact list to use possibly updated 'touched'.
|
||||||
@@ -809,12 +811,12 @@ class TinodeWeb extends React.Component {
|
|||||||
}
|
}
|
||||||
} else if (what == 'del') {
|
} else if (what == 'del') {
|
||||||
// TODO: messages deleted (hard or soft) -- update pill counter.
|
// TODO: messages deleted (hard or soft) -- update pill counter.
|
||||||
} else if (what == 'upd') {
|
} else if (what == 'upd' || what == 'call') {
|
||||||
// upd - handled by the SDK. Explicitly ignoring here.
|
// call, upd - handled elsewhere. Explicitly ignoring here.
|
||||||
} else {
|
} else {
|
||||||
// TODO(gene): handle other types of notifications:
|
// TODO(gene): handle other types of notifications:
|
||||||
// * ua -- user agent changes (maybe display a pictogram for mobile/desktop).
|
// * ua -- user agent changes (maybe display a pictogram for mobile/desktop).
|
||||||
console.info("Unsupported (yet) presence update:" + what + " in: " + cont.topic);
|
console.info("Unsupported (yet) contact update:" + what + " in: " + cont.topic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -883,16 +885,7 @@ class TinodeWeb extends React.Component {
|
|||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sending "received" notifications
|
|
||||||
tnData(data) {
|
tnData(data) {
|
||||||
const topic = this.tinode.getTopic(data.topic);
|
|
||||||
if (topic.msgStatus(data, true) >= Tinode.MESSAGE_STATUS_SENT && data.from != this.state.myUserId) {
|
|
||||||
clearTimeout(this.receivedTimer);
|
|
||||||
this.receivedTimer = setTimeout(() => {
|
|
||||||
this.receivedTimer = undefined;
|
|
||||||
topic.noteRecv(data.seq);
|
|
||||||
}, RECEIVED_DELAY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fnd topic: find contacts by tokens */
|
/* Fnd topic: find contacts by tokens */
|
||||||
|
|||||||
+11
-21
@@ -2017,7 +2017,6 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ "NO_ACCESS_MODE": () => (/* binding */ NO_ACCESS_MODE),
|
/* harmony export */ "NO_ACCESS_MODE": () => (/* binding */ NO_ACCESS_MODE),
|
||||||
/* harmony export */ "QUOTED_REPLY_LENGTH": () => (/* binding */ QUOTED_REPLY_LENGTH),
|
/* harmony export */ "QUOTED_REPLY_LENGTH": () => (/* binding */ QUOTED_REPLY_LENGTH),
|
||||||
/* harmony export */ "READ_DELAY": () => (/* binding */ READ_DELAY),
|
/* harmony export */ "READ_DELAY": () => (/* binding */ READ_DELAY),
|
||||||
/* harmony export */ "RECEIVED_DELAY": () => (/* binding */ RECEIVED_DELAY),
|
|
||||||
/* harmony export */ "REM_SIZE": () => (/* binding */ REM_SIZE)
|
/* harmony export */ "REM_SIZE": () => (/* binding */ REM_SIZE)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version.js */ "./src/version.js");
|
/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version.js */ "./src/version.js");
|
||||||
@@ -2031,8 +2030,7 @@ const KNOWN_HOSTS = {
|
|||||||
const DEFAULT_HOST = KNOWN_HOSTS.hosted;
|
const DEFAULT_HOST = KNOWN_HOSTS.hosted;
|
||||||
const LOGGING_ENABLED = true;
|
const LOGGING_ENABLED = true;
|
||||||
const KEYPRESS_DELAY = 3000;
|
const KEYPRESS_DELAY = 3000;
|
||||||
const RECEIVED_DELAY = 500;
|
const READ_DELAY = 1500;
|
||||||
const READ_DELAY = 1000;
|
|
||||||
const MIN_TAG_LENGTH = 2;
|
const MIN_TAG_LENGTH = 2;
|
||||||
const MAX_TAG_LENGTH = 96;
|
const MAX_TAG_LENGTH = 96;
|
||||||
const MAX_TAG_COUNT = 16;
|
const MAX_TAG_COUNT = 16;
|
||||||
@@ -8348,7 +8346,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
|
|
||||||
if (cont.unread > 0 && this.state.messageSounds && !archived) {
|
if (cont.unread > 0 && this.state.messageSounds && !archived) {
|
||||||
if (document.hidden || this.state.topicSelected != cont.topic) {
|
if (document.hidden || this.state.topicSelected != cont.topic) {
|
||||||
POP_SOUND.play();
|
POP_SOUND.play().catch(_ => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8365,8 +8363,8 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
topicSelectedAcs: cont.acs
|
topicSelectedAcs: cont.acs
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (what == 'del') {} else if (what == 'upd') {} else {
|
} else if (what == 'del') {} else if (what == 'upd' || what == 'call') {} else {
|
||||||
console.info("Unsupported (yet) presence update:" + what + " in: " + cont.topic);
|
console.info("Unsupported (yet) contact update:" + what + " in: " + cont.topic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8427,17 +8425,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
tnData(data) {
|
tnData(data) {}
|
||||||
const topic = this.tinode.getTopic(data.topic);
|
|
||||||
|
|
||||||
if (topic.msgStatus(data, true) >= tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.MESSAGE_STATUS_SENT && data.from != this.state.myUserId) {
|
|
||||||
clearTimeout(this.receivedTimer);
|
|
||||||
this.receivedTimer = setTimeout(() => {
|
|
||||||
this.receivedTimer = undefined;
|
|
||||||
topic.noteRecv(data.seq);
|
|
||||||
}, _config_js__WEBPACK_IMPORTED_MODULE_12__.RECEIVED_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tnInitFind() {
|
tnInitFind() {
|
||||||
const fnd = this.tinode.getFndTopic();
|
const fnd = this.tinode.getFndTopic();
|
||||||
@@ -10951,8 +10939,10 @@ class CallIncoming extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
this.resetDesc(topic, this.props);
|
this.resetDesc(topic, this.props);
|
||||||
|
|
||||||
if (this.props.callState == _constants_js__WEBPACK_IMPORTED_MODULE_4__.CALL_STATE_INCOMING_RECEIVED) {
|
if (this.props.callState == _constants_js__WEBPACK_IMPORTED_MODULE_4__.CALL_STATE_INCOMING_RECEIVED) {
|
||||||
RING_SOUND.play();
|
RING_SOUND.play().catch(_ => {});
|
||||||
this.ringTimer = setInterval(() => RING_SOUND.play(), 2000);
|
this.ringTimer = setInterval(_ => {
|
||||||
|
RING_SOUND.play().catch(_ => {});
|
||||||
|
}, 2000);
|
||||||
this.props.onRinging(this.props.topic, this.props.seq);
|
this.props.onRinging(this.props.topic, this.props.seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11281,7 +11271,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ringing':
|
case 'ringing':
|
||||||
RING_SOUND.play();
|
RING_SOUND.play().catch(_ => {});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -11483,7 +11473,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
|||||||
RING_SOUND.pause();
|
RING_SOUND.pause();
|
||||||
RING_SOUND.currentTime = 0;
|
RING_SOUND.currentTime = 0;
|
||||||
CALL_ENDED_SOUND.loop = true;
|
CALL_ENDED_SOUND.loop = true;
|
||||||
CALL_ENDED_SOUND.play();
|
CALL_ENDED_SOUND.play().catch(_ => {});
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
this.handleCloseClick();
|
this.handleCloseClick();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|||||||
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
+74
-19
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