fluffychat merge

pull/1186/head
ggurdin 1 year ago
commit c9b6c52761

File diff suppressed because it is too large Load Diff

@ -2381,7 +2381,7 @@
"@invitePrivateChat": {},
"invalidInput": "Ungültige Eingabe!",
"@invalidInput": {},
"hasKnocked": "{user} hat angeklopft",
"hasKnocked": "🚪 {user} hat angeklopft",
"@hasKnocked": {
"placeholders": {
"user": {}
@ -2676,5 +2676,18 @@
"usersMustKnock": "Benutzer müssen anklopfen",
"@usersMustKnock": {},
"noOneCanJoin": "Niemand kann beitreten",
"@noOneCanJoin": {}
"@noOneCanJoin": {},
"createNewAddress": "Neue Adresse erstellen",
"@createNewAddress": {},
"userRole": "Benutzerrolle",
"@userRole": {},
"minimumPowerLevel": "{level} is das minimale Power-Level.",
"@minimumPowerLevel": {
"type": "text",
"placeholders": {
"level": {}
}
},
"publicChatAddresses": "Öffentliche Chat-Adressen",
"@publicChatAddresses": {}
}

@ -2286,7 +2286,7 @@
},
"addChatDescription": "채팅 설명 추가하기...",
"@addChatDescription": {},
"hasKnocked": "{user}가 입장을 요청했습니다",
"hasKnocked": "🚪 {user}가 입장을 요청했습니다",
"@hasKnocked": {
"placeholders": {
"user": {}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -2293,7 +2293,7 @@
"type": "text",
"placeholders": {}
},
"reportErrorDescription": "Olamaz. Bir şeyler yanlış gitti. Lütfen daha sonra tekrar deneyin. İsterseniz hatayı geliştiricilere bildirebilirsiniz.",
"reportErrorDescription": "😭 Olamaz. Bir şeyler yanlış gitti. İsterseniz bu hatayı geliştiricilere bildirebilirsiniz.",
"@reportErrorDescription": {},
"report": "bildir",
"@report": {},
@ -2405,7 +2405,7 @@
"@makeAdminDescription": {},
"archiveRoomDescription": "Sohbet arşive taşınacak. Diğer kullanıcıları sohbeti terk ettiğinizi görebilecek.",
"@archiveRoomDescription": {},
"hasKnocked": "{user} tıklattı",
"hasKnocked": "🚪 {user} tıklattı",
"@hasKnocked": {
"placeholders": {
"user": {}
@ -2442,7 +2442,7 @@
"@startConversation": {},
"blockedUsers": "Engellenen kullanıcılar",
"@blockedUsers": {},
"block": "engelle",
"block": "Engelle",
"@block": {},
"commandHint_sendraw": "Ham JSON gönder",
"@commandHint_sendraw": {},
@ -2453,5 +2453,241 @@
"databaseMigrationTitle": "Veri tabanı iyileştirildi",
"@databaseMigrationTitle": {},
"databaseMigrationBody": "Lütfen bekleyin. Bu biraz zaman alabilir.",
"@databaseMigrationBody": {}
"@databaseMigrationBody": {},
"youInvitedToBy": "📩 Bağlantı aracılığıyla davet edildiniz:\n{alias}",
"@youInvitedToBy": {
"placeholders": {
"alias": {}
}
},
"pleaseEnterYourCurrentPassword": "Lütfen geçerli parolanızı girin",
"@pleaseEnterYourCurrentPassword": {},
"pleaseChooseAStrongPassword": "Lütfen güçlü bir parola seçin",
"@pleaseChooseAStrongPassword": {},
"addChatOrSubSpace": "Sohbet veya alt alan ekle",
"@addChatOrSubSpace": {},
"canceledKeyVerification": "{sender} anahtar doğrulamayı iptal etti",
"@canceledKeyVerification": {
"type": "text",
"placeholders": {
"sender": {}
}
},
"publicLink": "Herkese açık bağlantı",
"@publicLink": {},
"joinSpace": "Alana katıl",
"@joinSpace": {},
"newPassword": "Yeni parola",
"@newPassword": {},
"databaseBuildErrorBody": "SQlite veri tabanı oluşturulamadı. Uygulama şimdilik eski veri tabanını kullanmaya çalışıyor. Lütfen bu hatayı {url} adresinde geliştiricilere bildirin. Hata mesajı: {error}",
"@databaseBuildErrorBody": {
"type": "text",
"placeholders": {
"url": {},
"error": {}
}
},
"sessionLostBody": "Oturumunuz kayboldu. Lütfen bu hatayı {url} adresinde geliştiricilere bildirin. Hata mesajı: {error}",
"@sessionLostBody": {
"type": "text",
"placeholders": {
"url": {},
"error": {}
}
},
"subspace": "Alt alan",
"@subspace": {},
"thisDevice": "Bu aygıt:",
"@thisDevice": {},
"formattedMessagesDescription": "Markdown kullanarak kalın metin gibi zengin mesaj içeriğini görüntüle.",
"@formattedMessagesDescription": {},
"verifyOtherDevice": "🔐 Diğer aygıtı doğrula",
"@verifyOtherDevice": {},
"presencesToggle": "Diğer kullanıcıların durum mesajlarını göster",
"@presencesToggle": {
"type": "text",
"placeholders": {}
},
"presenceStyle": "Bulunma:",
"@presenceStyle": {
"type": "text",
"placeholders": {}
},
"searchForUsers": "@kullanıcıları ara...",
"@searchForUsers": {},
"commandHint_ignore": "Verilen matrix kimliğini görmezden gel",
"@commandHint_ignore": {},
"commandHint_unignore": "Verilen matrix kimliğini görmezden gelmeyi iptal et",
"@commandHint_unignore": {},
"appLockDescription": "Kullanılmadığında PIN kodu ile uygulamayı kilitle",
"@appLockDescription": {},
"globalChatId": "Genel sohbet kimliği",
"@globalChatId": {},
"accessAndVisibility": "Erişim ve görünürlük",
"@accessAndVisibility": {},
"accessAndVisibilityDescription": "Bu sohbete kimlerin katılmasına izin verilir ve sohbet nasıl keşfedilebilir.",
"@accessAndVisibilityDescription": {},
"calls": "Aramalar",
"@calls": {},
"customEmojisAndStickers": "Özel emojiler ve çıkartmalar",
"@customEmojisAndStickers": {},
"customEmojisAndStickersBody": "Herhangi bir sohbette kullanılabilecek özel emojiler veya çıkartmalar ekleyin veya paylaşın.",
"@customEmojisAndStickersBody": {},
"hideRedactedMessages": "Düzenlenen mesajları gizle",
"@hideRedactedMessages": {},
"hideRedactedMessagesBody": "Birisi bir mesajı düzenlerse, bu mesaj artık sohbette görünmeyecektir.",
"@hideRedactedMessagesBody": {},
"hideMemberChangesInPublicChats": "Herkese açık sohbetlerde üye değişikliklerini gizle",
"@hideMemberChangesInPublicChats": {},
"hideMemberChangesInPublicChatsBody": "Okunabilirliği artırmak için birisi herkese açık bir sohbete katıldığında veya sohbetten ayrıldığında sohbet zaman çizelgesinde gösterme.",
"@hideMemberChangesInPublicChatsBody": {},
"passwordRecoverySettings": "Parola kurtarma ayarları",
"@passwordRecoverySettings": {},
"userWouldLikeToChangeTheChat": "{user} sohbete katılmak istiyor.",
"@userWouldLikeToChangeTheChat": {
"placeholders": {
"user": {}
}
},
"noPublicLinkHasBeenCreatedYet": "Henüz herkese açık bir bağlantı oluşturulmadı",
"@noPublicLinkHasBeenCreatedYet": {},
"knock": "Tıklat",
"@knock": {},
"knocking": "Tıklat",
"@knocking": {},
"usersMustKnock": "Kullanıcılar tıklatmalı",
"@usersMustKnock": {},
"noOneCanJoin": "Kimse katılamaz",
"@noOneCanJoin": {},
"nothingFound": "Hiçbir şey bulunamadı...",
"@nothingFound": {},
"sendReadReceiptsDescription": "Sohbetteki diğer katılımcılar bir mesajı okuduğunuzu görebilir.",
"@sendReadReceiptsDescription": {},
"verifyOtherDeviceDescription": "Başka bir aygıtı doğruladığınızda, bu aygıtlar anahtarları değiş tokuş ederek genel güvenliğinizi artırır. 💪 Bir doğrulama başlattığınızda, her iki aygıttaki uygulamada bir açılır pencere görünecektir. Orada birbirleriyle karşılaştırmanız gereken bir dizi emoji veya sayı göreceksiniz. Doğrulamaya başlamadan önce her iki aygıtın da elinizin altında olması en iyisidir. 🤳",
"@verifyOtherDeviceDescription": {},
"noDatabaseEncryption": "Veri tabanı şifrelemesi bu platformda desteklenmiyor",
"@noDatabaseEncryption": {},
"thereAreCountUsersBlocked": "Şu anda {count} engellenen kullanıcı var.",
"@thereAreCountUsersBlocked": {
"type": "text",
"count": {}
},
"publicSpaces": "Herkese açık alanlar",
"@publicSpaces": {},
"initAppError": "Uygulama başlatılırken bir hata oluştu",
"@initAppError": {},
"userRole": "Kullanıcı rolü",
"@userRole": {},
"hideInvalidOrUnknownMessageFormats": "Geçersiz veya bilinmeyen mesaj biçimlerini gizle",
"@hideInvalidOrUnknownMessageFormats": {},
"hidePresences": "Durum listesi gizlensin mi?",
"@hidePresences": {},
"overview": "Genel görünüm",
"@overview": {},
"decline": "Reddet",
"@decline": {},
"notifyMeFor": "Beni bilgilendir",
"@notifyMeFor": {},
"chatCanBeDiscoveredViaSearchOnServer": "Sohbet {server} üzerinde aranarak keşfedilebilir",
"@chatCanBeDiscoveredViaSearchOnServer": {
"type": "text",
"placeholders": {
"server": {}
}
},
"leaveEmptyToClearStatus": "Durumunuzu temizlemek için boş bırakın.",
"@leaveEmptyToClearStatus": {},
"select": "Seç",
"@select": {},
"minimumPowerLevel": "{level} en düşük güç seviyesidir.",
"@minimumPowerLevel": {
"type": "text",
"placeholders": {
"level": {}
}
},
"passwordsDoNotMatch": "Parolalar eşleşmiyor",
"@passwordsDoNotMatch": {},
"passwordIsWrong": "Girdiğiniz parola yanlış",
"@passwordIsWrong": {},
"publicChatAddresses": "Herkese açık sohbet adresleri",
"@publicChatAddresses": {},
"createNewAddress": "Yeni adres oluştur",
"@createNewAddress": {},
"forwardMessageTo": "Mesajlar {roomName} kişisine iletilsin mi?",
"@forwardMessageTo": {
"type": "text",
"placeholders": {
"roomName": {}
}
},
"acceptedKeyVerification": "{sender} anahtar doğrulamayı kabul etti",
"@acceptedKeyVerification": {
"type": "text",
"placeholders": {
"sender": {}
}
},
"restoreSessionBody": "Uygulama şimdi oturumunuzu yedekten geri yüklemeye çalışıyor. Lütfen bu hatayı {url} adresinde geliştiricilere bildirin. Hata mesajı: {error}",
"@restoreSessionBody": {
"type": "text",
"placeholders": {
"url": {},
"error": {}
}
},
"sendReadReceipts": "Okundu bilgisi gönder",
"@sendReadReceipts": {},
"completedKeyVerification": "{sender} anahtar doğrulamayı tamamladı",
"@completedKeyVerification": {
"type": "text",
"placeholders": {
"sender": {}
}
},
"sendTypingNotificationsDescription": "Sohbetteki diğer katılımcılar yeni bir mesaj yazdığınızı görebilir.",
"@sendTypingNotificationsDescription": {},
"isReadyForKeyVerification": "{sender} anahtar doğrulama için hazır",
"@isReadyForKeyVerification": {
"type": "text",
"placeholders": {
"sender": {}
}
},
"formattedMessages": "Biçimlendirilen mesajlar",
"@formattedMessages": {},
"requestedKeyVerification": "{sender} anahtar doğrulama istedi",
"@requestedKeyVerification": {
"type": "text",
"placeholders": {
"sender": {}
}
},
"verifyOtherUser": "🔐 Diğer kullanıcıyı doğrula",
"@verifyOtherUser": {},
"startedKeyVerification": "{sender} anahtar doğrulama başlattı",
"@startedKeyVerification": {
"type": "text",
"placeholders": {
"sender": {}
}
},
"transparent": "Şeffaf",
"@transparent": {},
"discover": "Keşfet",
"@discover": {},
"incomingMessages": "Gelen mesajlar",
"@incomingMessages": {},
"verifyOtherUserDescription": "Başka bir kullanıcıyı doğrularsanız, gerçekten kime yazdığınızı bildiğinizden emin olabilirsiniz. 💪\n\nBir doğrulama başlattığınızda, siz ve diğer kullanıcı uygulamada bir açılır pencere görecektir. Orada birbirinizle karşılaştırmanız gereken bir dizi emoji veya sayı göreceksiniz.\n\nBunu yapmanın en iyi yolu buluşmak veya bir görüntülü arama başlatmaktır. 👭",
"@verifyOtherUserDescription": {},
"stickers": "Çıkartmalar",
"@stickers": {},
"unreadChatsInApp": "{appname}: {unread} okunmayan sohbet",
"@unreadChatsInApp": {
"type": "text",
"placeholders": {
"appname": {},
"unread": {}
}
}
}

@ -1505,25 +1505,12 @@ class ChatController extends State<ChatPageWithRoom>
);
if (callType == null) return;
final success = await showFutureLoadingDialog(
context: context,
future: () =>
Matrix.of(context).voipPlugin!.voip.requestTurnServerCredentials(),
);
if (success.result != null) {
final voipPlugin = Matrix.of(context).voipPlugin;
try {
await voipPlugin!.voip.inviteToCall(room.id, callType);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e.toLocalizedString(context))),
);
}
} else {
await showOkAlertDialog(
context: context,
title: L10n.of(context)!.unavailable,
okLabel: L10n.of(context)!.next,
final voipPlugin = Matrix.of(context).voipPlugin;
try {
await voipPlugin!.voip.inviteToCall(room, callType);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e.toLocalizedString(context))),
);
}
}

