summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-07-12 10:57:19 +0200
committerGitHub <noreply@github.com>2024-07-12 10:57:19 +0200
commit9c52022eb28ad6fd302c58d1627a4b73c8102f46 (patch)
treee147993aef81542d644fe0fad8529148fe4986a6
parent04d2c502673c83ebe8c32d1d0c5b2297c763682f (diff)
parent0663e0f66227615f3ccee23cfc460ad3a4f7394a (diff)
Merge pull request #12685 from nextcloud/bugfix/noid/fix-more-federation-urls
fix(federation): Also fix room::remote_server and pcm::remote_server_url
-rw-r--r--appinfo/info.xml2
-rw-r--r--lib/Migration/Version19000Date20240709183938.php (renamed from lib/Migration/Version19000Date20240709183937.php)19
2 files changed, 14 insertions, 7 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml
index bf4c0e5a0..296110543 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -18,7 +18,7 @@
* 🌉 **Sync with other chat solutions** With [Matterbridge](https://github.com/42wim/matterbridge/) being integrated in Talk, you can easily sync a lot of other chat solutions to Nextcloud Talk and vice-versa.
]]></description>
- <version>20.0.0-dev.3</version>
+ <version>20.0.0-dev.4</version>
<licence>agpl</licence>
<author>Daniel Calviño Sánchez</author>
diff --git a/lib/Migration/Version19000Date20240709183937.php b/lib/Migration/Version19000Date20240709183938.php
index 4b133f6ea..f2c54adf7 100644
--- a/lib/Migration/Version19000Date20240709183937.php
+++ b/lib/Migration/Version19000Date20240709183938.php
@@ -19,7 +19,7 @@ use OCP\Migration\SimpleMigrationStep;
* Heal federation from before Nextcloud 29.0.4 which sends requests
* without the protocol on the remote in case it is https://
*/
-class Version19000Date20240709183937 extends SimpleMigrationStep {
+class Version19000Date20240709183938 extends SimpleMigrationStep {
public function __construct(
protected IDBConnection $connection,
) {
@@ -32,15 +32,22 @@ class Version19000Date20240709183937 extends SimpleMigrationStep {
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
+ $this->addMissingProtocol('talk_invitations', 'remote_server_url');
+ $this->addMissingProtocol('talk_proxy_messages', 'remote_server_url');
+ $this->addMissingProtocol('talk_rooms', 'remote_server');
+ }
+
+ protected function addMissingProtocol(string $table, string $column): void {
$query = $this->connection->getQueryBuilder();
- $query->update('talk_invitations')
- ->set('remote_server_url', $query->func()->concat($query->createNamedParameter('https://'), 'remote_server_url'))
- ->where($query->expr()->notLike('remote_server_url', $query->createNamedParameter(
+ $query->update($table)
+ ->set($column, $query->func()->concat($query->createNamedParameter('https://'), $column))
+ ->where($query->expr()->notLike($column, $query->createNamedParameter(
$this->connection->escapeLikeParameter('http://'). '%'
)))
- ->andWhere($query->expr()->notLike('remote_server_url', $query->createNamedParameter(
+ ->andWhere($query->expr()->notLike($column, $query->createNamedParameter(
$this->connection->escapeLikeParameter('https://'). '%'
- )));
+ )))
+ ->andWhere($query->expr()->nonEmptyString($column));
$query->executeStatement();
}
}