mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-07-04 13:25:33 +00:00
Use rich text format for chat
This commit is contained in:
parent
4d3371e485
commit
c492bb2537
8 changed files with 361 additions and 28 deletions
|
@ -5,8 +5,8 @@ use std::{fs, io};
|
|||
use anyhow::{Context, Result};
|
||||
use bitflags::Flags;
|
||||
use blah::types::{
|
||||
ChatPayload, CreateRoomPayload, MemberPermission, RoomAttrs, RoomMember, RoomMemberList,
|
||||
ServerPermission, UserKey, WithSig,
|
||||
ChatPayload, CreateRoomPayload, MemberPermission, RichText, RoomAttrs, RoomMember,
|
||||
RoomMemberList, ServerPermission, UserKey, WithSig,
|
||||
};
|
||||
use ed25519_dalek::pkcs8::spki::der::pem::LineEnding;
|
||||
use ed25519_dalek::pkcs8::{DecodePrivateKey, DecodePublicKey, EncodePrivateKey, EncodePublicKey};
|
||||
|
@ -238,7 +238,10 @@ async fn main_api(api_url: Url, command: ApiCommand) -> Result<()> {
|
|||
text,
|
||||
} => {
|
||||
let key = load_signing_key(&private_key_file)?;
|
||||
let payload = ChatPayload { room, text };
|
||||
let payload = ChatPayload {
|
||||
room,
|
||||
rich_text: RichText::from(text),
|
||||
};
|
||||
let payload = WithSig::sign(&key, &mut OsRng, payload)?;
|
||||
|
||||
let ret = client
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue