fix chat-verified

This commit is contained in:
dignifiedquire
2019-12-02 00:11:11 +01:00
parent e985887739
commit 1e7afa9da0
4 changed files with 13 additions and 6 deletions

View File

@@ -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(

View File

@@ -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 {

View File

@@ -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()));