diff options
author | Sebastian Reichel <sre@ring0.de> | 2018-09-06 21:55:14 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2018-09-06 23:08:56 +0200 |
commit | 7906378ff2687b4b7d578aa5b7d4a3e8d5a6e8a2 (patch) | |
tree | e896c18a871d71f9fe59c019f015cf99acc26d7d | |
parent | e6760afba762206d283aaa471c0fc1152d5feff0 (diff) | |
download | serial-barcode-scanner-7906378ff2687b4b7d578aa5b7d4a3e8d5a6e8a2.tar.bz2 |
database: fix RFID comparison
-rw-r--r-- | src/database/db-interface.vala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/database/db-interface.vala b/src/database/db-interface.vala index f2d3e87..840f0a8 100644 --- a/src/database/db-interface.vala +++ b/src/database/db-interface.vala @@ -147,7 +147,16 @@ public struct UserInfo { if(joined_at != x.joined_at) return false; if(disabled != x.disabled) return false; if(hidden != x.hidden) return false; - if(rfid != x.rfid) return false; + + /* check if both objects contain the same RFIDs */ + foreach(var id in rfid) { + if(!(id in x.rfid)) + return false; + } + foreach(var id in x.rfid) { + if(!(id in rfid)) + return false; + } return true; } |