fluffychat/lib/pangea/chat/constants/default_power_level.dart
wcjord f6a048ca3e
feat: embed STT transcription in audio event content (#5731)
* feat: embed STT transcription in audio event content

Before sending the audio event, the client now fetches the STT
transcript first, then embeds it under 'user_stt' in the event
content. This mirrors the 'original_sent' pattern for text messages
and lets the bot read the transcript immediately without downloading
audio or calling choreo.

- Add ModelKey.userStt constant
- Rewrite onVoiceMessageSend to get transcript before sending audio
- Update getSpeechToTextLocal() to check userStt before botTranscription

* chore: replace inaccurate comment with TODO referencing #5730

* formatting

* fix pangea comments

* feat: make stt translations relate to pangea message events instead of stt representation events

* clean up pangea event types

---------

Co-authored-by: ggurdin <ggurdin@gmail.com>
2026-02-18 12:39:38 -05:00

77 lines
1.9 KiB
Dart

import 'package:matrix/matrix.dart';
import 'package:fluffychat/pangea/events/constants/pangea_event_types.dart';
class RoomDefaults {
static StateEvent defaultPowerLevels(String userID) => StateEvent(
type: EventTypes.RoomPowerLevels,
stateKey: '',
content: {
"ban": 50,
"kick": 50,
"invite": 50,
"redact": 50,
"events": {
PangeaEventTypes.activityPlan: 0,
PangeaEventTypes.activityRole: 0,
PangeaEventTypes.activitySummary: 0,
"m.room.power_levels": 100,
"m.room.pinned_events": 50,
},
"events_default": 0,
"state_default": 50,
"users": {userID: 100},
"users_default": 0,
"notifications": {"room": 50},
},
);
static StateEvent restrictedPowerLevels(String userID) => StateEvent(
type: EventTypes.RoomPowerLevels,
stateKey: '',
content: {
"ban": 50,
"kick": 50,
"invite": 50,
"redact": 50,
"events": {
PangeaEventTypes.activityPlan: 50,
PangeaEventTypes.activityRole: 0,
PangeaEventTypes.activitySummary: 0,
"m.room.power_levels": 100,
"m.room.pinned_events": 50,
},
"events_default": 50,
"state_default": 50,
"users": {userID: 100},
"users_default": 0,
"notifications": {"room": 50},
},
);
static StateEvent defaultSpacePowerLevels(
String userID, {
int spaceChild = 50,
}) => StateEvent(
type: EventTypes.RoomPowerLevels,
stateKey: '',
content: {
"ban": 50,
"kick": 50,
"invite": 50,
"redact": 50,
"events": {
"m.room.power_levels": 100,
"m.room.join_rules": 100,
"m.space.child": spaceChild,
},
"events_default": 0,
"state_default": 50,
"users": {userID: 100},
"users_default": 0,
"notifications": {"room": 50},
},
);
static Visibility spaceChildVisibility = Visibility.private;
}