From e9bf7bf5f065b16b4fb3234c1a8f2b7cfb6b6c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20T=C3=B6rnqvist?= Date: Sat, 11 Jul 2020 19:38:22 +0300 Subject: [PATCH 1/2] Add the two group flags from textsecure --- libsignal-service/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libsignal-service/src/lib.rs b/libsignal-service/src/lib.rs index 0e584f0a7..0e465d1b9 100644 --- a/libsignal-service/src/lib.rs +++ b/libsignal-service/src/lib.rs @@ -11,4 +11,10 @@ pub use crate::account_manager::AccountManager; pub const USER_AGENT: &'static str = concat!(env!("CARGO_PKG_NAME"), "-rs-", env!("CARGO_PKG_VERSION")); +/// GROUP_UPDATE_FLAG signals that this message updates the group membership or name. +pub const GROUP_UPDATE_FLAG: u32 = 1; + +/// GROUP_LEAVE_FLAG signals that this message is a group leave message. +pub const GROUP_LEAVE_FLAG: u32 = 2; + pub struct TrustStore; From 1740f6d833bd3264473909837959396787707cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20T=C3=B6rnqvist?= Date: Sat, 11 Jul 2020 19:47:55 +0300 Subject: [PATCH 2/2] Make Message.group optional The textsecure code looks like it should not necessarily always be set, which I hadn't noticed before now. --- libsignal-service/src/models.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsignal-service/src/models.rs b/libsignal-service/src/models.rs index 7356e033d..151035d2c 100644 --- a/libsignal-service/src/models.rs +++ b/libsignal-service/src/models.rs @@ -28,7 +28,7 @@ pub struct Message { pub source: String, pub message: String, pub attachments: Vec>, - pub group: Group, + pub group: Option, pub timestamp: i64, pub flags: i32, }