fixup bugs related to PMP
Closes #25, as "Explain how to send messages using a certain PMP" is now added to the progress list.
This commit is contained in:
parent
1ca802c78b
commit
bd1d5ea745
3 changed files with 19 additions and 18 deletions
|
|
@ -120,7 +120,9 @@ A simple and user-friendly Matrix client made with Flutter and a Gomuks backend.
|
||||||
- [ ] Align your message bubbles to left or right
|
- [ ] Align your message bubbles to left or right
|
||||||
- [ ] Show media by default
|
- [ ] Show media by default
|
||||||
- [ ] Dynamic Theming
|
- [ ] Dynamic Theming
|
||||||
|
- [ ] Personas
|
||||||
- [ ] Setting per-message profiles for users (MSC4461)
|
- [ ] Setting per-message profiles for users (MSC4461)
|
||||||
|
- [ ] Explain how to send messages using a certain PMP
|
||||||
- [ ] Devices
|
- [ ] Devices
|
||||||
- [ ] Viewing devices
|
- [ ] Viewing devices
|
||||||
- [ ] Verifying devices
|
- [ ] Verifying devices
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,6 @@ class ChatBox extends HookConsumerWidget {
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
);
|
);
|
||||||
|
|
||||||
final canSendMessages = ref.watch(
|
|
||||||
PowerLevelController.provider(
|
|
||||||
PowerLevelConfig(eventType: "m.room.message"),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Positioned(
|
return Positioned(
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
|
|
@ -92,7 +86,12 @@ class ChatBox extends HookConsumerWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: canSendMessages
|
children:
|
||||||
|
ref.watch(
|
||||||
|
PowerLevelController.provider(
|
||||||
|
PowerLevelConfig(eventType: "m.room.message"),
|
||||||
|
),
|
||||||
|
)
|
||||||
? [
|
? [
|
||||||
EmojiPickerButton(
|
EmojiPickerButton(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -101,7 +100,6 @@ class ChatBox extends HookConsumerWidget {
|
||||||
),
|
),
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
tooltip: "Add media",
|
tooltip: "Add media",
|
||||||
enabled: canSendMessages,
|
|
||||||
itemBuilder: (context) => [
|
itemBuilder: (context) => [
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
|
@ -145,7 +143,6 @@ class ChatBox extends HookConsumerWidget {
|
||||||
"#": style,
|
"#": style,
|
||||||
},
|
},
|
||||||
builder: (context, key) => TextFormField(
|
builder: (context, key) => TextFormField(
|
||||||
enabled: canSendMessages,
|
|
||||||
maxLines: 12,
|
maxLines: 12,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
|
|
@ -164,7 +161,7 @@ class ChatBox extends HookConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: !canSendMessages ? null : send,
|
onPressed: send,
|
||||||
icon: Icon(Icons.send),
|
icon: Icon(Icons.send),
|
||||||
tooltip: "Send message",
|
tooltip: "Send message",
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -365,13 +365,15 @@ class RoomChat extends HookConsumerWidget {
|
||||||
text, {
|
text, {
|
||||||
required shouldMention,
|
required shouldMention,
|
||||||
required tags,
|
required tags,
|
||||||
}) => notifier.send(
|
}) => notifier
|
||||||
|
.send(
|
||||||
text,
|
text,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
relationType: relationType.value,
|
relationType: relationType.value,
|
||||||
shouldMention: shouldMention,
|
shouldMention: shouldMention,
|
||||||
relation: relatedMessage.value,
|
relation: relatedMessage.value,
|
||||||
),
|
)
|
||||||
|
.onError(showError),
|
||||||
relationType: relationType.value,
|
relationType: relationType.value,
|
||||||
relatedMessage: relatedMessage.value,
|
relatedMessage: relatedMessage.value,
|
||||||
onDismiss: () => relatedMessage.value = null,
|
onDismiss: () => relatedMessage.value = null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue