Releases: qiscus/qiscus-sdk-web-core
Qiscus Chat SDK for Javascript
add functionality to close mqtt / realtime connection when needed
openRealtimeConnection(): Promise<boolean>
re-open realtime connection after closing itcloseRealtimeConnection(): Promise<boolean>
close realtime connection without affecting sync interval
On normal occurence, sync interval will be changed to 5 seconds from 30 seconds when realtime connection are closed
but ifcloseRealtimeConnection()
are called, it will still on 30 seconds interval
Qiscus Chat SDK for Javascript
- add more parameter to
getFileList
methodincludeExtensions: string[]
to search a specified extension when getting file listexcludeExtensions: string[]
to exclude a specified extension when getting file listuserId: string
to search only file sent by specified userId
Qiscus Chat SDK for Javascript
- Fix spawning multiple mqtt instance, when disconnected from mqtt broker
Qiscus Chat SDK for Javascript
- Add functionality to not set
sender
property when requesting file list with methodgetFileList
For example:
getFileList({ roomIds: [123], sender: null })
Will call ajax with payload:
{ roomIds: [123] }
While if you omit sender
parameter, it will default to the previous behaviors which is using currently
authenticated user id as sender
getFileList({ roomIds: [123] })
will call ajax with payload:
{ roomIds: [123], sender: 'guest-101' }
if currently authenticated user id are guest-101
Qiscus Chat SDK Javascript Core v2.10.10
Changes:
- improve html escaping when sending message
Qiscus Chat SDK Javascript Core v3.1.2
Changes:
Add feature for editing message
updateMessage(message: model.IQMessage, callback?: (err: Error) => void): void
onMessageUpdated(handler: (message: model.IQMessage) => void): () => void
For example:
const message = {
uniqueId: 'your-message-unique-id'
text: 'hi'
extras: {}
payload: {}
}
qiscus.updateMessage(message, function (message, error) {
if (error != null) {
console.log('error:', error)
return
}
console.log(message)
})
// And for listening on event when another user updating their message:
qiscus.onMessageUpdated(function (message) {
console.log(message);
})
Please note that this feature is only activated / available for selected client only, contact our support for more information.
Qiscus Chat SDK Javascript Core v2.10.9
Changes:
Add feature for editing message
await qiscus.updateMessage(messageObj)
// or
await qiscus.updateMessage({
unique_id: 'your-message-unique-id',
message: 'message text',
extras: {},
payload: {},
})
And for listening on event when another user updating their message:
qiscus.onMessageUpdated(function (message) {
console.log(message);
})
// or if you prefer configure event listening while initializing qiscus chat sdk
qiscus.init({
options: {
messageUpdatedCallback: function (message) {
console.log(message);
}
}
})
Please note that this feature is only activated / available for selected client only, contact our support for more information.
Qiscus Chat SDK Javascript Core v2.10.6
Changes:
- add
room_type
params forqiscus.loadRoomList
method, valid value are:single
,group
, or undefined.
for example:
qiscus.loadRoomList({ room_type: 'single' })
qiscus.loadRoomList({ room_type: 'group' })
qiscus.loadRoomList()
default to return all room type
Qiscus Chat SDK Javascript Core v3.1.0
Changes:
- add clientId on mqtt connection
- add migration guide
- add
searchMessage
method
type Params = {
query: string
roomIds: number[]
userId?: string
type?: string
roomType?: string
page?: number
limit?: number
callback?: (messages?: model.IQMessage[], error?: Error) => void
}
function searchMessage ({ query, roomIds = [], userId, type, roomType, page, limit, callback }: Params): void | Promise<model.IQMessage[]>
- add
getFileList
method
type Params = {
roomIds?: number[]
fileType?: string
page?: number
limit?: number
callback?: (messages?: model.IQMessage[], error?: Error) => void
}
function getFileList ({ roomIds = [], fileType, page, limit, callback, }: Params): void | Promise<model.IQMessage[]>
- add getRoomUnreadCount method
getRoomUnreadCount(callback?: IQCallback2<number>): void | Promise<number>
Qiscus Chat SDK Javascript Core 2.10.4
Changes:
- fix can not get list of file
getFileList