@ -255,7 +255,7 @@ class _SpaceViewState extends State<SpaceView> {
room != null &&
room.ownPowerLevel >= ClassDefaultValues.powerLevelOfAdmin &&
// Pangea#
(activeSpace?.canChangeStateEvent(EventTypes.spaceChild) ?? false))
(activeSpace?.canChangeStateEvent(EventTypes.SpaceChild) ?? false))
SheetAction(
key: SpaceChildContextAction.removeFromSpace,
label: L10n.of(context)!.removeFromSpace,
@ -847,7 +847,7 @@ class _SpaceViewState extends State<SpaceView> {
),
// #Pangea
// if (activeSpace?.canChangeStateEvent(
// EventTypes.spaceChild,
// EventTypes.SpaceChild,
// ) ==
// true)
// Material(

@ -20,14 +20,18 @@ import 'dart:async';
import 'dart:math';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/voip/video_renderer.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart' hide VideoRenderer;
import 'package:just_audio/just_audio.dart';
import 'package:matrix/matrix.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
@ -74,19 +78,13 @@ class _StreamView extends StatelessWidget {
child: Stack(
alignment: Alignment.center,
children: <Widget>[
if (videoMuted)
Container(
color: Colors.transparent,
),
if (!videoMuted)
RTCVideoView(
// yes, it must explicitly be casted even though I do not feel
// comfortable with it...
wrappedStream.renderer as RTCVideoRenderer,
mirror: mirrored,
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
),
if (videoMuted)
VideoRenderer(
wrappedStream,
mirror: mirrored,
fit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
),
if (videoMuted) ...[
Container(color: Colors.black54),
Positioned(
child: Avatar(
mxContent: avatarUrl,
@ -97,6 +95,7 @@ class _StreamView extends StatelessWidget {
// matrixClient: matrixClient,
),
),
],
if (!isScreenSharing)
Positioned(
left: 4.0,
@ -158,8 +157,6 @@ class MyCallingPage extends State<Calling> {
return null;
}
bool get speakerOn => call.speakerOn;
bool get isMicrophoneMuted => call.isMicrophoneMuted;
bool get isLocalVideoMuted => call.isLocalVideoMuted;
@ -174,9 +171,6 @@ class MyCallingPage extends State<Calling> {
bool get connected => call.state == CallState.kConnected;
bool get mirrored => call.facingMode == 'user';
List<WrappedMediaStream> get streams => call.streams;
double? _localVideoHeight;
double? _localVideoWidth;
EdgeInsetsGeometry? _localVideoMargin;
@ -204,12 +198,12 @@ class MyCallingPage extends State<Calling> {
final call = this.call;
call.onCallStateChanged.stream.listen(_handleCallState);
call.onCallEventChanged.stream.listen((event) {
if (event == CallEvent.kFeedsChanged) {
if (event == CallStateChange.kFeedsChanged) {
setState(() {
call.tryRemoveStopedStreams();
});
} else if (event == CallEvent.kLocalHoldUnhold ||
event == CallEvent.kRemoteHoldUnhold) {
} else if (event == CallStateChange.kLocalHoldUnhold ||
event == CallStateChange.kRemoteHoldUnhold) {
setState(() {});
Logs().i(
'Call hold event: local ${call.localHold}, remote ${call.remoteOnHold}',
@ -285,7 +279,7 @@ class MyCallingPage extends State<Calling> {
if (call.isRinging) {
call.reject();
} else {
call.hangup();
call.hangup(reason: CallErrorCode.userHangup);
}
});
}
@ -340,11 +334,6 @@ class MyCallingPage extends State<Calling> {
await Helper.switchCamera(
call.localUserMediaStream!.stream!.getVideoTracks()[0],
);
if (PlatformInfos.isMobile) {
call.facingMode == 'user'
? call.facingMode = 'environment'
: call.facingMode = 'user';
}
}
setState(() {});
}
@ -449,16 +438,10 @@ class MyCallingPage extends State<Calling> {
hangupButton,
];
case CallState.kFledgling:
// TODO: Handle this case.
break;
case CallState.kWaitLocalMedia:
// TODO: Handle this case.
break;
case CallState.kCreateOffer:
// TODO: Handle this case.
break;
case CallState.kEnding:
case null:
// TODO: Handle this case.
break;
}
return <Widget>[];

@ -1,4 +1,5 @@
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pangea/pages/connect/p_sso_button.dart';
import 'package:fluffychat/pangea/widgets/common/pangea_logo_svg.dart';
import 'package:fluffychat/pangea/widgets/signup/signup_buttons.dart';
@ -259,13 +260,18 @@ class _LoginButton extends StatelessWidget {
width: double.infinity,
child: OutlinedButton.icon(
style: OutlinedButton.styleFrom(
side: BorderSide.none,
side: FluffyThemes.isColumnMode(context)
? BorderSide.none
: BorderSide(
color: Theme.of(context).colorScheme.outlineVariant,
width: 1,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(99),
),
foregroundColor: Theme.of(context).colorScheme.onBackground,
foregroundColor: Theme.of(context).colorScheme.onSurface,
backgroundColor: withBorder
? Theme.of(context).colorScheme.background
? Theme.of(context).colorScheme.surface
: Colors.transparent,
),
onPressed: onPressed,

@ -79,7 +79,7 @@ class NewSpaceController extends State<NewSpace> {
stateKey: '',
content: {
'events': {
EventTypes.spaceChild: 0,
EventTypes.SpaceChild: 0,
},
'users_default': 0,
'users': {

@ -299,7 +299,7 @@ class UserBottomSheetView extends StatelessWidget {
BorderRadius.circular(AppConfig.borderRadius / 2),
color: Theme.of(context).colorScheme.onInverseSurface,
child: DropdownButton<int>(
onChanged: user.canChangePowerLevel ||
onChanged: user.canChangeUserPowerLevel ||
// Workaround until https://github.com/famedly/matrix-dart-sdk/pull/1765
(user.room.canChangePowerLevel &&
user.id == user.room.client.userID)

@ -63,10 +63,10 @@ extension ClassAndExchangeSettingsRoomExtension on Room {
final Event? currentPower = getState(EventTypes.RoomPowerLevels);
final Map<String, dynamic>? currentPowerContent =
currentPower?.content["events"] as Map<String, dynamic>?;
final spaceChildPower = currentPowerContent?[EventTypes.spaceChild];
final spaceChildPower = currentPowerContent?[EventTypes.SpaceChild];
if (spaceChildPower == null && currentPowerContent != null) {
currentPowerContent["events"][EventTypes.spaceChild] = 0;
currentPowerContent["events"][EventTypes.SpaceChild] = 0;
await client.setRoomStateWithKey(
id,

@ -104,7 +104,7 @@ extension RoomSettingsRoomExtension on Room {
Future<bool> _isSuggestedInSpace(Room space) async {
try {
final Map<String, dynamic> resp =
await client.getRoomStateWithKey(space.id, EventTypes.spaceChild, id);
await client.getRoomStateWithKey(space.id, EventTypes.SpaceChild, id);
return resp.containsKey('suggested') ? resp['suggested'] as bool : true;
} catch (err) {
ErrorHandler.logError(

@ -90,7 +90,7 @@ extension UserPermissionsRoomExtension on Room {
if (room != null && !room._isRoomAdmin) {
return false;
}
if (!pangeaCanSendEvent(EventTypes.spaceChild) && !_isRoomAdmin) {
if (!pangeaCanSendEvent(EventTypes.SpaceChild) && !_isRoomAdmin) {
return false;
}
if (room == null) {
@ -114,7 +114,7 @@ extension UserPermissionsRoomExtension on Room {
}
bool get _canIAddSpaceParents =>
_isRoomAdmin || pangeaCanSendEvent(EventTypes.spaceParent);
_isRoomAdmin || pangeaCanSendEvent(EventTypes.SpaceParent);
//overriding the default canSendEvent to check power levels
bool _pangeaCanSendEvent(String eventType) {

@ -48,7 +48,7 @@ extension MembershipUpdate on SyncUpdate {
final List<MatrixEvent>? timelineEvents = update.value.timeline?.events;
final bool isUpdate = timelineEvents != null &&
spaceId == activeSpaceId &&
timelineEvents.any((event) => event.type == EventTypes.spaceChild);
timelineEvents.any((event) => event.type == EventTypes.SpaceChild);
if (isUpdate) return true;
}
return false;

@ -11,7 +11,7 @@ bool canAddToSpace(Room space, PangeaController pangeaController) {
space.getState(EventTypes.RoomPowerLevels)?.content ?? {};
final pl = powerLevelsMap
.tryGetMap<String, dynamic>('events')
?.tryGet<int>(EventTypes.spaceChild) ??
?.tryGet<int>(EventTypes.SpaceChild) ??
powerLevelsMap.tryGet<int>('events_default') ??
50;
return space.ownPowerLevel >= pl && pangeaPermission;

@ -1,4 +1,3 @@
import 'package:fluffychat/pangea/constants/pangea_event_types.dart';
import 'package:flutter/material.dart';
import 'package:matrix/matrix.dart';
@ -14,7 +13,7 @@ class ClassChatPowerLevels {
final Client client = Matrix.of(context).client;
final Map<String, dynamic> powerLevelOverride = {};
powerLevelOverride['events'] = {
EventTypes.spaceChild: 0,
EventTypes.SpaceChild: 0,
};
powerLevelOverride['users'] = {};

@ -22,7 +22,7 @@ Future<void> lockChat(Room room, Client client) async {
if (!powerLevelsContent.containsKey('events')) {
powerLevelsContent['events'] = Map<String, dynamic>.from({});
}
powerLevelsContent['events'][EventTypes.spaceChild] = 100;
powerLevelsContent['events'][EventTypes.SpaceChild] = 100;
await room.client.setRoomStateWithKey(
room.id,
@ -41,7 +41,7 @@ Future<void> unlockChat(Room room, Client client) async {
);
powerLevelsContent['events_default'] = 0;
powerLevelsContent['events'][EventTypes.spaceChild] = 0;
powerLevelsContent['events'][EventTypes.SpaceChild] = 0;
await room.client.setRoomStateWithKey(
room.id,

@ -8,8 +8,6 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:matrix/matrix.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:fluffychat/utils/voip_plugin.dart';
class CallKeeper {
CallKeeper(this.callKeepManager, this.call) {
call.onCallStateChanged.stream.listen(_handleCallState);
@ -40,31 +38,14 @@ class CallKeeper {
case CallState.kEnded:
callKeepManager.hangup(call.callId);
break;
/* TODO:
case CallState.kMuted:
callKeepManager.setMutedCall(uuid, true);
break;
case CallState.kHeld:
callKeepManager.setOnHold(uuid, true);
break;
*/
case CallState.kFledgling:
// TODO: Handle this case.
break;
case CallState.kInviteSent:
// TODO: Handle this case.
break;
case CallState.kWaitLocalMedia:
// TODO: Handle this case.
break;
case CallState.kCreateOffer:
// TODO: Handle this case.
break;
case CallState.kCreateAnswer:
// TODO: Handle this case.
break;
case CallState.kRinging:
// TODO: Handle this case.
case CallState.kEnding:
break;
}
}
@ -84,7 +65,6 @@ class CallKeepManager {
static final CallKeepManager _instance = CallKeepManager._internal();
late FlutterCallkeep _callKeep;
VoipPlugin? _voipPlugin;
String get appName => 'FluffyChat';
@ -130,7 +110,7 @@ class CallKeepManager {
});
call.onCallEventChanged.stream.listen(
(event) {
if (event == CallEvent.kLocalHoldUnhold) {
if (event == CallStateChange.kLocalHoldUnhold) {
Logs().i(
'Call hold event: local ${call.localHold}, remote ${call.remoteOnHold}',
);
@ -170,10 +150,7 @@ class CallKeepManager {
Future<void> initialize() async {
_callKeep.on(CallKeepPerformAnswerCallAction(), answerCall);
_callKeep.on(CallKeepDidPerformDTMFAction(), didPerformDTMFAction);
_callKeep.on(
CallKeepDidReceiveStartCallAction(),
didReceiveStartCallAction,
);
_callKeep.on(CallKeepDidToggleHoldAction(), didToggleHoldCallAction);
_callKeep.on(
CallKeepDidPerformSetMutedCallAction(),
@ -313,7 +290,7 @@ class CallKeepManager {
Future<void> endCall(CallKeepPerformEndCallAction event) async {
final keeper = calls[event.callUUID];
keeper?.call.hangup();
keeper?.call.hangup(reason: CallErrorCode.userHangup);
removeCall(event.callUUID);
}
@ -322,25 +299,6 @@ class CallKeepManager {
keeper.call.sendDTMF(event.digits!);
}
Future<void> didReceiveStartCallAction(
CallKeepDidReceiveStartCallAction event,
) async {
if (event.handle == null) {
// @TODO: sometime we receive `didReceiveStartCallAction` with handle` undefined`
return;
}
final callUUID = event.callUUID!;
if (event.callUUID == null) {
final call =
await _voipPlugin!.voip.inviteToCall(event.handle!, CallType.kVideo);
addCall(callUUID, CallKeeper(this, call));
}
await _callKeep.startCall(callUUID, event.handle!, event.handle!);
Timer(const Duration(seconds: 1), () {
_callKeep.setCurrentCallActive(callUUID);
});
}
Future<void> didPerformSetMutedCallAction(
CallKeepDidPerformSetMutedCallAction event,
) async {

@ -0,0 +1,86 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:matrix/matrix.dart';
class VideoRenderer extends StatefulWidget {
final WrappedMediaStream? stream;
final bool mirror;
final RTCVideoViewObjectFit fit;
const VideoRenderer(
this.stream, {
this.mirror = false,
this.fit = RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
super.key,
});
@override
State<StatefulWidget> createState() => _VideoRendererState();
}
class _VideoRendererState extends State<VideoRenderer> {
RTCVideoRenderer? _renderer;
bool _rendererReady = false;
MediaStream? get mediaStream => widget.stream?.stream;
StreamSubscription? _streamChangeSubscription;
Future<RTCVideoRenderer> _initializeRenderer() async {
_renderer ??= RTCVideoRenderer();
await _renderer!.initialize();
_renderer!.srcObject = mediaStream;
return _renderer!;
}
void disposeRenderer() {
try {
_renderer?.srcObject = null;
_renderer?.dispose();
_renderer = null;
// ignore: empty_catches
} catch (e) {}
}
@override
void initState() {
_streamChangeSubscription =
widget.stream?.onStreamChanged.stream.listen((stream) {
setState(() {
_renderer?.srcObject = stream;
});
});
setupRenderer();
super.initState();
}
Future<void> setupRenderer() async {
await _initializeRenderer();
setState(() => _rendererReady = true);
}
@override
void dispose() {
_streamChangeSubscription?.cancel();
disposeRenderer();
super.dispose();
}
@override
Widget build(BuildContext context) => !_rendererReady
? Container()
: Builder(
key: widget.key,
builder: (ctx) {
return RTCVideoView(
_renderer!,
mirror: widget.mirror,
filterQuality: FilterQuality.medium,
objectFit: widget.fit,
placeholderBuilder: (_) =>
Container(color: Colors.white.withOpacity(0.18)),
);
},
);
}

@ -90,11 +90,6 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate {
]) =>
webrtc_impl.createPeerConnection(configuration, constraints);
@override
VideoRenderer createRenderer() {
return webrtc_impl.RTCVideoRenderer();
}
Future<bool> get hasCallingAccount async =>
kIsWeb ? false : await CallKeepManager().hasPhoneAccountEnabled;
@ -179,12 +174,12 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate {
}
@override
Future<void> handleGroupCallEnded(GroupCall groupCall) async {
Future<void> handleGroupCallEnded(GroupCallSession groupCall) async {
// TODO: implement handleGroupCallEnded
}
@override
Future<void> handleNewGroupCall(GroupCall groupCall) async {
Future<void> handleNewGroupCall(GroupCallSession groupCall) async {
// TODO: implement handleNewGroupCall
}
@ -197,4 +192,8 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate {
Future<void> handleMissedCall(CallSession session) async {
// TODO: implement handleMissedCall
}
@override
// TODO: implement keyProvider
EncryptionKeyProvider? get keyProvider => throw UnimplementedError();
}

@ -5140,16 +5140,9 @@
"addGroupDescription",
"addNewFriend",
"alreadyHaveAnAccount",
"appLockDescription",
"classes",
"createNewGroup",
"editChatPermissions",
"globalChatId",
"accessAndVisibility",
"accessAndVisibilityDescription",
"calls",
"customEmojisAndStickers",
"customEmojisAndStickersBody",
"enterAGroupName",
"enterASpacepName",
"groupDescription",
@ -6855,10 +6848,6 @@
"clickToManageSubscription",
"emptyInviteWarning",
"errorGettingAudio",
"publicChatAddresses",
"createNewAddress",
"userRole",
"minimumPowerLevel",
"signUp",
"pleaseChooseAtLeastChars",
"noEmailWarning",
@ -27275,25 +27264,8 @@
"groupDescriptionHasBeenChanged",
"ignoreListDescription",
"ignoreUsername",
"block",
"blockedUsers",
"blockListDescription",
"optionalGroupName",
"hideMemberChangesInPublicChats",
"hideMemberChangesInPublicChatsBody",
"overview",
"notifyMeFor",
"passwordRecoverySettings",
"presenceStyle",
"presencesToggle",
"writeAMessageFlag",
"youInvitedToBy",
"usersMustKnock",
"noOneCanJoin",
"userWouldLikeToChangeTheChat",
"noPublicLinkHasBeenCreatedYet",
"knock",
"hidePresences",
"requests",
"allCorrect",
"newWayAllGood",
@ -28037,11 +28009,7 @@
"reportMessageTitle",
"reportMessageBody",
"noTeachersFound",
"yourGlobalUserIdIs",
"noUsersFoundWithQuery",
"knocking",
"chatCanBeDiscoveredViaSearchOnServer",
"searchChatsRooms",
"createClass",
"createExchange",
"viewArchive",
@ -28053,39 +28021,11 @@
"clickToManageSubscription",
"emptyInviteWarning",
"errorGettingAudio",
"nothingFound",
"groupName",
"createGroupAndInviteUsers",
"groupCanBeFoundViaSearch",
"wrongRecoveryKey",
"startConversation",
"commandHint_sendraw",
"databaseMigrationTitle",
"databaseMigrationBody",
"leaveEmptyToClearStatus",
"select",
"searchForUsers",
"pleaseEnterYourCurrentPassword",
"newPassword",
"pleaseChooseAStrongPassword",
"passwordsDoNotMatch",
"passwordIsWrong",
"publicLink",
"publicChatAddresses",
"createNewAddress",
"joinSpace",
"publicSpaces",
"addChatOrSubSpace",
"subspace",
"decline",
"thisDevice",
"initAppError",
"userRole",
"minimumPowerLevel",
"databaseBuildErrorBody",
"sessionLostBody",
"restoreSessionBody",
"forwardMessageTo",
"signUp",
"pleaseChooseAtLeastChars",
"noEmailWarning",
@ -28106,21 +28046,11 @@
"enableModerationDesc",
"conversationLanguageLevel",
"showDefinition",
"sendReadReceipts",
"sendTypingNotificationsDescription",
"sendReadReceiptsDescription",
"formattedMessages",
"formattedMessagesDescription",
"verifyOtherUser",
"verifyOtherUserDescription",
"verifyOtherDevice",
"verifyOtherDeviceDescription",
"acceptedKeyVerification",
"canceledKeyVerification",
"completedKeyVerification",
"isReadyForKeyVerification",
"requestedKeyVerification",
"startedKeyVerification",
"subscriptionPopupTitle",
"subscriptionPopupDesc",
"seeOptions",
@ -28141,13 +28071,6 @@
"refresh",
"autoPlayTitle",
"autoPlayDesc",
"transparent",
"incomingMessages",
"stickers",
"discover",
"commandHint_ignore",
"commandHint_unignore",
"unreadChatsInApp",
"messageAnalytics",
"words",
"score",
@ -28196,7 +28119,6 @@
"roomCapacityExplanation",
"enterNumber",
"buildTranslation",
"noDatabaseEncryption",
"thereAreCountUsersBlocked"
],
@ -41295,41 +41217,17 @@
"addGroupDescription",
"addNewFriend",
"alreadyHaveAnAccount",
"appLockDescription",
"classes",
"createNewGroup",
"editChatPermissions",
"globalChatId",
"accessAndVisibility",
"accessAndVisibilityDescription",
"calls",
"customEmojisAndStickers",
"customEmojisAndStickersBody",
"enterAGroupName",
"enterASpacepName",
"groupDescription",
"groupDescriptionHasBeenChanged",
"hideRedactedMessages",
"hideRedactedMessagesBody",
"hideInvalidOrUnknownMessageFormats",
"ignoreListDescription",
"ignoreUsername",
"optionalGroupName",
"hideMemberChangesInPublicChats",
"hideMemberChangesInPublicChatsBody",
"overview",
"notifyMeFor",
"passwordRecoverySettings",
"presenceStyle",
"presencesToggle",
"writeAMessageFlag",
"youInvitedToBy",
"usersMustKnock",
"noOneCanJoin",
"userWouldLikeToChangeTheChat",
"noPublicLinkHasBeenCreatedYet",
"knock",
"hidePresences",
"requests",
"allCorrect",
"newWayAllGood",
@ -42073,8 +41971,6 @@
"reportMessageTitle",
"reportMessageBody",
"noTeachersFound",
"knocking",
"chatCanBeDiscoveredViaSearchOnServer",
"createClass",
"createExchange",
"viewArchive",
@ -42086,31 +41982,6 @@
"clickToManageSubscription",
"emptyInviteWarning",
"errorGettingAudio",
"nothingFound",
"leaveEmptyToClearStatus",
"select",
"searchForUsers",
"pleaseEnterYourCurrentPassword",
"newPassword",
"pleaseChooseAStrongPassword",
"passwordsDoNotMatch",
"passwordIsWrong",
"publicLink",
"publicChatAddresses",
"createNewAddress",
"joinSpace",
"publicSpaces",
"addChatOrSubSpace",
"subspace",
"decline",
"thisDevice",
"initAppError",
"userRole",
"minimumPowerLevel",
"databaseBuildErrorBody",
"sessionLostBody",
"restoreSessionBody",
"forwardMessageTo",
"signUp",
"pleaseChooseAtLeastChars",
"noEmailWarning",
@ -42131,21 +42002,6 @@
"enableModerationDesc",
"conversationLanguageLevel",
"showDefinition",
"sendReadReceipts",
"sendTypingNotificationsDescription",
"sendReadReceiptsDescription",
"formattedMessages",
"formattedMessagesDescription",
"verifyOtherUser",
"verifyOtherUserDescription",
"verifyOtherDevice",
"verifyOtherDeviceDescription",
"acceptedKeyVerification",
"canceledKeyVerification",
"completedKeyVerification",
"isReadyForKeyVerification",
"requestedKeyVerification",
"startedKeyVerification",
"subscriptionPopupTitle",
"subscriptionPopupDesc",
"seeOptions",
@ -42166,13 +42022,6 @@
"refresh",
"autoPlayTitle",
"autoPlayDesc",
"transparent",
"incomingMessages",
"stickers",
"discover",
"commandHint_ignore",
"commandHint_unignore",
"unreadChatsInApp",
"messageAnalytics",
"words",
"score",
@ -42220,9 +42069,7 @@
"capacitySetTooLow",
"roomCapacityExplanation",
"enterNumber",
"buildTranslation",
"noDatabaseEncryption",
"thereAreCountUsersBlocked"
"buildTranslation"
],
"uk": [

@ -1409,10 +1409,10 @@ packages:
dependency: "direct main"
description:
name: matrix
sha256: "36c7e13d5d7420898f2597d6f5f0611a9da8114a0fde11f41b9e54cd1140b05f"
sha256: "32c21a2ac2c221ce887b00a87f965bd8df1a3a4ba8794bbe86be8b56214051fb"
url: "https://pub.dev"
source: hosted
version: "0.27.0"
version: "0.28.1"
meta:
dependency: transitive
description:

@ -70,7 +70,7 @@ dependencies:
keyboard_shortcuts: ^0.1.4
latlong2: ^0.9.1
linkify: ^5.0.0
matrix: ^0.27.0
matrix: ^0.28.1
native_imaging: ^0.1.0
package_info_plus: ^6.0.0
pasteboard: ^0.2.0

@ -1,7 +1,6 @@
// ignore_for_file: depend_on_referenced_packages
import 'package:matrix/encryption/utils/key_verification.dart';
import 'package:matrix/fake_matrix_api.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/flutter_hive_collections_database.dart';

Loading…
Cancel
Save