mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 22:46:29 +03:00
fix chat-verified
This commit is contained in:
@@ -1272,7 +1272,7 @@ fn create_or_lookup_adhoc_group(
|
||||
context.call_cb(Event::ChatModified(chat_id));
|
||||
|
||||
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn create_group_record(
|
||||
|
||||
@@ -458,7 +458,7 @@ impl Message {
|
||||
};
|
||||
|
||||
let contact = if self.from_id != DC_CONTACT_ID_SELF as libc::c_uint
|
||||
&& ((*chat).typ == Chattype::Group || (*chat).typ == Chattype::VerifiedGroup)
|
||||
&& (chat.typ == Chattype::Group || chat.typ == Chattype::VerifiedGroup)
|
||||
{
|
||||
Contact::get_by_id(context, self.from_id).ok()
|
||||
} else {
|
||||
|
||||
@@ -474,9 +474,12 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
let is_encrypted = should_encrypt && force_plaintext == 0;
|
||||
|
||||
// Add gossip headers
|
||||
info!(self.context, "gossip: {:?}", do_gossip);
|
||||
if do_gossip {
|
||||
info!(self.context, "Gossip headers: {:?}", &peerstates);
|
||||
info!(
|
||||
self.context,
|
||||
"gossiping headers for {} peerstates",
|
||||
peerstates.len()
|
||||
);
|
||||
for peerstate in peerstates.iter().filter_map(|(state, _)| state.as_ref()) {
|
||||
if peerstate.peek_key(min_verified).is_some() {
|
||||
if let Some(header) = peerstate.render_gossip_header(min_verified) {
|
||||
@@ -604,6 +607,10 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
||||
let mut placeholdertext = None;
|
||||
let mut meta_part = None;
|
||||
|
||||
if chat.typ == Chattype::VerifiedGroup {
|
||||
protected_headers.push(Header::new("Chat-Verified".to_string(), "1".to_string()));
|
||||
}
|
||||
|
||||
if chat.typ == Chattype::Group || chat.typ == Chattype::VerifiedGroup {
|
||||
protected_headers.push(Header::new("Chat-Group-ID".into(), chat.grpid.clone()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user