MESSENGER-3352 build settings

This commit is contained in:
Arnfried Griesert
2022-10-27 09:06:24 +00:00
parent e2a2eb4c61
commit 86aa5365bb
103 changed files with 1013 additions and 1360 deletions
+6 -6
View File
@@ -50,11 +50,11 @@ extension UserLabelDefaultService : UserLabelService {
return
}
if state.powerLevels.events[BwiBuildSettings.bwiUserLabelEventTypeString] == nil {
if state.powerLevels.events[BWIBuildSettings.shared.bwiUserLabelEventTypeString] == nil {
if var newContent = state.powerLevels.jsonDictionary() as? [String : Any] {
if var events = newContent["events"] as? [String : Any] {
events[BwiBuildSettings.bwiUserLabelEventTypeString] = RoomPowerLevel.admin.rawValue
events[BWIBuildSettings.shared.bwiUserLabelEventTypeString] = RoomPowerLevel.admin.rawValue
newContent["events"] = events
room.sendStateEvent(.roomPowerLevels, content: newContent, stateKey: "", completion: { response in
@@ -68,20 +68,20 @@ extension UserLabelDefaultService : UserLabelService {
}
}
if var currentLabel = state.stateEvents(with: .custom(BwiBuildSettings.bwiUserLabelEventTypeString))?.last?.content {
if var currentLabel = state.stateEvents(with: .custom(BWIBuildSettings.shared.bwiUserLabelEventTypeString))?.last?.content {
if userLabel != nil {
currentLabel[user] = userLabel
} else {
currentLabel.removeValue(forKey: user)
}
room.sendStateEvent(.custom(BwiBuildSettings.bwiUserLabelEventTypeString), content: currentLabel, stateKey: "", completion: { response in
room.sendStateEvent(.custom(BWIBuildSettings.shared.bwiUserLabelEventTypeString), content: currentLabel, stateKey: "", completion: { response in
completion(response.isSuccess)
})
} else if userLabel != nil {
var newUserLabel = Dictionary<String, Any>()
newUserLabel[user] = userLabel
room.sendStateEvent(.custom(BwiBuildSettings.bwiUserLabelEventTypeString), content: newUserLabel, stateKey: "", completion: { response in
room.sendStateEvent(.custom(BWIBuildSettings.shared.bwiUserLabelEventTypeString), content: newUserLabel, stateKey: "", completion: { response in
completion(response.isSuccess)
})
}
@@ -100,7 +100,7 @@ extension UserLabelDefaultService : UserLabelService {
return
}
if let labels = state.stateEvents(with: .custom(BwiBuildSettings.bwiUserLabelEventTypeString))?.last?.content {
if let labels = state.stateEvents(with: .custom(BWIBuildSettings.shared.bwiUserLabelEventTypeString))?.last?.content {
if let tmp = labels[user] as? String {
label = tmp
}