diff --git a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java index a22b34d342..63210ff1c2 100644 --- a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java +++ b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java @@ -15,6 +15,8 @@ import android.util.Pair; import org.thoughtcrime.securesms.ApplicationContext; import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.crypto.MasterSecret; +import org.thoughtcrime.securesms.crypto.SessionUtil; +import org.thoughtcrime.securesms.crypto.storage.TextSecureSessionStore; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.NotInDirectoryException; import org.thoughtcrime.securesms.database.TextSecureDirectory; @@ -212,9 +214,11 @@ public class DirectoryHelper { @NonNull List newUsers) { for (String newUser : newUsers) { - IncomingJoinedMessage message = new IncomingJoinedMessage(newUser); - Pair smsAndThreadId = DatabaseFactory.getSmsDatabase(context).insertMessageInbox(message); - MessageNotifier.updateNotification(context, masterSecret, smsAndThreadId.second); + if (!SessionUtil.hasSession(context, masterSecret, newUser)) { + IncomingJoinedMessage message = new IncomingJoinedMessage(newUser); + Pair smsAndThreadId = DatabaseFactory.getSmsDatabase(context).insertMessageInbox(message); + MessageNotifier.updateNotification(context, masterSecret, smsAndThreadId.second); + } } }