- $condition = ["(`nick` = ? OR `attag` = ?) AND `network` = ? AND `uid` = ?",
- $name, $name, $network, $profile_uid];
+ $condition = ["`nick` = ? AND `network` = ? AND `uid` = ?",
+ $name, $network, $profile_uid];
+ $contact = DBA::selectFirst('contact', $fields, $condition);
+ }
+
+ // select someone by attag in the current network
+ if (!DBA::isResult($contact) && ($network != '')) {
+ $condition = ["`attag` = ? AND `network` = ? AND `uid` = ?",
+ $name, $network, $profile_uid];