@@ -45,8 +45,9 @@ struct UserList: View {
45
45
NSSortDescriptor ( key: " pkiEncrypted " , ascending: false ) ,
46
46
NSSortDescriptor ( key: " userNode.lastHeard " , ascending: false ) ,
47
47
NSSortDescriptor ( key: " longName " , ascending: true ) ] ,
48
- predicate: NSPredicate ( format: " userNode.ignored == false && longName != '' " ) ,
49
- animation: . default
48
+ predicate: NSPredicate (
49
+ format: " userNode.ignored == false && longName != '' AND NOT (userNode.viaMqtt == YES AND userNode.hopsAway > 0) "
50
+ ) , animation: . default
50
51
)
51
52
var users : FetchedResults < UserEntity >
52
53
@@ -297,7 +298,7 @@ struct UserList: View {
297
298
let textSearchPredicate = NSCompoundPredicate ( type: . or, subpredicates: searchPredicates)
298
299
/// Create an array of predicates to hold our AND predicates
299
300
var predicates : [ NSPredicate ] = [ ]
300
- /// Mqtt
301
+ /// Mqtt and lora
301
302
if !( viaLora && viaMqtt) {
302
303
if viaLora {
303
304
let loraPredicate = NSPredicate ( format: " userNode.viaMqtt == NO " )
@@ -307,9 +308,8 @@ struct UserList: View {
307
308
predicates. append ( mqttPredicate)
308
309
}
309
310
} else {
310
- /// Only show mqtt nodes that can be contacted (zero hops) on the default key
311
- // let bothPredicate = NSPredicate(format: "userNode.viaMqtt == YES AND userNode.hopsAway == 0 OR userNode.viaMqtt == NO")
312
- // predicates.append(bothPredicate)
311
+ let mqttPredicate = NSPredicate ( format: " NOT (userNode.viaMqtt == YES AND userNode.hopsAway > 0) " )
312
+ predicates. append ( mqttPredicate)
313
313
}
314
314
/// Roles
315
315
if roleFilter && deviceRoles. count > 0 {
0 commit comments