Skip to content

Commit

Permalink
Merge pull request #12687 from nextcloud/backport/12685/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(federation): Also fix room::remote_server and pcm::remote_server_url
  • Loading branch information
nickvergessen authored Jul 12, 2024
2 parents 429858d + 4826c07 commit 69bd2ee
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4']
php-versions: ['8.2']
server-versions: ['stable29']
guests-versions: ['master']
guests-versions: ['stable29']
call-summary-bot-versions: ['main']
notifications-versions: ['stable29']

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4']
php-versions: ['8.2']
server-versions: ['stable29']
guests-versions: ['master']
guests-versions: ['stable29']
call-summary-bot-versions: ['main']
notifications-versions: ['stable29']

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4']
php-versions: ['8.3']
server-versions: ['stable29']
guests-versions: ['master']
guests-versions: ['stable29']
call-summary-bot-versions: ['main']
notifications-versions: ['stable29']

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4']
php-versions: ['8.2']
server-versions: ['stable29']
guests-versions: ['master']
guests-versions: ['stable29']
call-summary-bot-versions: ['main']
notifications-versions: ['stable29']

Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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>19.0.5</version>
<version>19.0.6-dev.1</version>
<licence>agpl</licence>

<author>Daniel Calviño Sánchez</author>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* 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,
) {
Expand All @@ -32,15 +32,22 @@ public function __construct(
* @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();
}
}

0 comments on commit 69bd2ee

Please sign in to comment.