mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
share group image on group creation, fixes #602
This commit is contained in:
committed by
holger krekel
parent
ab12a4eb39
commit
ff29b84146
@@ -314,6 +314,7 @@ impl Chat {
|
|||||||
|| self.typ == Chattype::VerifiedGroup
|
|| self.typ == Chattype::VerifiedGroup
|
||||||
&& self.param.get_int(Param::Unpromoted).unwrap_or_default() == 1
|
&& self.param.get_int(Param::Unpromoted).unwrap_or_default() == 1
|
||||||
{
|
{
|
||||||
|
msg.param.set_int(Param::AttachGroupImage, 1);
|
||||||
self.param.remove(Param::Unpromoted);
|
self.param.remove(Param::Unpromoted);
|
||||||
self.update_param(context)?;
|
self.update_param(context)?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -332,6 +332,15 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self
|
||||||
|
.msg
|
||||||
|
.param
|
||||||
|
.get_bool(Param::AttachGroupImage)
|
||||||
|
.unwrap_or_default()
|
||||||
|
{
|
||||||
|
return chat.param.get(Param::ProfileImage).map(Into::into);
|
||||||
|
}
|
||||||
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
Loaded::MDN => None,
|
Loaded::MDN => None,
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ pub enum Param {
|
|||||||
Arg4 = b'H',
|
Arg4 = b'H',
|
||||||
/// For Messages
|
/// For Messages
|
||||||
Error = b'L',
|
Error = b'L',
|
||||||
|
|
||||||
|
/// For Messages
|
||||||
|
AttachGroupImage = b'A',
|
||||||
|
|
||||||
/// For Messages: space-separated list of messaged IDs of forwarded copies.
|
/// For Messages: space-separated list of messaged IDs of forwarded copies.
|
||||||
///
|
///
|
||||||
/// This is used when a [crate::message::Message] is in the
|
/// This is used when a [crate::message::Message] is in the
|
||||||
@@ -192,6 +196,11 @@ impl Params {
|
|||||||
self.get(key).and_then(|s| s.parse().ok())
|
self.get(key).and_then(|s| s.parse().ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the given parameter and parse as `bool`.
|
||||||
|
pub fn get_bool(&self, key: Param) -> Option<bool> {
|
||||||
|
self.get_int(key).map(|v| v != 0)
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the parameter behind `Param::Cmd` interpreted as `SystemMessage`.
|
/// Get the parameter behind `Param::Cmd` interpreted as `SystemMessage`.
|
||||||
pub fn get_cmd(&self) -> SystemMessage {
|
pub fn get_cmd(&self) -> SystemMessage {
|
||||||
self.get_int(Param::Cmd)
|
self.get_int(Param::Cmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user