Use gomuks editSource
This commit is contained in:
parent
2b4da17a35
commit
f4eea1b882
3 changed files with 3 additions and 8 deletions
|
|
@ -70,6 +70,7 @@ class MessageController extends AsyncNotifier<Message?> {
|
|||
"body": newContent?["body"] ?? content["body"],
|
||||
"eventType": type,
|
||||
"avatarUrl": author?.content["avatar_url"],
|
||||
"editSource": event.localContent?.editSource,
|
||||
"displayName": author?.content["displayname"]?.isNotEmpty == true
|
||||
? author?.content["displayname"]
|
||||
: event.authorId.substring(1).split(":")[0],
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ abstract class Event with _$Event {
|
|||
abstract class LocalContent with _$LocalContent {
|
||||
const factory LocalContent({
|
||||
String? sanitizedHtml,
|
||||
String? editSource,
|
||||
bool? wasPlaintext,
|
||||
bool? bigEmoji,
|
||||
bool? hasMath,
|
||||
|
|
|
|||
|
|
@ -34,14 +34,7 @@ class ChatBox extends HookConsumerWidget {
|
|||
if (relationType == RelationType.edit &&
|
||||
relatedMessage is TextMessage &&
|
||||
controller.value.text.isEmpty) {
|
||||
final text = (relatedMessage as TextMessage).text;
|
||||
final splitText = relatedMessage?.replyToMessageId == null
|
||||
? text
|
||||
: text.split("\n\n").sublist(1).join("\n\n");
|
||||
final notEmpty = splitText.isEmpty ? text : splitText;
|
||||
controller.value.text = notEmpty.startsWith("* ")
|
||||
? notEmpty.substring(2)
|
||||
: notEmpty;
|
||||
controller.value.text = relatedMessage?.metadata?["editSource"];
|
||||
}
|
||||
|
||||
void send() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue