All notable changes to this project will be documented here. to see complete list of changelog please visit ChangeLog
- Search in threads metadata
- ACL functionalities
- Getting admins list
- Setting / Removing new admin with roles
isTyping
for users, you can callstartTyping()
andstopTyping()
to handle typing system messagesclearHistory()
function to fully clear thread's historydeleteMultipleMessages()
function to delete an array of message at oncegetNotSeenDuration()
function to get the time of user being off the application in miliseconds
- Function level cache control is now available. In order to disable receiving cache results for some specefic
request, you can simply set
cache
parameter asFalse
inparam
object which you're sending to chat SDK. Default value ofcache
isTrue
. Be aware that this feature only works if globalenableCache
parameter has been set asTrue
. Below is the list of supported functions:getHistory()
getThreads()
getThreadParticipants()
getContacts()
searchContacts()
- Clear and Delete functionalities for cache. In order to clear current user's cache you can simply call
clearCacheDatabasesOfUser()
and if you want to delete whole cache database just calldeleteCacheDatabases()
- Turn external web workers into Inline BLOB type workers.
- Unified message structure for all queues
- Multi Tab IndexedDb CRUD management
replyInfo
object now comes withrepliedToMessageTime
,repliedToMessageTimeMiliSeconds
andrepliedToMessageTimeNanos
getHistory()
function now has 2 new parameters as below:queues
: This parameter takes an object as its value and declares which queues to be in return result of getHistory(). Default value for all 3 options isTRUE
. Sample value object can be like below:
queues: { sending: true, failed: false, uploading: true }
dynamicHistoryCount
: If you need the number of messages thatgetHistory()
function returns from server to be dynamically updated according to count of messages in message queues, you can set this parameter asTRUE
. Default value isFALSE
.
-
Cache return mechanism has changed. Here are all the details of each method:
-
getThreads
: If there are some results for your request in cache, you'll get response from cache immediately. After receiving server's response, You'll get a newthreadEvents
event withTHREADS_LIST_CHANGE
type which gives you server's response. You can change your previous result with this one if you want to. Either way cache will update in background. -
getContacts
: Mechanism is the same asgetThreads
, the only difference is the event. After receiving server's response, You'll get a newcontactEvents
event withCONTACTS_LIST_CHANGE
type which gives you server's response. -
getThreadParticipants
: Same asgetThreads
, but you will get a newthreadEvents
withTHREAD_PARTICIPANTS_LIST_CHANGE
type after server's response has received. -
getHistory
: If there are some results in cache for the request you made, we check some conditions on cache response, and if all goes well, we return from cache. Conditions are as below:- There should not be any GAPs between messages in cache result.
- There should not be a GAP before first message of result.
If all the conditions pass, you get immediate response from cache. Then we wait for server to return it's response. After getting response from server, we check for differences between cache and server results and there we could have three scenarios:
- There are some messages on server's result which were not in cache. in this case we emit a
MESSAGE_NEW
event to inform client of these new messages. - Some messages have been deleted from server but we have them on cache. in this case we emit a
MESSAGE_DELETE
event. - And if some messages have been edited on server, we simply return a
MESSAGE_EDIT
event.
If there are no messages on cache or one of conditions has failed, we will wait for server to return it's result and give it to client as callback result.
-
-
The key for encrypting cache data now comes from server. If someone tries to decrypt user's cache with an invalid key, cache data will be automatically delete in order to keep user's data from being stolen.
ActiveMQ
support has been added toPodAsync
In order to use ActiveMQ
instead of Websocket
you should send these parameters to Chat()
var params = {
protocol: "queue",
queueHost: "172.16.0.248",
queuePort: "61613",
queueUsername: "root",
queuePassword: "zalzalak",
queueReceive: "queue-in-amjadi-stomp",
queueSend: "queue-out-amjadi-stomp",
queueConnectionTimeout: 20000
};
var params = {
socketAddress: "ws://172.16.106.26:8003/ws",
serverName: "chat-server",
wsConnectionWaitTime: 500,
connectionRetryInterval: 5000,
connectionCheckTimeout: 10000,
reconnectOnClose: true
};
block()
function has been changed and now you can block withthreadId
,userId
alongsidecontactId
chatAgent.block({
contactId: 2247,
// threadId: 1018,
// userId: 121
}, function(result) {
if (!result.hasError)
console.log("Contact has been successfully Blocked!");
});
unBlock()
function has been changed and now you can unblock withcontactId
,threadId
,userId
alongsideblockId
chatAgent.unblock({
blockId: 425,
// contactId: 2247,
// threadId: 1018,
// userId: 122
}, function(result) {
if (!result.hasError)
console.log("Contact has been successfully unBlocked!");
});
- Thread model has been changed.
lastSeenMessageId
,partnerLastSeenMessageId
andpartnerLastDeliveredMessageId
are no longer available, instead you can use below times:lastSeenMessageTime
partnerLastSeenMessageTime
partnerLastDeliveredMessageTime
fromTimeFull
andtoTimeFull
have been added togetHistory()
parameters. You can either enter full time as a 19 length number or enter it asfromTime (length 13)
withfromTimeNanos (length 9)
// Enter times like this
getHistoryParams = {
fromTime: 1547896931323,
fromTimeNanos: 323160000
}
// or like this
getHistoryParams = {
fromTimeFull: 1547896931323160000
}
- Refactoring Chat Send Queue and Upload Queue
resendMessage()
now requires callbacks too.
- Cache synchronization with server to delete and update old cache data
- Update Cache on Message Delete/Edit
- Update Participants Cache
- Update Contacts Cache
- Update Threads Cache
- Reply with file Message
replyFileMessage()
- Creating thread by sending or forwarding a message to someone
- Set
image
,description
andmetadata
parameters on thread creation so there would be no need forupdateThreadInfo()
- Implementing
UploadQueue
,SendingQueue
andWaitQueue
for chat messages - Resend
resendMessage()
/cancelMessage()
Cancel function to handle failed messages - Cancel uploading and sending file messages with
cancelFileUpload()
- Get Message Delivered List
getMessageDeliveredList()
- Get Message Seen List
getMessageSeenList()
- Update Chat ping mechanism
- Replacing
RC4
withAES
as encryption method
replyInfo
has been changed as follow
var replyInfo = {
deleted, /* Delete state of Replied Message */
participant, /* Sender of Replied Message */
repliedToMessageId, /* Id of Replied Message */
message, /* Content of Replied Message */
messageType, /* Type of Replied Message */
metadata, /* metadata of Replied Message */
systemMetadata, /* systemMetadata of Replied Message */
};
typeCode
attribute has been added to primary chat options. This attribute indicates which contact group you are willing to work withtypeCode
is also available in every function separately and you can send this parameter along side others- You can declare type of message you are sending by setting
messageType
attribute. It takes an Integer value and you will get it ongetHistory()
results too.
notSeenDuration
attribute ofparticipants
will no longer save in cache, and you will getundefined
in return
- Full cache support with local encryption for both Node and Browser Environments. In order to enable caching, you can set
enableCache: true
while you start a chat application - Embedded map services including
mapReverse()
which takes a Geo Location and returns its address backmapSearch()
which takes a Geo Location and a Search term and returns an array of Nearby places containing that search termmapRouting()
which takes two Geo Locations and returns the route between themmapStaticImage()
which takes a Geo Locations and returns the static map image of that area
- Early version of Load Test are up now
MESSAGE_DELETE
has been added tomessageEvents
listener, and whenever a message gets delete, you'll have an event announcing you that action. The result is like below:
{ type: 'MESSAGE_DELETE',
result: {
message: {
id: id_of_deleted_message,
threadId: id_of_message_thread
}
}
}
messageType
has been added toMESSAGE
modeladmin
attribute has been added toCONVERSATOIN
modelcontactId
,contactName
,contactFirstname
,contactLastname
andblocked
have been added toPARTICIPANT
model
- If you want to grant device id from SSO you can set
grantDeviceIdFromSSO
asTRUE
in initializing parameters
-
In order to rename a thread you can call
updateThreadInfo()
function and pass it 4 parameters as below:- image
- description
- title
- metadata
-
THREAD_INFO_UPDATED
events returns whole thread object
renameThread()
has been depreciated.
- Now you can Cancel File Uploads by calling
cancelFileUpload()
and sending file's uniqueId as a parameter to it
Block / unBlock
FunctionalitygetBlockedList()
FunctionSpam
Functionality- Search in thread History and
metadata
- Update Thread Info
- Search in Contacts list
fileUploadEvents
Listener- Uploading progress for
File/Image Upload
andsendFileMessage()
getChatState()
FunctionTO_BE_USER_ID
type has been added toinviteeVOidTypes
but only works while making P2P threads
PARTICIPANT
object now hasfirstName
,lastName
andcontactId
attributesimage
attribute inCONVRSATION
model changed tolastParticipantImage
setToken()
FunctionfirstMessageId
andlastMessageId
attributes ingetHistory()
- Delete Message
- Benchmark Tests
- Upload functionality for node base usages
- Unit Tests (
npm test
)
- uploadImage
- uploadFile
- getImage
- getFile
- sendFileMessage
- npm version rescaled to 0.5.1 (Release . Sprint . Feature/Patch/BugFix)
- MESSAGE_SEEN fires at Sender's side when he sends a SEEN type to server
- Add extra data on Message's metaData field and you will get your data back in metaData:{sdk: {}, user: { /Your Custom Data Here/ }}
- THREAD_LAST_ACTIVITY_TIME fires on sending message at Sender's side too
- threadEvents has 1 new type (Whatever happens in a thread, thread's time attribute changes. You can sort your list by listening to this event) - THREAD_LAST_ACTIVITY_TIME
- threadEvents has 1 new type (In case of someone remove you from an thread, you will get an event with this type containing the ThreadId you've been removed from) - THREAD_REMOVED_FROM
- You can Add Participants to an existing thread by addParticipants({threadId : Thread's ID, content : An Array of Contact IDs}, () => {});
- To Remove participants from an thread use removeParticipants({threadId: Thread's ID, content: An Array of Participant IDs});
- If you want to Leave a thread use leaveThread({threadId: Thread's Id}, () => {});
- threadEvents now has 3 new types
- THREAD_ADD_PARTICIPANTS
- THREAD_REMOVE_PARTICIPANTS
- THREAD_LEAVE_PARTICIPANT
##[3.9.3] - 2018-07-04
- messageEvents now has 2 new types
- MESSAGE_SEEN
- MESSAGE_DELIVERY
-
messageEvents types get MESSAGE_ namespace and are as below:
- MESSAGE_NEW
- MESSAGE_EDIT
- MESSAGE_DELIVERY
- MESSAGE_SEEN
-
threadEvents types start with THREAD_:
- THREAD_NEW
- THREAD_RENAME
- THREAD_MUTE
- THREAD_UNMUTE
- THREAD_INFO_UPDATED
- THREAD_UNREAD_COUNT_UPDATED
-
2 main event listeners group (threadEvents, messageEvents)
-
messageEvents has 2 types
- NEW_MESSAGE
- EDIT_MESSAGE
-
threadEvents has 6 types
- NEW_THREAD
- THREAD_RENAME
- THREAD_MUTE
- THREAD_UNMUTE
- THREAD_INFO_UPDATED
- LAST_SEEN_UPDATED
-
- Below event listeners are no longer available :
- chatAgent.on("message", () => {});
- chatAgent.on("editMessage", () => {});
- chatAgent.on("newThread", () => {});
- chatAgent.on("threadInfoUpdated", () => {});
- chatAgent.on("threadRename", () => {});
- chatAgent.on("lastSeenUpdated", () => {});
- chatAgent.on("muteThread", () => {});
- chatAgent.on("unMuteThread", () => {});
- Contact Management (addContacts, updateContacts, removeContacts)
- Search in Threads
- Http Request Handler
- Received Seen & Delivery Messages now have {messageId, participantId} in response content