mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Replacing string compare by == in magic-search.cpp
This commit is contained in:
parent
eab30faa93
commit
20b8d7eba1
1 changed files with 5 additions and 5 deletions
|
|
@ -213,7 +213,7 @@ list<SearchResult> MagicSearch::getFriends(const string &withDomain) {
|
|||
if (!withDomain.empty()) {
|
||||
if (!lAddress)
|
||||
continue;
|
||||
if (withDomain.compare("*") != 0 && withDomain.compare(linphone_address_get_domain(lAddress)) != 0)
|
||||
if (withDomain != "*" && withDomain != linphone_address_get_domain(lAddress))
|
||||
continue;
|
||||
}
|
||||
returnList.push_back(SearchResult(1, lAddress, lPhoneNumber, lFriend));
|
||||
|
|
@ -397,7 +397,7 @@ unsigned int MagicSearch::getWeight(const string &stringWords, const string &fil
|
|||
}
|
||||
|
||||
bool MagicSearch::checkDomain(const LinphoneFriend *lFriend, const LinphoneAddress *lAddress, const string &withDomain) const {
|
||||
bool onlySipUri = !withDomain.empty() && withDomain.compare("*") != 0;
|
||||
bool onlyOneDomain = !withDomain.empty() && withDomain != "*";
|
||||
const LinphonePresenceModel *presenceModel = lFriend ? linphone_friend_get_presence_model(lFriend) : nullptr;
|
||||
char *contactPresence = presenceModel ? linphone_presence_model_get_contact(presenceModel) : nullptr;
|
||||
|
||||
|
|
@ -408,12 +408,12 @@ bool MagicSearch::checkDomain(const LinphoneFriend *lFriend, const LinphoneAddre
|
|||
}
|
||||
|
||||
bool soFarSoGood =
|
||||
!onlySipUri || (
|
||||
!onlyOneDomain || (
|
||||
// If we don't want Sip URI only or Address or Presence model
|
||||
(lAddress || presenceModel) &&
|
||||
// And If we don't want Sip URI only or Address match or Address presence match
|
||||
((lAddress && withDomain.compare(linphone_address_get_domain(lAddress)) == 0) ||
|
||||
(addrPresence && withDomain.compare(linphone_address_get_domain(addrPresence)) == 0))
|
||||
((lAddress && withDomain == linphone_address_get_domain(lAddress)) ||
|
||||
(addrPresence && withDomain == linphone_address_get_domain(addrPresence)))
|
||||
);
|
||||
|
||||
if (addrPresence) linphone_address_unref(addrPresence);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue