Browse Source

Merge branch '2020.09-rc' into stable

tags/2020.09
Tobias Diekershoff 1 month ago
parent
commit
c6b45a958e
100 changed files with 1859 additions and 2244 deletions
  1. +100
    -0
      .github/workflows/php.yml
  2. +2
    -2
      .gitignore
  3. +3
    -0
      .htaccess-dist
  4. +0
    -31
      .travis.yml
  5. +0
    -4
      .travis/apcu.ini
  6. +0
    -1
      .travis/memcached.ini
  7. +0
    -1
      .travis/redis.ini
  8. +74
    -2
      CHANGELOG
  9. +4
    -4
      CREDITS.txt
  10. +4
    -0
      README.md
  11. +1
    -1
      VERSION
  12. +10
    -0
      bin/.htaccess
  13. +7
    -1
      bin/auth_ejabberd.php
  14. +5
    -0
      bin/console.php
  15. +11
    -1
      bin/daemon.php
  16. +1
    -1
      bin/dev/make_credits.py
  17. +4
    -0
      bin/testargs.php
  18. +5
    -0
      bin/wait-for-connection
  19. +5
    -0
      bin/worker.php
  20. +4
    -36
      boot.php
  21. +2
    -2
      composer.json
  22. +263
    -109
      composer.lock
  23. +254
    -215
      database.sql
  24. +4
    -8
      doc/Addons.md
  25. +30
    -33
      doc/Forums.md
  26. +3
    -2
      doc/Install.md
  27. +0
    -2
      doc/Message-Flow.md
  28. +0
    -3
      doc/database.md
  29. +0
    -10
      doc/database/db_gcign.md
  30. +0
    -32
      doc/database/db_gcontact.md
  31. +0
    -13
      doc/database/db_glink.md
  32. +4
    -8
      doc/de/Addons.md
  33. +0
    -2
      doc/de/Message-Flow.md
  34. +1
    -0
      doc/tools.md
  35. +57
    -0
      images/humane-tech-badge.svg
  36. +13
    -13
      include/api.php
  37. +97
    -78
      include/conversation.php
  38. +50
    -20
      include/enotify.php
  39. +0
    -74
      include/items.php
  40. +3
    -3
      mod/api.php
  41. +6
    -8
      mod/cal.php
  42. +0
    -170
      mod/common.php
  43. +15
    -16
      mod/dfrn_confirm.php
  44. +32
    -65
      mod/dfrn_poll.php
  45. +32
    -32
      mod/dfrn_request.php
  46. +1
    -1
      mod/display.php
  47. +5
    -5
      mod/editpost.php
  48. +14
    -11
      mod/events.php
  49. +5
    -4
      mod/fbrowser.php
  50. +8
    -2
      mod/follow.php
  51. +24
    -49
      mod/item.php
  52. +0
    -161
      mod/lockview.php
  53. +3
    -3
      mod/lostpass.php
  54. +9
    -33
      mod/match.php
  55. +23
    -102
      mod/message.php
  56. +76
    -322
      mod/network.php
  57. +2
    -2
      mod/notes.php
  58. +1
    -3
      mod/oexchange.php
  59. +4
    -6
      mod/ostatus_subscribe.php
  60. +4
    -3
      mod/parse_url.php
  61. +59
    -35
      mod/photos.php
  62. +6
    -14
      mod/ping.php
  63. +24
    -143
      mod/poco.php
  64. +3
    -2
      mod/pubsub.php
  65. +1
    -2
      mod/pubsubhubbub.php
  66. +1
    -2
      mod/redir.php
  67. +1
    -1
      mod/repair_ostatus.php
  68. +11
    -39
      mod/settings.php
  69. +1
    -1
      mod/subthread.php
  70. +10
    -91
      mod/suggest.php
  71. +0
    -1
      mod/tagrm.php
  72. +3
    -3
      mod/uimport.php
  73. +1
    -2
      mod/unfollow.php
  74. +2
    -2
      mod/videos.php
  75. +1
    -1
      mod/wall_attach.php
  76. +2
    -2
      mod/wall_upload.php
  77. +10
    -12
      mod/wallmessage.php
  78. +3
    -0
      mods/sample-Lighttpd.config
  79. +5
    -0
      mods/sample-nginx.config
  80. +0
    -16
      src/App.php
  81. +21
    -68
      src/App/Arguments.php
  82. +2
    -4
      src/App/Authentication.php
  83. +1
    -1
      src/App/Module.php
  84. +4
    -5
      src/App/Page.php
  85. +70
    -8
      src/App/Router.php
  86. +37
    -1
      src/BaseModule.php
  87. +3
    -7
      src/BaseRepository.php
  88. +10
    -1
      src/Console/DatabaseStructure.php
  89. +134
    -0
      src/Console/Relay.php
  90. +80
    -9
      src/Console/ServerBlock.php
  91. +1
    -1
      src/Console/Storage.php
  92. +1
    -1
      src/Console/User.php
  93. +0
    -8
      src/Content/ContactSelector.php
  94. +0
    -15
      src/Content/Feature.php
  95. +2
    -3
      src/Content/ForumManager.php
  96. +3
    -10
      src/Content/Item.php
  97. +2
    -1
      src/Content/Nav.php
  98. +3
    -3
      src/Content/OEmbed.php
  99. +55
    -18
      src/Content/PageInfo.php
  100. +1
    -1
      src/Content/Pager.php

+ 100
- 0
.github/workflows/php.yml View File

@@ -0,0 +1,100 @@
name: Testing Friendica
on: [push, pull_request]

jobs:
friendica:
name: Friendica (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
MYSQL_PASSWORD: test
MYSQL_USER: test
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
memcached:
image: memcached
ports:
- 11211/tcp
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: pecl
extensions: pdo_mysql, gd, zip, opcache, ctype, pcntl, ldap, apcu, memcached, redis, imagick, memcache
coverage: xdebug
ini-values: apc.enabled=1, apc.enable_cli=1

- name: Start mysql service
run: sudo /etc/init.d/mysql start

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist

- name: Copy default Friendica config
run: cp config/local-sample.config.php config/local.config.php

- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done

- name: Setup MYSQL database
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
mysql -h"127.0.0.1" -P"$PORT" -utest -ptest test < database.sql

- name: Test with Parallel-lint
run: vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ .

- name: Test with phpunit
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
MYSQL_DATABASE: test
MYSQL_PASSWORD: test
MYSQL_USER: test
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
MEMCACHED_PORT: ${{ job.services.memcached.ports[11211] }}
MEMCACHE_PORT: ${{ job.services.memcached.ports[11211] }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: clover.xml

+ 2
- 2
.gitignore View File

@@ -71,8 +71,8 @@ venv/
/addons
/addon

#ignore .htaccess
.htaccess
#ignore base .htaccess
/.htaccess

#ignore filesystem storage default path
/storage


+ 3
- 0
.htaccess-dist View File

@@ -1,3 +1,6 @@
# This file is meant to be copied to ".htaccess" on Apache-powered web servers.
# The created .htaccess file can be edited manually and will not be overwritten by Friendica updates.

Options -Indexes
AddType application/x-java-archive .jar
AddType audio/ogg .oga


+ 0
- 31
.travis.yml View File

@@ -1,31 +0,0 @@
---
language: php
## Friendica officially supports PHP version >= 7.1
php:
- 7.1
- 7.2
- 7.3

services:
- mysql
- redis
- memcached
env:
- MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USERNAME=travis MYSQL_PASSWORD="" MYSQL_DATABASE=test

install:
- composer install
before_script:
- cp config/local-sample.config.php config/local.config.php
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- mysql -utravis test < database.sql
- pecl channel-update pecl.php.net
- pecl config-set preferred_state beta
- phpenv config-add .travis/redis.ini
- phpenv config-add .travis/memcached.ini

script:
- vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ .
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml

after_success: bash <(curl -s https://codecov.io/bash)

+ 0
- 4
.travis/apcu.ini View File

@@ -1,4 +0,0 @@
extension="apcu.so"

apc.enabled = 1
apc.enable_cli = 1

+ 0
- 1
.travis/memcached.ini View File

@@ -1 +0,0 @@
extension="memcached.so"

+ 0
- 1
.travis/redis.ini View File

@@ -1 +0,0 @@
extension="redis.so"

+ 74
- 2
CHANGELOG View File

@@ -1,6 +1,78 @@
Version 2020.09 (2020-09-20)
Friendica Core:
Updates to the translations: DE, EN GB, EN US, ES, FR, IT, NL, PL, RU, ZH_CN [translation teams]
Updates to the themes (all) [MrPetovan, tobiasd]
Updates to the documentation [annando, mpanhans, realkinetix, tobiasd]
General code cleanup and refactoring [annando, MrPetovan, nupplaphil]
Enhanced the API [annando]
Enhanced the processing of background jobs [annando]
Enhanced federation of activities [annando, vpzomtrrfrt]
Enhanced the user notifications[annando]
Enhanced database usage [annando, MrPetovan]
Enhanced ActivityPub support for forums [annando]
Enhanced the utilization of the cache [annando, MrPetovan]
Enhanced the performance of the daemon [annando]
Enhanced the communication with the directory servers [annando]
Enhanced the re-sharing of items [annando]
Enhanced sample lighttpd and nginx configs [MrPetovan, tobiasd]
Enhanced the checks for incoming postings using ActivityPub [annando, Roger Meyer]
Enhanced the import of RSS feeds by removing tracking pixels [annando]
Enhanced the speed of the full text search [annando]
Replaced library used for text completion [MrPetovan]
Fixed a problem that prevented recipients of direct messages to be selected [MrPetovan]
Fixed a problem that prevented new email contacts from being added [annando]
Fixed a problem with the console command search [tobiasd]
Fixed a problem during the search for contacts [annando]
Fixed a problem with the JOT of private notes [MrPetovan]
Fixed missing HTML encoding [MrPetovan]
Fixed a layout problem with the frio composer for new postings [MrPetovan]
Fixed some composer notices [nupplaphil]
Fixed a problem for empty preview data when importing feed posts [annando]
Fixed a problem with the pager on search result pages [annando]
Fixed some templates to show the correct un-/follow button for contacts [annando]
Fixed a problem with the generation of the Message-ID of notification emails [nupplaphil]
Added nodeinfo2 support [annando]
Added CSV export and import of blocked servers to the console [tobiasd]
Added new admin debug module for ActivityPub [MrPetovan]
Added the automatic determination of frequency to pull feeds [annando]
Added signed fetching from system users for ActivityPub [annando]
Added the discovery of new peers from contacts [annando]
Added the directory API endpoint [annando]
Added support for signed outbox requests [annando]
Added direction functionality for clarification of posting flow [annando]
Added the ability to set the database version [annando]
Added support for ActivityPub relay server [annando]
By default display of re-sharer information is now flattened [annando]
Removed some unused POCO functionality [annando]
Removed the unused rating functionality [annando]
Removed unneeded network request for local stuff [annando]
Removed some useless info messages [annando]
Reworked some additional features according to a user voting [MrPetovan]

Friendica Addons:
Updates to the translations: DE, EN GB, EN US, IT, NL, RU, ZH_CN [translation teams]
Updates to the docs [SpencerDub]
General code cleanup and maintenance [annando, MrPetovan]
blockbot:
added some "good" bots [annando]
forumdirectory:
fixed some SQL queries [MrPetovan]
phpmailer:
fixed a problem leading to double message ID headers [nupplaphil]
qcomment:
restructured the addon and fixed a bug preventing the addon from working [MrPetovan]

Closed Issues:
2811, 4606, 5742, 5782, 7660, 8676, 8788, 8797, 8798, 8847, 8860,
8874, 8882, 8885, 8906, 8914, 8922, 8928, 8929, 8935, 8940, 8941,
8956, 8958, 8961, 8967, 8989, 8993, 8994, 8995, 8997, 8999, 9000,
9004, 9013, 9015, 9051, 9064, 9065, 9072, 9081, 9090, 9091, 9099,
9107, 9135, 9136, 9137, 9138, 9140, 9142, 9150, 9153, 9154, 9163,
9164, 9172, 9182, 9192, 9193, 9204, 9210, 9229, 9231, 9246

Version 2020.07-1 (2020-09-08)
Friendica Core
Fixed a problem that leakted sensitive information [Roger Meyer, MrPetovan]
Fixed a problem that leaked sensitive information [Roger Meyer, MrPetovan]

Version 2020.07 (2020-07-12)
Friendica Core:
@@ -670,7 +742,7 @@ Version 2018.09 (2018-09-23)
Version 2018.05 (2018-06-01)
Friendica Core:
Update to the translations (DE, EN-GB, EN-US, FI, IS, IT, NL, PL, RU, ZN CH) [translation teams]
Update to the documentation [andyhee, annando, fabrixxm, M-arcus, MrPedovan, rudloff, tobiasd]
Update to the documentation [andyhee, annando, fabrixxm, M-arcus, MrPetovan, rudloff, tobiasd]
Enhancements to the DB handling [annando]
Enhancements to the relay system [annando]
Enhancements to the handling of URL that contain unicode characters [annando]


+ 4
- 4
CREDITS.txt View File

@@ -55,6 +55,7 @@ Chris Case
Christian González
Christian M. Grube
Christian Vogeley
Christian Wiwie
Cohan Robinson
Copiis Praeesse
CrystalStiletto
@@ -114,7 +115,6 @@ Hypolite Petovan
Ilmari
ImgBotApp
irhen
Jak
Jakob
Jens Tautenhahn
jensp
@@ -122,6 +122,7 @@ Jeroen De Meerleer
jeroenpraat
Joan Bar
JOduMonT
joe slam
Johannes Schwab
John Brazil
Jonatan Nyberg
@@ -143,7 +144,6 @@ Leberwurscht
Leonard Lausen
Lionel Triay
loma-one
loma1
Lorem Ipsum
Ludovic Grossard
Lynn Stephenson
@@ -173,6 +173,7 @@ Michal Šupler
Michalina
Mike Macgirvin
miqrogroove
mpanhans
mytbk
nathilia-peirce
Nicola Spanti
@@ -231,7 +232,7 @@ Simon L'nu
Simó Albert i Beltran
softmetz
soko1
SpencerDub
Spencer Dub
St John Karp
Stanislav N.
Steffen K9
@@ -269,7 +270,6 @@ U-SOUND\mike
ufic
Ulf Rompe
Unknown
Valvin
Valvin A
Vasudev Kamath
Vasya Novikov


+ 4
- 0
README.md View File

@@ -40,3 +40,7 @@ Have a look at the [installation documentation](doc/Install.md) for further info
|*Vier theme, desktop browser. Public timeline view.*|
|![Vier theme in desktop browser](images/screenshots/friendica-vier-community.png?raw=true "Vier theme in desktop browser")
|*Vier theme, desktop browser. Community post displayed.*|

## Endorsements

- [![Awesome Humane Tech](images/humane-tech-badge.svg)](https://github.com/humanetech-community/awesome-humane-tech) On August 12th 2020, Friendica was added to [the curated Awesome Humane Tech directory](https://github.com/humanetech-community/awesome-humane-tech) in [the "Fediverse" category](https://github.com/humanetech-community/awesome-humane-tech#fediverse).

+ 1
- 1
VERSION View File

@@ -1 +1 @@
2020.07-1
2020.09-rc

+ 10
- 0
bin/.htaccess View File

@@ -0,0 +1,10 @@
# This file prevents browser access to Friendica command-line scripts on Apache-powered web servers.
# It isn't meant to be edited manually, please check the base Friendica folder for the .htaccess-dist file instead.

<IfModule authz_host_module>
Require all denied
</IfModule>
<IfModule !authz_host_module>
Order Allow,Deny
Deny from all
</IfModule>

+ 7
- 1
bin/auth_ejabberd.php View File

@@ -51,6 +51,11 @@
*
*/

if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}

use Dice\Dice;
use Friendica\App\Mode;
use Friendica\Util\ExAuth;
@@ -80,6 +85,7 @@ $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabb
$appMode = $dice->create(Mode::class);

if ($appMode->isNormal()) {
$oAuth = new ExAuth();
/** @var ExAuth $oAuth */
$oAuth = $dice->create(ExAuth::class);
$oAuth->readStdin();
}

+ 5
- 0
bin/console.php View File

@@ -20,6 +20,11 @@
*
*/

if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}

use Dice\Dice;
use Psr\Log\LoggerInterface;



+ 11
- 1
bin/daemon.php View File

@@ -23,6 +23,11 @@
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
*/

if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}

use Dice\Dice;
use Friendica\Core\Logger;
use Friendica\Core\Worker;
@@ -185,7 +190,12 @@ while (true) {
$do_cron = true;
}

Worker::spawnWorker($do_cron);
if ($do_cron || (!DI::process()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
Worker::spawnWorker($do_cron);
} else {
Logger::info('Cool down', ['pid' => $pid]);
sleep(10);
}

if ($do_cron) {
// We force a reconnect of the database connection.


+ 1
- 1
bin/dev/make_credits.py View File

@@ -34,7 +34,7 @@ dontinclude = ['root', 'friendica', 'bavatar', 'tony baldwin', 'Taek', 'silke m'
path = os.path.abspath(argv[0].split('bin/dev/make_credits.py')[0])
print('> base directory is assumed to be: '+path)
# a place to store contributors
contributors = ["Andi Stadler", "Ratten", "Vít Šesták 'v6ak'"]
contributors = ["Andi Stadler", "Ratten", "Roger Meyer", "Vít Šesták 'v6ak'"]
# get the contributors
print('> getting contributors to the friendica core repository')
p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'],


+ 4
- 0
bin/testargs.php View File

@@ -26,6 +26,10 @@
*
*/

if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}

if (($_SERVER["argc"] > 1) && isset($_SERVER["argv"][1])) {
echo $_SERVER["argv"][1];


+ 5
- 0
bin/wait-for-connection View File

@@ -24,6 +24,11 @@
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/

if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}

$timeout = 60;
switch ($argc) {
case 4:


+ 5
- 0
bin/worker.php View File

@@ -21,6 +21,11 @@
* Starts the background processing
*/

if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}

use Dice\Dice;
use Friendica\App;
use Friendica\Core\Update;


+ 4
- 36
boot.php View File

@@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat;

define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Red Hot Poker');
define('FRIENDICA_VERSION', '2020.07-1');
define('FRIENDICA_VERSION', '2020.09-rc');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('NEW_UPDATE_ROUTINE_VERSION', 1170);

@@ -253,10 +253,10 @@ function public_contact()
if (!$public_contact_id && !empty($_SESSION['authenticated'])) {
if (!empty($_SESSION['my_address'])) {
// Local user
$public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, true));
$public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, false));
} elseif (!empty($_SESSION['visitor_home'])) {
// Remote user
$public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, true));
$public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, false));
}
} elseif (empty($_SESSION['authenticated'])) {
$public_contact_id = false;
@@ -266,7 +266,7 @@ function public_contact()
}

/**
* Returns contact id of authenticated site visitor or false
* Returns public contact id of authenticated site visitor or false
*
* @return int|bool visitor_id or false
*/
@@ -382,38 +382,6 @@ function is_site_admin()
return local_user() && $admin_email && in_array($a->user['email'] ?? '', $adminlist);
}

function explode_querystring($query)
{
$arg_st = strpos($query, '?');
if ($arg_st !== false) {
$base = substr($query, 0, $arg_st);
$arg_st += 1;
} else {
$base = '';
$arg_st = 0;
}

$args = explode('&', substr($query, $arg_st));
foreach ($args as $k => $arg) {
/// @TODO really compare type-safe here?
if ($arg === '') {
unset($args[$k]);
}
}
$args = array_values($args);

if (!$base) {
$base = $args[0];
unset($args[0]);
$args = array_values($args);
}

return [
'base' => $base,
'args' => $args,
];
}

/**
* Returns the complete URL of the current page, e.g.: http(s)://something.com/network
*


+ 2
- 2
composer.json View File

@@ -62,6 +62,7 @@
"npm-asset/jgrowl": "^1.4",
"npm-asset/moment": "^2.24",
"npm-asset/perfect-scrollbar": "0.6.16",
"npm-asset/textcomplete": "^0.18.2",
"npm-asset/typeahead.js": "^0.11.1"
},
"repositories": [
@@ -82,7 +83,6 @@
"include/conversation.php",
"include/dba.php",
"include/enotify.php",
"include/items.php",
"boot.php"
]
},
@@ -128,7 +128,7 @@
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.2",
"johnkary/phpunit-speedtrap": "1.1",
"jakub-onderka/php-parallel-lint": "^1.0"
"php-parallel-lint/php-parallel-lint": "^1.2"
},
"scripts": {
"test": "phpunit"


+ 263
- 109
composer.lock View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ded67f7e680a122d0cd3512c2738be97",
"content-hash": "27203cc7da01ff668ba15e03fd17dc94",
"packages": [
{
"name": "asika/simple-console",
@@ -1276,6 +1276,63 @@
],
"time": "2017-07-06T13:46:38+00:00"
},
{
"name": "npm-asset/eventemitter3",
"version": "2.0.3",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"shasum": "b5e1079b59fb5e1ba2771c0a993be060a58c99ba"
},
"type": "npm-asset-library",
"extra": {
"npm-asset-bugs": {
"url": "https://github.com/primus/eventemitter3/issues"
},
"npm-asset-main": "index.js",
"npm-asset-directories": [],
"npm-asset-repository": {
"type": "git",
"url": "git://github.com/primus/eventemitter3.git"
},
"npm-asset-scripts": {
"build": "mkdir -p umd && browserify index.js -s EventEmitter3 | uglifyjs -m -o umd/eventemitter3.min.js",
"benchmark": "find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;",
"test": "nyc --reporter=html --reporter=text mocha",
"test-browser": "zuul -- test.js",
"prepublish": "npm run build",
"sync": "node versions.js"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Arnout Kazemier"
}
],
"description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.",
"homepage": "https://github.com/primus/eventemitter3#readme",
"keywords": [
"EventEmitter",
"EventEmitter2",
"EventEmitter3",
"Events",
"addEventListener",
"addListener",
"emit",
"emits",
"emitter",
"event",
"once",
"pub/sub",
"publish",
"reactor",
"subscribe"
],
"time": "2017-03-31T14:51:09+00:00"
},
{
"name": "npm-asset/fullcalendar",
"version": "3.10.2",
@@ -1792,64 +1849,6 @@
],
"time": "2017-01-10T01:03:05+00:00"
},
{
"name": "npm-asset/perfect-scrollbar",
"version": "0.6.16",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-0.6.16.tgz",
"shasum": "b1d61a5245cf3962bb9a8407a3fc669d923212fc"
},
"type": "npm-asset-library",
"extra": {
"npm-asset-bugs": {
"url": "https://github.com/noraesae/perfect-scrollbar/issues"
},
"npm-asset-files": [
"dist",
"src",
"index.js",
"jquery.js",
"perfect-scrollbar.d.ts"
],
"npm-asset-main": "./index.js",
"npm-asset-directories": [],
"npm-asset-repository": {
"type": "git",
"url": "git+https://github.com/noraesae/perfect-scrollbar.git"
},
"npm-asset-scripts": {
"test": "gulp",
"before-deploy": "gulp && gulp compress",
"release": "rm -rf dist && gulp && npm publish"
},
"npm-asset-engines": {
"node": ">= 0.12.0"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Hyunje Jun",
"email": "me@noraesae.net"
},
{
"name": "Hyunje Jun",
"email": "me@noraesae.net"
}
],
"description": "Minimalistic but perfect custom scrollbar plugin",
"homepage": "https://github.com/noraesae/perfect-scrollbar#readme",
"keywords": [
"frontend",
"jquery-plugin",
"scroll",
"scrollbar"
],
"time": "2017-01-10T01:03:05+00:00"
},
{
"name": "npm-asset/php-date-formatter",
"version": "v1.3.6",
@@ -1888,6 +1887,100 @@
"homepage": "https://github.com/kartik-v/php-date-formatter",
"time": "2020-04-14T10:16:32+00:00"
},
{
"name": "npm-asset/textarea-caret",
"version": "3.1.0",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/textarea-caret/-/textarea-caret-3.1.0.tgz",
"shasum": "5d5a35bb035fd06b2ff0e25d5359e97f2655087f"
},
"type": "npm-asset-library",
"extra": {
"npm-asset-bugs": {
"url": "https://github.com/component/textarea-caret-position/issues"
},
"npm-asset-files": [
"index.js"
],
"npm-asset-main": "index.js",
"npm-asset-directories": [],
"npm-asset-repository": {
"type": "git",
"url": "git+https://github.com/component/textarea-caret-position.git"
}
},
"license": [
"MIT"
],
"description": "(x, y) coordinates of the caret in a textarea or input type='text'",
"homepage": "https://github.com/component/textarea-caret-position#readme",
"keywords": [
"caret",
"position",
"textarea"
],
"time": "2018-02-20T06:11:03+00:00"
},
{
"name": "npm-asset/textcomplete",
"version": "0.18.2",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/textcomplete/-/textcomplete-0.18.2.tgz",
"shasum": "de0d806567102f7e32daffcbcc3db05af1515eb5"
},
"require": {
"npm-asset/eventemitter3": ">=2.0.3,<3.0.0",
"npm-asset/textarea-caret": ">=3.0.1,<4.0.0",
"npm-asset/undate": ">=0.2.3,<0.3.0"
},
"type": "npm-asset-library",
"extra": {
"npm-asset-bugs": {
"url": "https://github.com/yuku-t/textcomplete/issues"
},
"npm-asset-main": "lib/index.js",
"npm-asset-directories": [],
"npm-asset-repository": {
"type": "git",
"url": "git+ssh://git@github.com/yuku-t/textcomplete.git"
},
"npm-asset-scripts": {
"build": "yarn run clean && run-p build:*",
"build:dist": "webpack && webpack --env=min && run-p print-dist-gz-size",
"build:docs": "run-p build:docs:*",
"build:docs:html": "webpack --config webpack.doc.config.js && pug -o docs src/doc/index.pug",
"build:docs:md": "documentation build src/*.js -f md -o doc/api.md",
"build:lib": "babel src -d lib -s && for js in src/*.js; do cp $js lib/${js##*/}.flow; done",
"clean": "rm -fr dist docs lib",
"format": "prettier --no-semi --trailing-comma all --write 'src/*.js' 'test/**/*.js'",
"gh-release": "npm pack textcomplete && gh-release -a textcomplete-$(cat package.json|jq -r .version).tgz",
"opener": "wait-on http://localhost:8082 && opener http://localhost:8082",
"print-dist-gz-size": "printf 'dist/textcomplete.min.js.gz: %d bytes\\n' \"$(gzip -9kc dist/textcomplete.min.js | wc -c)\"",
"start": "run-p watch opener",
"test": "run-p test:*",
"test:bundlesize": "yarn run build:dist && bundlesize",
"test:e2e": "NODE_ENV=test karma start --single-run",
"test:lint": "eslint src/*.js test/**/*.js",
"test:typecheck": "flow check",
"watch": "run-p watch:*",
"watch:webpack": "webpack-dev-server --config webpack.doc.config.js",
"watch:pug": "pug -o docs --watch src/doc/index.pug"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Yuku Takahashi"
}
],
"description": "Autocomplete for textarea elements",
"homepage": "https://github.com/yuku-t/textcomplete#readme",
"time": "2020-06-10T06:11:00+00:00"
},
{
"name": "npm-asset/typeahead.js",
"version": "0.11.1",
@@ -1940,6 +2033,48 @@
],
"time": "2015-04-27T04:03:42+00:00"
},
{
"name": "npm-asset/undate",
"version": "0.2.4",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/undate/-/undate-0.2.4.tgz",
"shasum": "ccb2a8cf38edc035d1006fcb2909c4c6024a8400"
},
"type": "npm-asset-library",
"extra": {
"npm-asset-bugs": {
"url": "https://github.com/yuku-t/undate/issues"
},
"npm-asset-main": "lib/index.js",
"npm-asset-directories": [],
"npm-asset-repository": {
"type": "git",
"url": "git+https://github.com/yuku-t/undate.git"
},
"npm-asset-scripts": {
"build": "babel src -d lib && for js in src/*.js; do cp $js lib/${js##*/}.flow; done",
"test": "run-p test:*",
"test:eslint": "eslint src/*.js test/*.js",
"test:flow": "flow check",
"test:karma": "karma start --single-run"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Yuku Takahashi"
}
],
"description": "Undoable update for HTMLTextAreaElement",
"homepage": "https://github.com/yuku-t/undate#readme",
"keywords": [
"textarea"
],
"time": "2018-01-24T10:49:39+00:00"
},
{
"name": "paragonie/certainty",
"version": "v2.6.1",
@@ -3247,55 +3382,6 @@
],
"time": "2016-01-20T08:20:44+00:00"
},
{
"name": "jakub-onderka/php-parallel-lint",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git",
"reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/04fbd3f5fb1c83f08724aa58a23db90bd9086ee8",
"reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"jakub-onderka/php-console-highlighter": "~0.3",
"nette/tester": "~1.3",
"squizlabs/php_codesniffer": "~2.7"
},
"suggest": {
"jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet"
},
"bin": [
"parallel-lint"
],
"type": "library",
"autoload": {
"classmap": [
"./"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Jakub Onderka",
"email": "ahoj@jakubonderka.cz"
}
],
"description": "This tool check syntax of PHP files about 20x faster than serial check.",
"homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint",
"abandoned": "php-parallel-lint/php-parallel-lint",
"time": "2018-02-24T15:31:20+00:00"
},
{
"name": "johnkary/phpunit-speedtrap",
"version": "v1.1.0",
@@ -3500,6 +3586,59 @@
],
"time": "2017-10-19T19:58:43+00:00"
},
{
"name": "php-parallel-lint/php-parallel-lint",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git",
"reference": "474f18bc6cc6aca61ca40bfab55139de614e51ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/474f18bc6cc6aca61ca40bfab55139de614e51ca",
"reference": "474f18bc6cc6aca61ca40bfab55139de614e51ca",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.4.0"
},
"replace": {
"grogy/php-parallel-lint": "*",
"jakub-onderka/php-parallel-lint": "*"
},
"require-dev": {
"nette/tester": "^1.3 || ^2.0",
"php-parallel-lint/php-console-highlighter": "~0.3",
"squizlabs/php_codesniffer": "~3.0"
},
"suggest": {
"php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet"
},
"bin": [
"parallel-lint"
],
"type": "library",
"autoload": {
"classmap": [
"./"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Jakub Onderka",
"email": "ahoj@jakubonderka.cz"
}
],
"description": "This tool check syntax of PHP files about 20x faster than serial check.",
"homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint",
"time": "2020-04-04T12:18:32+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
@@ -4669,6 +4808,20 @@
"polyfill",
"portable"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:14:59+00:00"
},
{
@@ -4801,5 +4954,6 @@
"platform-dev": [],
"platform-overrides": {
"php": "7.0"
}
},
"plugin-api-version": "1.1.0"
}

