mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
set message-info-type also for unpromoted protect/unprotect messages so that UI can show a shield-icon or sth. line that
This commit is contained in:
11
src/chat.rs
11
src/chat.rs
@@ -240,18 +240,19 @@ impl ChatId {
|
||||
from_id: u32,
|
||||
) -> Result<(), Error> {
|
||||
let msg_text = context.stock_protection_msg(protect, from_id).await;
|
||||
let cmd = match protect {
|
||||
ProtectionStatus::Protected => SystemMessage::ChatProtectionEnabled,
|
||||
ProtectionStatus::Unprotected => SystemMessage::ChatProtectionDisabled,
|
||||
};
|
||||
|
||||
if promote {
|
||||
let mut msg = Message::default();
|
||||
msg.viewtype = Viewtype::Text;
|
||||
msg.text = Some(msg_text);
|
||||
msg.param.set_cmd(match protect {
|
||||
ProtectionStatus::Protected => SystemMessage::ChatProtectionEnabled,
|
||||
ProtectionStatus::Unprotected => SystemMessage::ChatProtectionDisabled,
|
||||
});
|
||||
msg.param.set_cmd(cmd);
|
||||
send_msg(context, self, &mut msg).await?;
|
||||
} else {
|
||||
add_info_msg(context, self, msg_text).await;
|
||||
add_info_msg_with_cmd(context, self, msg_text, cmd).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user