handles both ways now pretty smooth for two people but don't know about three

This commit is contained in:
talksik
2021-12-31 03:06:15 -08:00
parent 70c2ad8621
commit 3e4a335631
@@ -86,12 +86,17 @@ class ConvoViewModel: NSObject, ObservableObject {
continue
}
// TODO: if convo receiver is me and I'm not in a call or this call already, then join in
// if convo receiver is me and I'm not in a call or this call already, then join in
if convo!.receiverUserId == userId && !(self?.isInCall())!
&& convo!.receiverEndedTimestamp == nil {
self?.joinConvo(convo: convo!)
}
// if I am in a convo in which the last/loner has left, I need to leave the convo
if convo!.receiverEndedTimestamp != nil && (self?.isInCall())! && convo!.users.contains(userId!) {
self?.leaveConvo()
}
self?.allConvos.append(convo!)
}