mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
MESSENGER-5740 fix double notes rooms on connection erros
This commit is contained in:
@@ -102,11 +102,19 @@ extension PersonalNotesDefaultService : PersonalNotesService {
|
||||
func createPersonalNotesRoomIfNeeded() {
|
||||
|
||||
self.fetchRoomID() { (roomId, error) in
|
||||
if let mxerror = error as? MXError {
|
||||
if let errcode = mxerror.userInfo["errcode"] as? String {
|
||||
if errcode != kMXErrCodeStringNotFound {
|
||||
// request error, don't create room
|
||||
return
|
||||
|
||||
// bwi #5740 don't create room after connection error that is not translated to mxerror
|
||||
if let error = error {
|
||||
if MXError.isMXError(error) {
|
||||
if let mxError = MXError(nsError: error) {
|
||||
if let errcode = mxError.userInfo["errcode"] as? String {
|
||||
if errcode != kMXErrCodeStringNotFound {
|
||||
// request error, don't create room
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user