Avoid ChatId::is_unset when querying location sending

Avoid using the 0 ChatID as a special value, use Options instead.  For
get_range() also do this for contact_id.
This commit is contained in:
Floris Bruynooghe
2021-02-07 20:54:40 +01:00
parent 148ad31024
commit be7cee2c37
4 changed files with 59 additions and 24 deletions

View File

@@ -978,7 +978,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
parts.push(msg_kml_part);
}
if location::is_sending_locations_to_chat(context, self.msg.chat_id).await {
if location::is_sending_locations_to_chat(context, Some(self.msg.chat_id)).await {
match self.get_location_kml_part().await {
Ok(part) => parts.push(part),
Err(err) => {