updates
This commit is contained in:
@@ -190,7 +190,8 @@ class ConvoViewModel: NSObject, ObservableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func joinConvo(convo: Convo) {
|
/* internal control to join a convo */
|
||||||
|
private func joinConvo(convo: Convo) {
|
||||||
// ensure that this user leaves all other channels
|
// ensure that this user leaves all other channels
|
||||||
if self.isInCall() {
|
if self.isInCall() {
|
||||||
self.leaveConvo()
|
self.leaveConvo()
|
||||||
@@ -203,8 +204,7 @@ class ConvoViewModel: NSObject, ObservableObject {
|
|||||||
// finally join channel
|
// finally join channel
|
||||||
self.agoraKit?.joinChannel(byToken: convo.agoraToken, channelId: convo.id!, info: nil, uid: 0, joinSuccess: nil)
|
self.agoraKit?.joinChannel(byToken: convo.agoraToken, channelId: convo.id!, info: nil, uid: 0, joinSuccess: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allow user to join an active convo
|
Allow user to join an active convo
|
||||||
*/
|
*/
|
||||||
@@ -263,8 +263,6 @@ class ConvoViewModel: NSObject, ObservableObject {
|
|||||||
|
|
||||||
// anyone can leave at any time
|
// anyone can leave at any time
|
||||||
func leaveConvo() {
|
func leaveConvo() {
|
||||||
agoraKit?.leaveChannel(nil)
|
|
||||||
|
|
||||||
let userId = AuthSessionStore.getCurrentUserId()
|
let userId = AuthSessionStore.getCurrentUserId()
|
||||||
|
|
||||||
if userId == nil {
|
if userId == nil {
|
||||||
@@ -277,6 +275,8 @@ class ConvoViewModel: NSObject, ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
agoraKit?.leaveChannel(nil)
|
||||||
|
|
||||||
self.firestoreService.updateUserStatus(userId: userId!, userStatus: .online) {[weak self] res in
|
self.firestoreService.updateUserStatus(userId: userId!, userStatus: .online) {[weak self] res in
|
||||||
print(res)
|
print(res)
|
||||||
|
|
||||||
|
|||||||
@@ -464,6 +464,9 @@ extension CircleGridView {
|
|||||||
private func handleTap(gridItemIndex: Int, friendId: String) {
|
private func handleTap(gridItemIndex: Int, friendId: String) {
|
||||||
print("tap gesture activated")
|
print("tap gesture activated")
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: make it deselect a currently selected user if that's the case
|
||||||
|
|
||||||
// if friend and I are online, and I am not in a convo, start convo immediately with them
|
// if friend and I are online, and I am not in a convo, start convo immediately with them
|
||||||
if self.authSessionStore.relevantUsersDict[friendId]?.userStatus == .online
|
if self.authSessionStore.relevantUsersDict[friendId]?.userStatus == .online
|
||||||
&& self.authSessionStore.user?.userStatus == .online && !self.convoVM.isInCall() {
|
&& self.authSessionStore.user?.userStatus == .online && !self.convoVM.isInCall() {
|
||||||
|
|||||||
Reference in New Issue
Block a user