-
The old lrc bannedaccountmodel suffers from many issues, both in its design and functions. In order to be able to later remove this code, migrate the banned contacts logic to the contactmodel. contactmodel: - add a bannedContacts list with its mutex to store uris of banned contacts (not necessary but important for perfs). - modify addContact() to call directly addContact() (daemon side) when called with a banned contact. This will replace the old remove() method from the bannedAccountModel. - add a getBannedContacts method. - modify slotContactAdded to maintain the bannedContacts list and the old lrc. Also, when called with a banned contact, only refresh the filters, do not emit contactAdded signal. - modify slotContactRemoved to maintain the bannedContacts list. - modify addToContacts to maintain the bannedContacts list and update banned flags from the contactInfo. bannedcontactmodel (old lrc): - do not update daemon when remove is called since it collides with the contactmodel. _Using the bannedcontactmodel from old LRC for maintaining banned contacts is now DEPRECATED and support for this functionnality is planned to be dropped in a near future. Please migrate to the new contactmodel banned contacts features._ The recommended way to unban a contact is to call addContact. This is symmetric to the way we ban contacts (calling removeContact). configuration manager mock: - add a synchronization mechanism to the configuration manager mock in order to avoid race conditions during concurrent execution of several removeContact / addContact functions - modify addContact to correctly behave if called with a banned contact: Instead of re-adding the contact, banned and removed flags should be cleared. - modify removeContact to use find_if instead of a for loop and erase contacts from the contacts list instead of simply removing them. tests: - add a unbanContact helper. - fix testPlaceCallWithBannedContact to check callId instead of conversation size which is pointless because invariant. - modify all banned contacts related tests to unban and re-check. - add a testBanUnbanContact test. Change-Id: I42b90559ca4baa12f0596bb927009ce6ba8b4ea3 Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
cb08d760