|
|
|
@ -38,10 +38,10 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
void registerEvents() {
|
|
|
|
void registerEvents() {
|
|
|
|
hubConnection.on("OnUpdateUserStatusAsync", changeStatus);
|
|
|
|
hubConnection.on("OnUpdateUserStatusAsync", changeStatus);
|
|
|
|
hubConnection.on("OnDeliveredChatUserAsync", onMsgReceived);
|
|
|
|
hubConnection.on("OnDeliveredChatUserAsync", onMsgReceived);
|
|
|
|
hubConnection.on("OnSeenChatUserAsync", onChatSeen);
|
|
|
|
// hubConnection.on("OnSeenChatUserAsync", onChatSeen);
|
|
|
|
//hubConnection.on("OnUserTypingAsync", onUserTyping);
|
|
|
|
//hubConnection.on("OnUserTypingAsync", onUserTyping);
|
|
|
|
hubConnection.on("OnUserCountAsync", userCountAsync);
|
|
|
|
hubConnection.on("OnUserCountAsync", userCountAsync);
|
|
|
|
hubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow);
|
|
|
|
// hubConnection.on("OnUpdateUserChatHistoryWindowsAsync", updateChatHistoryWindow);
|
|
|
|
hubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered);
|
|
|
|
hubConnection.on("OnGetUserChatHistoryNotDeliveredAsync", chatNotDelivered);
|
|
|
|
hubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus);
|
|
|
|
hubConnection.on("OnUpdateUserChatHistoryStatusAsync", updateUserChatStatus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -108,7 +108,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
isLoading = false;
|
|
|
|
isLoading = false;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
// markRead(userChatHistory, receiverUID);
|
|
|
|
markRead(userChatHistory, receiverUID);
|
|
|
|
generateConvId();
|
|
|
|
generateConvId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -124,7 +124,12 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
if (!element.isSeen!) {
|
|
|
|
if (!element.isSeen!) {
|
|
|
|
element.isSeen = true;
|
|
|
|
element.isSeen = true;
|
|
|
|
dynamic data = [
|
|
|
|
dynamic data = [
|
|
|
|
{"userChatHistoryId": element.userChatHistoryId, "TargetUserId": element.currentUserId, "isDelivered": true, "isSeen": true}
|
|
|
|
{
|
|
|
|
|
|
|
|
"userChatHistoryId": element.userChatHistoryId,
|
|
|
|
|
|
|
|
"TargetUserId": element.currentUserId == receiverID ? element.currentUserId : element.targetUserId,
|
|
|
|
|
|
|
|
"isDelivered": true,
|
|
|
|
|
|
|
|
"isSeen": true,
|
|
|
|
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
updateUserChatHistoryStatusAsync(data);
|
|
|
|
updateUserChatHistoryStatusAsync(data);
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
@ -190,8 +195,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
|
|
|
|
|
|
|
void onChatSeen(List<Object?>? args) {
|
|
|
|
void onChatSeen(List<Object?>? args) {
|
|
|
|
dynamic items = args!.toList();
|
|
|
|
dynamic items = args!.toList();
|
|
|
|
logger.d("---------------------------------Chat Seen -------------------------------------");
|
|
|
|
|
|
|
|
logger.d(items);
|
|
|
|
|
|
|
|
// for (var user in searchedChats!) {
|
|
|
|
// for (var user in searchedChats!) {
|
|
|
|
// if (user.id == items.first["id"]) {
|
|
|
|
// if (user.id == items.first["id"]) {
|
|
|
|
// user.userStatus = items.first["userStatus"];
|
|
|
|
// user.userStatus = items.first["userStatus"];
|
|
|
|
|