webitel-sdk 0.1.170 → 0.1.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/index.esm.js +28 -3
- package/bundles/index.esm.js.map +1 -1
- package/bundles/index.esm.min.js +1 -1
- package/bundles/index.esm.min.js.map +1 -1
- package/bundles/index.umd.js +35 -9
- package/bundles/index.umd.js.map +1 -1
- package/bundles/index.umd.min.js +1 -1
- package/bundles/index.umd.min.js.map +1 -1
- package/esm2015/socket/client.js +13 -0
- package/esm2015/socket/client.js.map +1 -1
- package/esm2015/socket/conversation.js +14 -2
- package/esm2015/socket/conversation.js.map +1 -1
- package/esm5/socket/client.js +20 -6
- package/esm5/socket/client.js.map +1 -1
- package/esm5/socket/conversation.js +14 -2
- package/esm5/socket/conversation.js.map +1 -1
- package/package.json +1 -1
- package/types/socket/client.d.ts.map +1 -1
- package/types/socket/conversation.d.ts +13 -2
- package/types/socket/conversation.d.ts.map +1 -1
package/bundles/index.esm.js
CHANGED
|
@@ -27052,7 +27052,7 @@ async function getMediaStream(constraints) {
|
|
|
27052
27052
|
|
|
27053
27053
|
const getVersion = () => {
|
|
27054
27054
|
// @ts-ignore
|
|
27055
|
-
return '"0.1.
|
|
27055
|
+
return '"0.1.172"';
|
|
27056
27056
|
};
|
|
27057
27057
|
var version = getVersion();
|
|
27058
27058
|
|
|
@@ -27986,6 +27986,7 @@ var ChatActions;
|
|
|
27986
27986
|
ChatActions["Decline"] = "decline_invite";
|
|
27987
27987
|
ChatActions["Update"] = "update_channel";
|
|
27988
27988
|
ChatActions["Destroy"] = "destroy";
|
|
27989
|
+
ChatActions["MessageDeleted"] = "message_deleted";
|
|
27989
27990
|
})(ChatActions || (ChatActions = {}));
|
|
27990
27991
|
var ConversationState;
|
|
27991
27992
|
(function (ConversationState) {
|
|
@@ -28064,6 +28065,15 @@ class Conversation {
|
|
|
28064
28065
|
setLeave(e) {
|
|
28065
28066
|
this.setClosed(e.timestamp);
|
|
28066
28067
|
}
|
|
28068
|
+
setDeletedMessage(d) {
|
|
28069
|
+
const messages = this._messages;
|
|
28070
|
+
for (let i = 0; i < messages.length; i++) {
|
|
28071
|
+
if (messages[i].id === d.id) {
|
|
28072
|
+
d.created_at = messages[i].created_at;
|
|
28073
|
+
messages.splice(i, 1, d);
|
|
28074
|
+
}
|
|
28075
|
+
}
|
|
28076
|
+
}
|
|
28067
28077
|
get id() {
|
|
28068
28078
|
return this.channelId || this.inviteId || this.conversationId;
|
|
28069
28079
|
}
|
|
@@ -28085,8 +28095,10 @@ class Conversation {
|
|
|
28085
28095
|
contact: null,
|
|
28086
28096
|
};
|
|
28087
28097
|
if (i.hasOwnProperty('file')) {
|
|
28088
|
-
i.file
|
|
28089
|
-
|
|
28098
|
+
if (i.file && i.file.id > 0) {
|
|
28099
|
+
i.file.url = this.client.fileUrlDownload(i.file.id);
|
|
28100
|
+
i.file.streamUrl = this.client.fileUrlStream(i.file.id);
|
|
28101
|
+
}
|
|
28090
28102
|
msg.file = i.file;
|
|
28091
28103
|
}
|
|
28092
28104
|
if (i.hasOwnProperty('text')) {
|
|
@@ -29109,6 +29121,19 @@ class Client extends EventEmitter {
|
|
|
29109
29121
|
conversation.setInvite(inv.invite_id, timestamp);
|
|
29110
29122
|
this.conversationStore.set(conversation.id, conversation);
|
|
29111
29123
|
break;
|
|
29124
|
+
case ChatActions.MessageDeleted:
|
|
29125
|
+
const deleted = event.data;
|
|
29126
|
+
// fixme
|
|
29127
|
+
for (const v of this.allConversations()) {
|
|
29128
|
+
if (!v.closedAt && v.membersId.indexOf(deleted.channel_id) > -1) {
|
|
29129
|
+
conversation = v;
|
|
29130
|
+
break;
|
|
29131
|
+
}
|
|
29132
|
+
}
|
|
29133
|
+
if (conversation) {
|
|
29134
|
+
conversation.setDeletedMessage(deleted);
|
|
29135
|
+
}
|
|
29136
|
+
return;
|
|
29112
29137
|
case ChatActions.Joined:
|
|
29113
29138
|
const joined = event.data;
|
|
29114
29139
|
conversation = this.conversationById(joined.member.id);
|