public void handle(TextSecureEnvelope envelope, bool sendExplicitReceipt) { if (!isActiveNumber(envelope.getSource())) { TextSecureDirectory directory = DatabaseFactory.getDirectoryDatabase(); ContactTokenDetails contactTokenDetails = new ContactTokenDetails(); contactTokenDetails.setNumber(envelope.getSource()); directory.setNumber(contactTokenDetails, true); // TODO: evtl DirectoryRefresh } if (envelope.isReceipt()) handleReceipt(envelope); else if (envelope.isPreKeyWhisperMessage() || envelope.isWhisperMessage()) { handleMessage(envelope, sendExplicitReceipt); } else { Log.Warn($"Received envelope of unknown type: {envelope.GetType()}"); } }