bulbul-chat
Advanced tools
Comparing version 2.8.7 to 2.9.0
{ | ||
"name": "bulbul-chat", | ||
"version": "2.8.7", | ||
"version": "2.9.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -62,2 +62,4 @@ export declare type ChatMessageType = 'plaintext' | 'image' | 'video' | 'audio' | 'document' | 'location' | 'contact' | 'file' | 'url' | 'card'; | ||
channelId?: string; | ||
replyToId?: string | null; | ||
replyTo?: ChatMessage | null; | ||
messageType: ChatMessageType; | ||
@@ -64,0 +66,0 @@ content: string; |
@@ -26,3 +26,3 @@ import ChannelMessageStorage from './ChannelMessageStorage'; | ||
subscribeChannelsUpdate(): () => void; | ||
sendMessage(channelId: string, messageType: ChatMessageType, content: string, metadata?: Record<string, unknown>, onBlockedHandler?: (message: string) => any): Promise<void>; | ||
sendMessage(channelId: string, messageType: ChatMessageType, content: string, metadata?: Record<string, unknown>, replyTo?: ChatMessage | null): Promise<void>; | ||
retryMessage(message: ChatMessage): Promise<any>; | ||
@@ -34,3 +34,3 @@ triggerUserTyping(isTyping: boolean, channelExternalId: string): Promise<void>; | ||
markAllAsRead(channelId: string): void; | ||
sendAttachment(channelId: string, messageType: ChatMessageType, content: string, file: any): Promise<void>; | ||
sendAttachment(channelId: string, messageType: ChatMessageType, content: string, file: any, replyTo?: ChatMessage | null): Promise<void>; | ||
loadEarlier(channelId: string): void; | ||
@@ -37,0 +37,0 @@ loadLater(channelId: string): Promise<void>; |
@@ -410,3 +410,3 @@ "use strict"; | ||
}; | ||
ChatService.prototype.sendMessage = function (channelId, messageType, content, metadata, onBlockedHandler) { | ||
ChatService.prototype.sendMessage = function (channelId, messageType, content, metadata, replyTo) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -430,2 +430,4 @@ var currentUser, localId, chatMessage; | ||
metadata: metadata, | ||
replyToId: (replyTo === null || replyTo === void 0 ? void 0 : replyTo.id) || null, | ||
replyTo: replyTo, | ||
}; | ||
@@ -438,3 +440,2 @@ // store the message as queued for retries | ||
_this.channelMessageStorage(channelId).removeMessage(chatMessage.localId); | ||
onBlockedHandler === null || onBlockedHandler === void 0 ? void 0 : onBlockedHandler(onBlockedMessage); | ||
})]; | ||
@@ -505,3 +506,3 @@ } | ||
}; | ||
ChatService.prototype.sendAttachment = function (channelId, messageType, content, file) { | ||
ChatService.prototype.sendAttachment = function (channelId, messageType, content, file, replyTo) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -524,2 +525,4 @@ var currentUser, localId, chatMessage; | ||
file: file, | ||
replyToId: (replyTo === null || replyTo === void 0 ? void 0 : replyTo.id) || null, | ||
replyTo: replyTo, | ||
}; | ||
@@ -526,0 +529,0 @@ // store the message as queued for retries |
{ | ||
"name": "bulbul-chat", | ||
"version": "2.8.7", | ||
"version": "2.9.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -86,2 +86,4 @@ import * as qs from 'qs'; | ||
channelId?: string; | ||
replyToId?: string | null; | ||
replyTo?: ChatMessage | null; | ||
messageType: ChatMessageType; | ||
@@ -88,0 +90,0 @@ content: string; |
@@ -245,3 +245,2 @@ import { diffInSeconds } from './utils'; | ||
const lastMessageId = parseInt(channel.lastMessage?.id || '0', 10); | ||
// check if the other user is blocking me | ||
@@ -358,3 +357,3 @@ const otherUserId = channel.channelMemberships | ||
metadata?: Record<string, unknown>, | ||
onBlockedHandler?: (message: string) => any | ||
replyTo?: ChatMessage | null | ||
): Promise<void> { | ||
@@ -373,2 +372,4 @@ const currentUser = await this.getCurrentUser(); | ||
metadata, | ||
replyToId: replyTo?.id || null, | ||
replyTo, | ||
}; | ||
@@ -387,3 +388,2 @@ // store the message as queued for retries | ||
this.channelMessageStorage(channelId).removeMessage(chatMessage.localId); | ||
onBlockedHandler?.(onBlockedMessage); | ||
}); | ||
@@ -452,3 +452,4 @@ } | ||
content: string, | ||
file: any | ||
file: any, | ||
replyTo?: ChatMessage | null | ||
): Promise<void> { | ||
@@ -467,2 +468,4 @@ const currentUser = await this.getCurrentUser(); | ||
file, | ||
replyToId: replyTo?.id || null, | ||
replyTo, | ||
}; | ||
@@ -469,0 +472,0 @@ // store the message as queued for retries |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
248204
4510