Skip to content

Commit

Permalink
fixup! feat(conversation): add federated typing indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
miaulalala committed Feb 25, 2025
1 parent 3c8978a commit 5d2300b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Federation/Proxy/TalkV1/ProxyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ServerException;
use OC\Http\Client\Response;
use OCA\Talk\AppInfo\Application;
use OCA\Talk\Exceptions\CannotReachRemoteException;
use OCA\Talk\Exceptions\RemoteClientException;
use OCA\Talk\Participant;
use OCP\AppFramework\Http;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
Expand All @@ -34,13 +36,14 @@ public function __construct(
}

public function overwrittenRemoteTalkHash(string $hash): string {
$typingIndicator = $this->config->getUserValue($this->userSession->getUser(), Application::APP_ID, 'typing_privacy', Participant::PRIVACY_PRIVATE);

Check failure on line 39 in lib/Federation/Proxy/TalkV1/ProxyRequest.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

InvalidArgument

lib/Federation/Proxy/TalkV1/ProxyRequest.php:39:50: InvalidArgument: Argument 1 of OCP\IConfig::getUserValue expects null|string, but OCP\IUser|null provided (see https://psalm.dev/004)
return sha1(json_encode([
'remoteHash' => $hash,
'manipulated' => [
'config' => [
'chat' => [
'read-privacy',
'typing-privacy',
'typing-privacy' => $typingIndicator,
],
'call' => [
'blur-virtual-background',
Expand Down
40 changes: 40 additions & 0 deletions lib/Migration/Version22000Date20250224113228.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Talk\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

class Version22000Date20250224113228 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$table = $schema->getTable('talk_attendees');
if (!$table->hasColumn('archived')) {
$table->addColumn('archived', Types::BOOLEAN, [
'default' => 0,
'notnull' => false,
]);
}

return $schema;
}
}

0 comments on commit 5d2300b

Please sign in to comment.