GServer::setProtocol($importer['gsid'], Post\DeliveryData::DFRN);
}
- // is it a public forum? Private forums aren't exposed with this method
- $forum = intval(XML::getFirstNodeValue($xpath, '/atom:feed/dfrn:community/text()'));
+ // is it a public group? Private groups aren't exposed with this method
+ $group = intval(XML::getFirstNodeValue($xpath, '/atom:feed/dfrn:community/text()'));
// The account type is new since 3.5.1
if ($xpath->query('/atom:feed/dfrn:account_type')->length > 0) {
// Updating the public contact as well
Contact::update(['contact-type' => $accounttype], ['uid' => 0, 'nurl' => $importer['nurl']]);
}
- // A forum contact can either have set "forum" or "prv" - but not both
+ // A group contact can either have set "forum" or "prv" - but not both
if ($accounttype == User::ACCOUNT_TYPE_COMMUNITY) {
- // It's a forum, so either set the public or private forum flag
- $condition = ['(`forum` != ? OR `prv` != ?) AND `id` = ?', $forum, !$forum, $importer['id']];
- Contact::update(['forum' => $forum, 'prv' => !$forum], $condition);
+ // It's a group, so either set the public or private forum flag
+ $condition = ['(`forum` != ? OR `prv` != ?) AND `id` = ?', $group, !$group, $importer['id']];
+ Contact::update(['forum' => $group, 'prv' => !$group], $condition);
// Updating the public contact as well
- $condition = ['(`forum` != ? OR `prv` != ?) AND `uid` = 0 AND `nurl` = ?', $forum, !$forum, $importer['nurl']];
- Contact::update(['forum' => $forum, 'prv' => !$forum], $condition);
+ $condition = ['(`forum` != ? OR `prv` != ?) AND `uid` = 0 AND `nurl` = ?', $group, !$group, $importer['nurl']];
+ Contact::update(['forum' => $group, 'prv' => !$group], $condition);
} else {
- // It's not a forum, so remove the flags
+ // It's not a group, so remove the flags
$condition = ['(`forum` OR `prv`) AND `id` = ?', $importer['id']];
Contact::update(['forum' => false, 'prv' => false], $condition);
$condition = ['(`forum` OR `prv`) AND `uid` = 0 AND `nurl` = ?', $importer['nurl']];
Contact::update(['forum' => false, 'prv' => false], $condition);
}
- } elseif ($forum != $importer['forum']) { // Deprecated since 3.5.1
- $condition = ['`forum` != ? AND `id` = ?', $forum, $importer['id']];
- Contact::update(['forum' => $forum], $condition);
+ } elseif ($group != $importer['forum']) { // Deprecated since 3.5.1
+ $condition = ['`forum` != ? AND `id` = ?', $group, $importer['id']];
+ Contact::update(['forum' => $group], $condition);
// Updating the public contact as well
- $condition = ['`forum` != ? AND `uid` = 0 AND `nurl` = ?', $forum, $importer['nurl']];
- Contact::update(['forum' => $forum], $condition);
+ $condition = ['`forum` != ? AND `uid` = 0 AND `nurl` = ?', $group, $importer['nurl']];
+ Contact::update(['forum' => $group], $condition);
}