private async Task sendAllOutstandingMessagesAsync(OmemoSession omemoSession) { Tuple <List <OmemoMessageMessage>, OmemoSessionBuildHelper> cache = MESSAGE_CACHE[omemoSession.CHAT_JID]; foreach (OmemoMessageMessage msg in cache.Item1) { msg.encrypt(omemoSession, CONNECTION.account.omemoDeviceId); await CONNECTION.sendAsync(msg, false); } MESSAGE_CACHE.Remove(omemoSession.CHAT_JID); Logger.Info("[OMEMO HELPER] Send all outstanding OMEMO messages for: " + omemoSession.CHAT_JID + " to " + omemoSession.DEVICE_SESSIONS_OWN.Count + " own and " + omemoSession.DEVICE_SESSIONS_REMOTE.Count + " remote recipient(s)."); }
private async Task sendAllOutstandingMessagesAsync(OmemoSession omemoSession) { Tuple <List <OmemoMessageMessage>, OmemoSessionBuildHelper> cache = MESSAGE_CACHE[omemoSession.CHAT_JID]; foreach (OmemoMessageMessage msg in cache.Item1) { msg.encrypt(omemoSession, CONNECTION.account.omemoDeviceId); await CONNECTION.sendAsync(msg, true, false); } cache.Item2.Dispose(); MESSAGE_CACHE.Remove(omemoSession.CHAT_JID); Logger.Info("[OMEMO HELPER] Send all outstanding OMEMO messages for: " + omemoSession.CHAT_JID); }