`blocked` boolean COMMENT 'Contact is completely blocked for this user',
`ignored` boolean COMMENT 'Posts from this contact are ignored',
`collapsed` boolean COMMENT 'Posts from this contact are collapsed',
+ `rel` tinyint unsigned COMMENT 'The kind of the relation between the user and the contact',
+ `info` mediumtext COMMENT '',
+ `notify_new_posts` boolean COMMENT '',
+ `fetch_further_information` tinyint unsigned COMMENT '',
+ `ffi_keyword_denylist` text COMMENT '',
PRIMARY KEY(`uid`,`cid`),
INDEX `cid` (`cid`),
UNIQUE INDEX `uri-id_uid` (`uri-id`,`uid`),
Fields
------
-| Field | Description | Type | Null | Key | Default | Extra |
-| --------- | ------------------------------------------------------------ | ------------------ | ---- | --- | ------- | ----- |
-| cid | Contact id of the linked public contact | int unsigned | NO | PRI | 0 | |
-| uid | User id | mediumint unsigned | NO | PRI | 0 | |
-| uri-id | Id of the item-uri table entry that contains the contact url | int unsigned | YES | | NULL | |
-| blocked | Contact is completely blocked for this user | boolean | YES | | NULL | |
-| ignored | Posts from this contact are ignored | boolean | YES | | NULL | |
-| collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | |
+| Field | Description | Type | Null | Key | Default | Extra |
+| ------------------------- | ------------------------------------------------------------ | ------------------ | ---- | --- | ------- | ----- |
+| cid | Contact id of the linked public contact | int unsigned | NO | PRI | 0 | |
+| uid | User id | mediumint unsigned | NO | PRI | 0 | |
+| uri-id | Id of the item-uri table entry that contains the contact url | int unsigned | YES | | NULL | |
+| blocked | Contact is completely blocked for this user | boolean | YES | | NULL | |
+| ignored | Posts from this contact are ignored | boolean | YES | | NULL | |
+| collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | |
+| rel | The kind of the relation between the user and the contact | tinyint unsigned | YES | | NULL | |
+| info | | mediumtext | YES | | NULL | |
+| notify_new_posts | | boolean | YES | | NULL | |
+| fetch_further_information | | tinyint unsigned | YES | | NULL | |
+| ffi_keyword_denylist | | text | YES | | NULL | |
Indexes
------------
namespace Friendica\Model\Contact;
use Exception;
+use Friendica\Collection\Api\Mastodon\Fields;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\Database;
return false;
}
- $fields = [
- 'cid' => $pcontact['id'],
- 'uid' => $contact['uid'],
- 'uri-id' => $contact['uri-id'],
- 'blocked' => $contact['blocked'] ?? false,
- 'ignored' => $contact['readonly'] ?? false,
- ];
+ $fields = $contact;
+
+ if (isset($fields['readonly'])) {
+ $fields['ignored'] = $fields['readonly'];
+ }
+
+ $fields = DBStructure::getFieldsForTable('user-contact', $fields);
+ $fields['cid'] = $pcontact['id'];
+ $fields['uid'] = $contact['uid'];
+ $fields['uri-id'] = $contact['uri-id'];
$ret = DBA::insert('user-contact', $fields, Database::INSERT_IGNORE);
"uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
"blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
"ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
- "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
+ "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
+ "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
+ "info" => ["type" => "mediumtext", "comment" => ""],
+ "notify_new_posts" => ["type" => "boolean", "comment" => ""],
+ "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => ""],
+ "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["uid", "cid"],