+ 254
- 215
database.sql View File

@@ -1,6 +1,6 @@
-- ------------------------------------------
-- Friendica 2020.09-rc (Red Hot Poker)
-- DB_UPDATE_VERSION 1368
-- ------------------------------------------


@@ -28,23 +28,11 @@ CREATE TABLE IF NOT EXISTS `gserver` (
`last_poco_query` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`failed` boolean COMMENT 'Connection failed',
PRIMARY KEY(`id`),
UNIQUE INDEX `nurl` (`nurl`(190))
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Global servers';

--
--
CREATE TABLE IF NOT EXISTS `clients` (
`client_id` varchar(20) NOT NULL COMMENT '',
`pw` varchar(20) NOT NULL DEFAULT '' COMMENT '',
`redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '',
`name` text COMMENT '',
`icon` text COMMENT '',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
PRIMARY KEY(`client_id`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage';

--
-- TABLE contact
--
@@ -95,11 +83,13 @@ CREATE TABLE IF NOT EXISTS `contact` (
`last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last try to update the contact info',
`success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful contact update',
`failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed update',
`failed` boolean COMMENT 'Connection failed',
`name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last post',
`last-discovery` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last follower discovery',
`priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
`blocked` boolean NOT NULL DEFAULT '1' COMMENT 'Node-wide block status',
`block_reason` text COMMENT 'Node-wide block reason',
@@ -108,6 +98,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`forum` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a forum',
`prv` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a private group',
`contact-type` tinyint NOT NULL DEFAULT 0 COMMENT '',
`manually-approve` boolean COMMENT '',
`hidden` boolean NOT NULL DEFAULT '0' COMMENT '',
`archive` boolean NOT NULL DEFAULT '0' COMMENT '',
`pending` boolean NOT NULL DEFAULT '1' COMMENT '',
@@ -129,16 +120,20 @@ CREATE TABLE IF NOT EXISTS `contact` (
PRIMARY KEY(`id`),
INDEX `uid_name` (`uid`,`name`(190)),
INDEX `self_uid` (`self`,`uid`),
INDEX `alias_uid` (`alias`(32),`uid`),
INDEX `alias_uid` (`alias`(96),`uid`),
INDEX `pending_uid` (`pending`,`uid`),
INDEX `blocked_uid` (`blocked`,`uid`),
INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`,`poll`(64),`archive`),
INDEX `uid_network_batch` (`uid`,`network`,`batch`(64)),
INDEX `addr_uid` (`addr`(32),`uid`),
INDEX `nurl_uid` (`nurl`(32),`uid`),
INDEX `addr_uid` (`addr`(96),`uid`),
INDEX `nurl_uid` (`nurl`(96),`uid`),
INDEX `nick_uid` (`nick`(32),`uid`),
INDEX `attag_uid` (`attag`(96),`uid`),
INDEX `dfrn-id` (`dfrn-id`(64)),
INDEX `issued-id` (`issued-id`(64)),
INDEX `network_uid_lastupdate` (`network`,`uid`,`last-update`),
INDEX `uid_network_self_lastupdate` (`uid`,`network`,`self`,`last-update`),
INDEX `uid_lastitem` (`uid`,`last-item`),
INDEX `gsid` (`gsid`),
FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='contact table';
@@ -155,6 +150,86 @@ CREATE TABLE IF NOT EXISTS `item-uri` (
INDEX `guid` (`guid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='URI and GUID for items';

--
-- TABLE tag
--
CREATE TABLE IF NOT EXISTS `tag` (
`id` int unsigned NOT NULL auto_increment COMMENT '',
`name` varchar(96) NOT NULL DEFAULT '' COMMENT '',
`url` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
PRIMARY KEY(`id`),
UNIQUE INDEX `type_name_url` (`name`,`url`),
INDEX `url` (`url`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='tags and mentions';

--
-- TABLE user
--
CREATE TABLE IF NOT EXISTS `user` (
`uid` mediumint unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`parent-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'The parent user that has full control about this user',
`guid` varchar(64) NOT NULL DEFAULT '' COMMENT 'A unique identifier for this user',
`username` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name that this user is known by',
`password` varchar(255) NOT NULL DEFAULT '' COMMENT 'encrypted password',
`legacy_password` boolean NOT NULL DEFAULT '0' COMMENT 'Is the password hash double-hashed?',
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT 'nick- and user name',
`email` varchar(255) NOT NULL DEFAULT '' COMMENT 'the users email address',
`openid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`timezone` varchar(128) NOT NULL DEFAULT '' COMMENT 'PHP-legal timezone',
`language` varchar(32) NOT NULL DEFAULT 'en' COMMENT 'default language',
`register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of registration',
`login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of last login',
`default-location` varchar(255) NOT NULL DEFAULT '' COMMENT 'Default for item.location',
`allow_location` boolean NOT NULL DEFAULT '0' COMMENT '1 allows to display the location',
`theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'user theme preference',
`pubkey` text COMMENT 'RSA public key 4096 bit',
`prvkey` text COMMENT 'RSA private key 4096 bit',
`spubkey` text COMMENT '',
`sprvkey` text COMMENT '',
`verified` boolean NOT NULL DEFAULT '0' COMMENT 'user is verified through email',
`blocked` boolean NOT NULL DEFAULT '0' COMMENT '1 for user is blocked',
`blockwall` boolean NOT NULL DEFAULT '0' COMMENT 'Prohibit contacts to post to the profile page of the user',
`hidewall` boolean NOT NULL DEFAULT '0' COMMENT 'Hide profile details from unkown viewers',
`blocktags` boolean NOT NULL DEFAULT '0' COMMENT 'Prohibit contacts to tag the post of this user',
`unkmail` boolean NOT NULL DEFAULT '0' COMMENT 'Permit unknown people to send private mails to this user',
`cntunkmail` int unsigned NOT NULL DEFAULT 10 COMMENT '',
`notify-flags` smallint unsigned NOT NULL DEFAULT 65535 COMMENT 'email notification options',
`page-flags` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'page/profile type',
`account-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
`prvnets` boolean NOT NULL DEFAULT '0' COMMENT '',
`pwdreset` varchar(255) COMMENT 'Password reset request token',
`pwdreset_time` datetime COMMENT 'Timestamp of the last password reset request',
`maxreq` int unsigned NOT NULL DEFAULT 10 COMMENT '',
`expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`account_removed` boolean NOT NULL DEFAULT '0' COMMENT 'if 1 the account is removed',
`account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
`account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp when account expires and will be deleted',
`expire_notification_sent` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of last warning of account expiration',
`def_gid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`allow_cid` mediumtext COMMENT 'default permission for this user',
`allow_gid` mediumtext COMMENT 'default permission for this user',
`deny_cid` mediumtext COMMENT 'default permission for this user',
`deny_gid` mediumtext COMMENT 'default permission for this user',
`openidserver` text COMMENT '',
PRIMARY KEY(`uid`),
INDEX `nickname` (`nickname`(32))
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='The local users';

--
-- TABLE clients
--
CREATE TABLE IF NOT EXISTS `clients` (
`client_id` varchar(20) NOT NULL COMMENT '',
`pw` varchar(20) NOT NULL DEFAULT '' COMMENT '',
`redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '',
`name` text COMMENT '',
`icon` text COMMENT '',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
PRIMARY KEY(`client_id`),
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage';

--
-- TABLE permissionset
--
@@ -169,18 +244,6 @@ CREATE TABLE IF NOT EXISTS `permissionset` (
INDEX `uid_allow_cid_allow_gid_deny_cid_deny_gid` (`allow_cid`(50),`allow_gid`(30),`deny_cid`(50),`deny_gid`(30))
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';

--
--
CREATE TABLE IF NOT EXISTS `tag` (
`id` int unsigned NOT NULL auto_increment COMMENT '',
`name` varchar(96) NOT NULL DEFAULT '' COMMENT '',
`url` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
PRIMARY KEY(`id`),
UNIQUE INDEX `type_name_url` (`name`,`url`),
INDEX `url` (`url`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='tags and mentions';

--
-- TABLE 2fa_app_specific_password
--
@@ -192,7 +255,8 @@ CREATE TABLE IF NOT EXISTS `2fa_app_specific_password` (
`generated` datetime NOT NULL COMMENT 'Datetime the password was generated',
`last_used` datetime COMMENT 'Datetime the password was last used',
PRIMARY KEY(`id`),
INDEX `uid_description` (`uid`,`description`(190))
INDEX `uid_description` (`uid`,`description`(190)),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor app-specific _password';

--
@@ -203,7 +267,8 @@ CREATE TABLE IF NOT EXISTS `2fa_recovery_codes` (
`code` varchar(50) NOT NULL COMMENT 'Recovery code string',
`generated` datetime NOT NULL COMMENT 'Datetime the code was generated',
`used` datetime COMMENT 'Datetime the code was used',
PRIMARY KEY(`uid`,`code`)
PRIMARY KEY(`uid`,`code`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor authentication recovery codes';

--
@@ -253,6 +318,7 @@ CREATE TABLE IF NOT EXISTS `apcontact` (
INDEX `addr` (`addr`(32)),
INDEX `alias` (`alias`(190)),
INDEX `followers` (`followers`(190)),
INDEX `baseurl` (`baseurl`(190)),
INDEX `gsid` (`gsid`),
FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='ActivityPub compatible contacts - used in the ActivityPub implementation';
@@ -276,7 +342,9 @@ CREATE TABLE IF NOT EXISTS `attach` (
`deny_gid` mediumtext COMMENT 'Access Control - list of denied groups',
`backend-class` tinytext COMMENT 'Storage backend class',
`backend-ref` text COMMENT 'Storage backend data reference',
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='file attachments';

--
@@ -337,8 +405,12 @@ CREATE TABLE IF NOT EXISTS `contact-relation` (
`cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact the related contact had interacted with',
`relation-cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'related contact who had interacted with the contact',
`last-interaction` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last interaction',
`follow-updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last update of the contact relationship',
`follows` boolean NOT NULL DEFAULT '0' COMMENT '',
PRIMARY KEY(`cid`,`relation-cid`),
INDEX `relation-cid` (`relation-cid`)
INDEX `relation-cid` (`relation-cid`),
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`relation-cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Contact relations';

--
@@ -354,7 +426,8 @@ CREATE TABLE IF NOT EXISTS `conv` (
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'edited timestamp',
`subject` text COMMENT 'subject of initial message',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='private messages';

--
@@ -409,7 +482,9 @@ CREATE TABLE IF NOT EXISTS `event` (
`deny_cid` mediumtext COMMENT 'Access Control - list of denied contact.id',
`deny_gid` mediumtext COMMENT 'Access Control - list of denied groups',
PRIMARY KEY(`id`),
INDEX `uid_start` (`uid`,`start`)
INDEX `uid_start` (`uid`,`start`),
INDEX `cid` (`cid`),
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Events';

--
@@ -451,91 +526,12 @@ CREATE TABLE IF NOT EXISTS `fsuggest` (
`photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`note` text COMMENT '',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
PRIMARY KEY(`id`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='friend suggestion stuff';

--
--
CREATE TABLE IF NOT EXISTS `gcign` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Local User id',
`gcid` int unsigned NOT NULL DEFAULT 0 COMMENT 'gcontact.id of ignored contact',
PRIMARY KEY(`id`),
INDEX `cid` (`cid`),
INDEX `uid` (`uid`),
INDEX `gcid` (`gcid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='contacts ignored by friend suggestions';

--
--
CREATE TABLE IF NOT EXISTS `gcontact` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name that this contact is known by',
`nick` varchar(255) NOT NULL DEFAULT '' COMMENT 'Nick- and user name of the contact',
`url` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link to the contacts profile page',
`nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link to the profile photo',
`connect` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`updated` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`last_discovery` datetime DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last contact discovery',
`archive_date` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
`archived` boolean NOT NULL DEFAULT '0' COMMENT '',
`location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`about` text COMMENT '',
`keywords` text COMMENT 'puplic keywords (interests)',
`gender` varchar(32) NOT NULL DEFAULT '' COMMENT 'Deprecated',
`birthday` varchar(32) NOT NULL DEFAULT '0001-01-01' COMMENT '',
`community` boolean NOT NULL DEFAULT '0' COMMENT '1 if contact is forum account',
`contact-type` tinyint NOT NULL DEFAULT -1 COMMENT '',
`hide` boolean NOT NULL DEFAULT '0' COMMENT '1 = should be hidden from search',
`nsfw` boolean NOT NULL DEFAULT '0' COMMENT '1 = contact posts nsfw content',
`network` char(4) NOT NULL DEFAULT '' COMMENT 'social network protocol',
`addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`notify` varchar(255) COMMENT '',
`alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`generation` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
`server_url` varchar(255) NOT NULL DEFAULT '' COMMENT 'baseurl of the contacts server',
`gsid` int unsigned COMMENT 'Global Server ID',
PRIMARY KEY(`id`),
UNIQUE INDEX `nurl` (`nurl`(190)),
INDEX `name` (`name`(64)),
INDEX `nick` (`nick`(32)),
INDEX `addr` (`addr`(64)),
INDEX `hide_network_updated` (`hide`,`network`,`updated`),
INDEX `updated` (`updated`),
INDEX `gsid` (`gsid`),
FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='global contacts';

--
--
CREATE TABLE IF NOT EXISTS `gfollower` (
`gcid` int unsigned NOT NULL DEFAULT 0 COMMENT 'global contact',
`follower-gcid` int unsigned NOT NULL DEFAULT 0 COMMENT 'global contact of the follower',
`deleted` boolean NOT NULL DEFAULT '0' COMMENT '1 indicates that the connection has been deleted',
PRIMARY KEY(`gcid`,`follower-gcid`),
INDEX `follower-gcid` (`follower-gcid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Followers of global contacts';

--
--
CREATE TABLE IF NOT EXISTS `glink` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
`gcid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`zcid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
PRIMARY KEY(`id`),
UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`),
INDEX `gcid` (`gcid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='\'friends of friends\' linkages derived from poco';
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='friend suggestion stuff';

--
-- TABLE group
@@ -547,7 +543,8 @@ CREATE TABLE IF NOT EXISTS `group` (
`deleted` boolean NOT NULL DEFAULT '0' COMMENT '1 indicates the group has been deleted',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT 'human readable name of group',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='privacy groups, group info';

--
@@ -559,7 +556,9 @@ CREATE TABLE IF NOT EXISTS `group_member` (
`contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact.id of the member assigned to the associated group',
PRIMARY KEY(`id`),
INDEX `contactid` (`contact-id`),
UNIQUE INDEX `gid_contactid` (`gid`,`contact-id`)
UNIQUE INDEX `gid_contactid` (`gid`,`contact-id`),
FOREIGN KEY (`gid`) REFERENCES `group` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='privacy groups, member info';

--
@@ -569,7 +568,8 @@ CREATE TABLE IF NOT EXISTS `gserver-tag` (
`gserver-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'The id of the gserver',
`tag` varchar(100) NOT NULL DEFAULT '' COMMENT 'Tag that the server has subscribed',
PRIMARY KEY(`gserver-id`,`tag`),
INDEX `tag` (`tag`)
INDEX `tag` (`tag`),
FOREIGN KEY (`gserver-id`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Tags that the server has subscribed';

--
@@ -585,6 +585,16 @@ CREATE TABLE IF NOT EXISTS `hook` (
UNIQUE INDEX `hook_file_function` (`hook`,`file`,`function`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='addon hook registry';

--
-- TABLE host
--
CREATE TABLE IF NOT EXISTS `host` (
`id` tinyint unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`name` varchar(128) NOT NULL DEFAULT '' COMMENT 'The hostname',
PRIMARY KEY(`id`),
UNIQUE INDEX `name` (`name`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Hostname';

--
-- TABLE inbox-status
--
@@ -614,7 +624,11 @@ CREATE TABLE IF NOT EXISTS `intro` (
`datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`blocked` boolean NOT NULL DEFAULT '1' COMMENT '',
`ignore` boolean NOT NULL DEFAULT '0' COMMENT '',
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
INDEX `contact-id` (`contact-id`),
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';

--
@@ -716,6 +730,7 @@ CREATE TABLE IF NOT EXISTS `item` (
INDEX `resource-id` (`resource-id`),
INDEX `deleted_changed` (`deleted`,`changed`),
INDEX `uid_wall_changed` (`uid`,`wall`,`changed`),
INDEX `uid_unseen_wall` (`uid`,`unseen`,`wall`),
INDEX `mention_uid_id` (`mention`,`uid`,`id`),
INDEX `uid_eventid` (`uid`,`event-id`),
INDEX `icid` (`icid`),
@@ -771,6 +786,7 @@ CREATE TABLE IF NOT EXISTS `item-content` (
`verb` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams verb',
PRIMARY KEY(`id`),
UNIQUE INDEX `uri-plink-hash` (`uri-plink-hash`),
FULLTEXT INDEX `title-content-warning-body` (`title`,`content-warning`,`body`),
INDEX `uri` (`uri`(191)),
INDEX `plink` (`plink`(191)),
INDEX `uri-id` (`uri-id`),
@@ -816,7 +832,8 @@ CREATE TABLE IF NOT EXISTS `mail` (
INDEX `convid` (`convid`),
INDEX `uri` (`uri`(64)),
INDEX `parent-uri` (`parent-uri`(64)),
INDEX `contactid` (`contact-id`(32))
INDEX `contactid` (`contact-id`(32)),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='private messages';

--
@@ -836,7 +853,9 @@ CREATE TABLE IF NOT EXISTS `mailacct` (
`movetofolder` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
`last_check` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Mail account data for fetching mails';

--
@@ -847,7 +866,10 @@ CREATE TABLE IF NOT EXISTS `manage` (
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
`mid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
PRIMARY KEY(`id`),
UNIQUE INDEX `uid_mid` (`uid`,`mid`)
UNIQUE INDEX `uid_mid` (`uid`,`mid`),
INDEX `mid` (`mid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`mid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='table of accounts that can manage each other';

--
@@ -875,7 +897,8 @@ CREATE TABLE IF NOT EXISTS `notify` (
PRIMARY KEY(`id`),
INDEX `seen_uid_date` (`seen`,`uid`,`date`),
INDEX `uid_date` (`uid`,`date`),
INDEX `uid_type_link` (`uid`,`type`,`link`(190))
INDEX `uid_type_link` (`uid`,`type`,`link`(190)),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='notifications';

--
@@ -889,7 +912,11 @@ CREATE TABLE IF NOT EXISTS `notify-threads` (
`parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`receiver-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
PRIMARY KEY(`id`),
INDEX `master-parent-uri-id` (`master-parent-uri-id`)
INDEX `master-parent-uri-id` (`master-parent-uri-id`),
INDEX `receiver-uid` (`receiver-uid`),
INDEX `notify-id` (`notify-id`),
FOREIGN KEY (`notify-id`) REFERENCES `notify` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`receiver-uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';

--
@@ -909,12 +936,13 @@ CREATE TABLE IF NOT EXISTS `oembed` (
--
CREATE TABLE IF NOT EXISTS `openwebauth-token` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id - currently unused',
`type` varchar(32) NOT NULL DEFAULT '' COMMENT 'Verify type',
`token` varchar(255) NOT NULL DEFAULT '' COMMENT 'A generated token',
`meta` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of creation',
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Store OpenWebAuth token to verify contacts';

--
@@ -940,7 +968,10 @@ CREATE TABLE IF NOT EXISTS `participation` (
`fid` int unsigned NOT NULL COMMENT '',
PRIMARY KEY(`iid`,`server`),
INDEX `cid` (`cid`),
INDEX `fid` (`fid`)
INDEX `fid` (`fid`),
FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`fid`) REFERENCES `fcontact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Storage for participation messages from Diaspora';

--
@@ -953,7 +984,8 @@ CREATE TABLE IF NOT EXISTS `pconfig` (
`k` varbinary(100) NOT NULL DEFAULT '' COMMENT '',
`v` mediumtext COMMENT '',
PRIMARY KEY(`id`),
UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`)
UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='personal (per user) configuration storage';

--
@@ -992,40 +1024,10 @@ CREATE TABLE IF NOT EXISTS `photo` (
INDEX `uid_profile` (`uid`,`profile`),
INDEX `uid_album_scale_created` (`uid`,`album`(32),`scale`,`created`),
INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`,`created`),
INDEX `resource-id` (`resource-id`)
INDEX `resource-id` (`resource-id`),
FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='photo storage';

--
--
CREATE TABLE IF NOT EXISTS `poll` (
`id` int unsigned NOT NULL auto_increment COMMENT '',
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
`q0` text COMMENT '',
`q1` text COMMENT '',
`q2` text COMMENT '',
`q3` text COMMENT '',
`q4` text COMMENT '',
`q5` text COMMENT '',
`q6` text COMMENT '',
`q7` text COMMENT '',
`q8` text COMMENT '',
`q9` text COMMENT '',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Currently unused table for storing poll results';

--
--
CREATE TABLE IF NOT EXISTS `poll_result` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`poll_id` int unsigned NOT NULL DEFAULT 0,
`choice` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY(`id`),
INDEX `poll_id` (`poll_id`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='data for polls - currently unused';

--
-- TABLE post-category
--
@@ -1134,7 +1136,8 @@ CREATE TABLE IF NOT EXISTS `profile` (
`net-publish` boolean NOT NULL DEFAULT '0' COMMENT 'publish profile in global directory',
PRIMARY KEY(`id`),
INDEX `uid_is-default` (`uid`,`is-default`),
FULLTEXT INDEX `pub_keywords` (`pub_keywords`)
FULLTEXT INDEX `pub_keywords` (`pub_keywords`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='user profiles data';

--
@@ -1147,7 +1150,11 @@ CREATE TABLE IF NOT EXISTS `profile_check` (
`dfrn_id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`sec` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `cid` (`cid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='DFRN remote auth use';

--
@@ -1166,6 +1173,7 @@ CREATE TABLE IF NOT EXISTS `profile_field` (
INDEX `uid` (`uid`),
INDEX `order` (`order`),
INDEX `psid` (`psid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`psid`) REFERENCES `permissionset` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Custom profile fields';

@@ -1184,7 +1192,9 @@ CREATE TABLE IF NOT EXISTS `push_subscriber` (
`renewed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of last subscription renewal',
`secret` varchar(255) NOT NULL DEFAULT '' COMMENT '',
PRIMARY KEY(`id`),
INDEX `next_try` (`next_try`)
INDEX `next_try` (`next_try`),
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Used for OStatus: Contains feed subscribers';

--
@@ -1198,7 +1208,9 @@ CREATE TABLE IF NOT EXISTS `register` (
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`language` varchar(16) NOT NULL DEFAULT '' COMMENT '',
`note` text COMMENT '',
PRIMARY KEY(`id`)
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='registrations requiring admin approval';

--
@@ -1209,7 +1221,8 @@ CREATE TABLE IF NOT EXISTS `search` (
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
`term` varchar(255) NOT NULL DEFAULT '' COMMENT '',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
INDEX `uid` (`uid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';

--
@@ -1277,6 +1290,7 @@ CREATE TABLE IF NOT EXISTS `thread` (
INDEX `uid_wall_received` (`uid`,`wall`,`received`),
INDEX `private_wall_origin_commented` (`private`,`wall`,`origin`,`commented`),
INDEX `uri-id` (`uri-id`),
FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Thread related data';

@@ -1292,62 +1306,11 @@ CREATE TABLE IF NOT EXISTS `tokens` (
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
PRIMARY KEY(`id`),
INDEX `client_id` (`client_id`),
FOREIGN KEY (`client_id`) REFERENCES `clients` (`client_id`) ON UPDATE RESTRICT ON DELETE CASCADE
INDEX `uid` (`uid`),
FOREIGN KEY (`client_id`) REFERENCES `clients` (`client_id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth usage';

--
--
CREATE TABLE IF NOT EXISTS `user` (
`uid` mediumint unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`parent-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'The parent user that has full control about this user',
`guid` varchar(64) NOT NULL DEFAULT '' COMMENT 'A unique identifier for this user',
`username` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name that this user is known by',
`password` varchar(255) NOT NULL DEFAULT '' COMMENT 'encrypted password',
`legacy_password` boolean NOT NULL DEFAULT '0' COMMENT 'Is the password hash double-hashed?',
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT 'nick- and user name',
`email` varchar(255) NOT NULL DEFAULT '' COMMENT 'the users email address',
`openid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`timezone` varchar(128) NOT NULL DEFAULT '' COMMENT 'PHP-legal timezone',
`language` varchar(32) NOT NULL DEFAULT 'en' COMMENT 'default language',
`register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of registration',
`login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of last login',
`default-location` varchar(255) NOT NULL DEFAULT '' COMMENT 'Default for item.location',
`allow_location` boolean NOT NULL DEFAULT '0' COMMENT '1 allows to display the location',
`theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'user theme preference',
`pubkey` text COMMENT 'RSA public key 4096 bit',
`prvkey` text COMMENT 'RSA private key 4096 bit',
`spubkey` text COMMENT '',
`sprvkey` text COMMENT '',
`verified` boolean NOT NULL DEFAULT '0' COMMENT 'user is verified through email',
`blocked` boolean NOT NULL DEFAULT '0' COMMENT '1 for user is blocked',
`blockwall` boolean NOT NULL DEFAULT '0' COMMENT 'Prohibit contacts to post to the profile page of the user',
`hidewall` boolean NOT NULL DEFAULT '0' COMMENT 'Hide profile details from unkown viewers',
`blocktags` boolean NOT NULL DEFAULT '0' COMMENT 'Prohibit contacts to tag the post of this user',
`unkmail` boolean NOT NULL DEFAULT '0' COMMENT 'Permit unknown people to send private mails to this user',
`cntunkmail` int unsigned NOT NULL DEFAULT 10 COMMENT '',
`notify-flags` smallint unsigned NOT NULL DEFAULT 65535 COMMENT 'email notification options',
`page-flags` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'page/profile type',
`account-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
`prvnets` boolean NOT NULL DEFAULT '0' COMMENT '',
`pwdreset` varchar(255) COMMENT 'Password reset request token',
`pwdreset_time` datetime COMMENT 'Timestamp of the last password reset request',
`maxreq` int unsigned NOT NULL DEFAULT 10 COMMENT '',
`expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`account_removed` boolean NOT NULL DEFAULT '0' COMMENT 'if 1 the account is removed',
`account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
`account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp when account expires and will be deleted',
`expire_notification_sent` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of last warning of account expiration',
`def_gid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`allow_cid` mediumtext COMMENT 'default permission for this user',
`allow_gid` mediumtext COMMENT 'default permission for this user',
`deny_cid` mediumtext COMMENT 'default permission for this user',
`deny_gid` mediumtext COMMENT 'default permission for this user',
`openidserver` text COMMENT '',
PRIMARY KEY(`uid`),
INDEX `nickname` (`nickname`(32))
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='The local users';

--
-- TABLE userd
--
@@ -1367,7 +1330,10 @@ CREATE TABLE IF NOT EXISTS `user-contact` (
`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',
PRIMARY KEY(`uid`,`cid`)
PRIMARY KEY(`uid`,`cid`),
INDEX `cid` (`cid`),
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User specific public contact data';

--
@@ -1382,7 +1348,9 @@ CREATE TABLE IF NOT EXISTS `user-item` (
`notification-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY(`uid`,`iid`),
INDEX `uid_pinned` (`uid`,`pinned`),
INDEX `iid_uid` (`iid`,`uid`)
INDEX `iid_uid` (`iid`,`uid`),
FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User specific item data';

--
@@ -1422,6 +1390,7 @@ CREATE TABLE IF NOT EXISTS `workerqueue` (
INDEX `done_priority_created` (`done`,`priority`,`created`),
INDEX `done_priority_next_try` (`done`,`priority`,`next_try`),
INDEX `done_pid_next_try` (`done`,`pid`,`next_try`),
INDEX `done_pid_retrial` (`done`,`pid`,`retrial`),
INDEX `done_pid_priority_created` (`done`,`pid`,`priority`,`created`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Background tasks queue entries';

@@ -1460,6 +1429,65 @@ CREATE VIEW `tag-view` AS SELECT
LEFT JOIN `tag` ON `post-tag`.`tid` = `tag`.`id`
LEFT JOIN `contact` ON `post-tag`.`cid` = `contact`.`id`;

--
-- VIEW network-item-view
--
DROP VIEW IF EXISTS `network-item-view`;
CREATE VIEW `network-item-view` AS SELECT
`item`.`parent-uri-id` AS `uri-id`,
`item`.`parent-uri` AS `uri`,
`item`.`parent` AS `parent`,
`item`.`received` AS `received`,
`item`.`commented` AS `commented`,
`item`.`created` AS `created`,
`item`.`uid` AS `uid`,
`item`.`starred` AS `starred`,
`item`.`mention` AS `mention`,
`item`.`network` AS `network`,
`item`.`unseen` AS `unseen`,
`item`.`gravity` AS `gravity`,
`item`.`contact-id` AS `contact-id`
FROM `item`
INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid`
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id`
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id`
WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`);

--
-- VIEW network-thread-view
--
DROP VIEW IF EXISTS `network-thread-view`;
CREATE VIEW `network-thread-view` AS SELECT
`item`.`uri-id` AS `uri-id`,
`item`.`uri` AS `uri`,
`item`.`parent-uri-id` AS `parent-uri-id`,
`thread`.`iid` AS `parent`,
`thread`.`received` AS `received`,
`thread`.`commented` AS `commented`,
`thread`.`created` AS `created`,
`thread`.`uid` AS `uid`,
`thread`.`starred` AS `starred`,
`thread`.`mention` AS `mention`,
`thread`.`network` AS `network`,
`thread`.`contact-id` AS `contact-id`
FROM `thread`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid`
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid`
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id`
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id`
WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`);

--
-- VIEW owner-view
--
@@ -1524,11 +1552,11 @@ CREATE VIEW `owner-view` AS SELECT
`contact`.`forum` AS `forum`,
`contact`.`prv` AS `prv`,
`contact`.`contact-type` AS `contact-type`,
`contact`.`manually-approve` AS `manually-approve`,
`contact`.`hidden` AS `hidden`,
`contact`.`archive` AS `archive`,
`contact`.`pending` AS `pending`,
`contact`.`deleted` AS `deleted`,
`contact`.`rating` AS `rating`,
`contact`.`unsearchable` AS `unsearchable`,
`contact`.`sensitive` AS `sensitive`,
`contact`.`baseurl` AS `baseurl`,


+ 4
- 8
doc/Addons.md View File

@@ -518,10 +518,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
Hook::callAll('item_photo_menu', $args);
Hook::callAll('jot_tool', $jotplugins);

### include/items.php

Hook::callAll('page_info_data', $data);

### mod/directory.php

Hook::callAll('directory_item', $arr);
@@ -608,10 +604,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-

Hook::callAll('post_local_end', $arr);

### mod/lockview.php

Hook::callAll('lockview_content', $item);

### mod/uexport.php

Hook::callAll('uexport_options', $options);
@@ -683,6 +675,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
Hook::callAll('register_account', $uid);
Hook::callAll('remove_user', $user);

### src/Module/PermissionTooltip.php

Hook::callAll('lockview_content', $item);

### src/Content/ContactBlock.php

Hook::callAll('contact_block_end', $arr);


+ 30
- 33
doc/Forums.md View File

@@ -4,49 +4,46 @@ Forums
* [Home](help)


Friendica also lets you create forums and/or celebrity accounts.
Friendica also lets you create community forums and other types of accounts that can function as discussion forums, celebrity accounts, announcement channels, news reflectors, or organization pages, depending on how you want to interact with others. Management of these pages can be delegated to other accounts, or a parent account can be designated to easily toggle multiple identities.

Every page in Friendica has a nickname and these must all be unique.
This applies to all forums, whether they are normal profiles or forum profiles.
Every page in Friendica has a nickname and these must all be unique. This applies to all forums, whether they are normal profiles or forum profiles.

Therefore the first thing you need to do to create a new forum is to register a new account for the forum.
Please note that the site administrator can restrict and/or regulate the registration of new accounts.

If you create a second account on a system and use the same email address or OpenID account as an existing account, you will no longer be able to use the email address (or OpenID) to log in to the account.
You should log in using the account nickname instead.
Managing Accounts
---

On the new account, visit the 'Settings' page.