mirror of
https://github.com/friendica/friendica
synced 2025-04-26 01:10:15 +00:00
Replace almost every Introduction places
This commit is contained in:
parent
a40f503fdd
commit
7d7d310cc4
8 changed files with 128 additions and 43 deletions
|
@ -1352,7 +1352,7 @@ class DFRN
|
|||
}
|
||||
|
||||
// Quit if we already have an introduction for this person
|
||||
if (DBA::exists('intro', ['uid' => $uid, 'suggest-cid' => $cid])) {
|
||||
if (DI::intro()->existsForContact($cid, $uid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1366,10 +1366,13 @@ class DFRN
|
|||
$suggest['title'] = '';
|
||||
$suggest['body'] = $note;
|
||||
|
||||
$hash = Strings::getRandomHex();
|
||||
$fields = ['uid' => $suggest['uid'], 'suggest-cid' => $cid, 'contact-id' => $suggest['cid'],
|
||||
'note' => $suggest['body'], 'hash' => $hash, 'datetime' => DateTimeFormat::utcNow(), 'blocked' => false];
|
||||
DBA::insert('intro', $fields);
|
||||
DI::intro()->save(DI::introFactory()->createNew(
|
||||
$suggest['uid'],
|
||||
$suggest['cid'],
|
||||
$suggest['body'],
|
||||
null,
|
||||
$cid
|
||||
));
|
||||
|
||||
DI::notify()->createFromArray([
|
||||
'type' => Notification\Type::SUGGEST,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue