mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-27 19:50:46 +00:00
Remove logs
This commit is contained in:
parent
e9a15941ae
commit
ec2abffdcc
@ -11,16 +11,12 @@ import org.session.libsession.messaging.sending_receiving.MessageSender
|
|||||||
import org.session.libsession.messaging.utilities.UpdateMessageData
|
import org.session.libsession.messaging.utilities.UpdateMessageData
|
||||||
import org.session.libsession.utilities.TextSecurePreferences
|
import org.session.libsession.utilities.TextSecurePreferences
|
||||||
import org.session.libsession.utilities.recipients.Recipient
|
import org.session.libsession.utilities.recipients.Recipient
|
||||||
import org.session.libsignal.utilities.Log
|
|
||||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||||
import org.thoughtcrime.securesms.database.model.MmsMessageRecord
|
import org.thoughtcrime.securesms.database.model.MmsMessageRecord
|
||||||
|
|
||||||
private val TAG = ResendMessageUtilities.javaClass.simpleName
|
|
||||||
|
|
||||||
object ResendMessageUtilities {
|
object ResendMessageUtilities {
|
||||||
|
|
||||||
fun resend(context: Context, messageRecord: MessageRecord, userBlindedKey: String?, isResync: Boolean = false) {
|
fun resend(context: Context, messageRecord: MessageRecord, userBlindedKey: String?, isResync: Boolean = false) {
|
||||||
Log.d(TAG, "resend() called with: context = $context, messageRecord = $messageRecord, userBlindedKey = $userBlindedKey, isResync = $isResync")
|
|
||||||
val recipient: Recipient = messageRecord.recipient
|
val recipient: Recipient = messageRecord.recipient
|
||||||
val message = VisibleMessage()
|
val message = VisibleMessage()
|
||||||
message.id = messageRecord.getId()
|
message.id = messageRecord.getId()
|
||||||
|
@ -41,7 +41,6 @@ import org.session.libsignal.messages.SignalServiceAttachmentPointer
|
|||||||
import org.session.libsignal.messages.SignalServiceGroup
|
import org.session.libsignal.messages.SignalServiceGroup
|
||||||
import org.session.libsignal.utilities.IdPrefix
|
import org.session.libsignal.utilities.IdPrefix
|
||||||
import org.session.libsignal.utilities.KeyHelper
|
import org.session.libsignal.utilities.KeyHelper
|
||||||
import org.session.libsignal.utilities.Log
|
|
||||||
import org.session.libsignal.utilities.guava.Optional
|
import org.session.libsignal.utilities.guava.Optional
|
||||||
import org.thoughtcrime.securesms.ApplicationContext
|
import org.thoughtcrime.securesms.ApplicationContext
|
||||||
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper
|
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper
|
||||||
@ -54,8 +53,6 @@ import org.thoughtcrime.securesms.mms.PartAuthority
|
|||||||
import org.thoughtcrime.securesms.util.SessionMetaProtocol
|
import org.thoughtcrime.securesms.util.SessionMetaProtocol
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
|
|
||||||
private val TAG = Storage::class.java.simpleName
|
|
||||||
|
|
||||||
class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), StorageProtocol {
|
class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), StorageProtocol {
|
||||||
|
|
||||||
override fun getUserPublicKey(): String? {
|
override fun getUserPublicKey(): String? {
|
||||||
@ -359,8 +356,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
openGroupSentTimestamp: Long,
|
openGroupSentTimestamp: Long,
|
||||||
threadId: Long
|
threadId: Long
|
||||||
) {
|
) {
|
||||||
Log.d(TAG, "updateSentTimestamp() called with: messageID = $messageID, isMms = $isMms, openGroupSentTimestamp = $openGroupSentTimestamp, threadId = $threadId")
|
|
||||||
|
|
||||||
if (isMms) {
|
if (isMms) {
|
||||||
val mmsDb = DatabaseComponent.get(context).mmsDatabase()
|
val mmsDb = DatabaseComponent.get(context).mmsDatabase()
|
||||||
mmsDb.updateSentTimestamp(messageID, openGroupSentTimestamp, threadId)
|
mmsDb.updateSentTimestamp(messageID, openGroupSentTimestamp, threadId)
|
||||||
@ -371,8 +366,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun markAsSent(timestamp: Long, author: String) {
|
override fun markAsSent(timestamp: Long, author: String) {
|
||||||
Log.d(TAG, "markAsSent() called with: timestamp = $timestamp, author = $author")
|
|
||||||
|
|
||||||
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
||||||
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
||||||
if (messageRecord.isMms) {
|
if (messageRecord.isMms) {
|
||||||
@ -385,8 +378,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun markAsSyncing(timestamp: Long, author: String) {
|
override fun markAsSyncing(timestamp: Long, author: String) {
|
||||||
Log.d(TAG, "markAsSyncing() called with: timestamp = $timestamp, author = $author")
|
|
||||||
|
|
||||||
DatabaseComponent.get(context).mmsSmsDatabase()
|
DatabaseComponent.get(context).mmsSmsDatabase()
|
||||||
.getMessageFor(timestamp, author)
|
.getMessageFor(timestamp, author)
|
||||||
?.run { getMmsDatabaseElseSms(isMms).markAsSyncing(id) }
|
?.run { getMmsDatabaseElseSms(isMms).markAsSyncing(id) }
|
||||||
@ -397,16 +388,12 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
else DatabaseComponent.get(context).smsDatabase()
|
else DatabaseComponent.get(context).smsDatabase()
|
||||||
|
|
||||||
override fun markAsResyncing(timestamp: Long, author: String) {
|
override fun markAsResyncing(timestamp: Long, author: String) {
|
||||||
Log.d(TAG, "markAsResyncing() called with: timestamp = $timestamp, author = $author")
|
|
||||||
|
|
||||||
DatabaseComponent.get(context).mmsSmsDatabase()
|
DatabaseComponent.get(context).mmsSmsDatabase()
|
||||||
.getMessageFor(timestamp, author)
|
.getMessageFor(timestamp, author)
|
||||||
?.run { getMmsDatabaseElseSms(isMms).markAsResyncing(id) }
|
?.run { getMmsDatabaseElseSms(isMms).markAsResyncing(id) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun markAsSending(timestamp: Long, author: String) {
|
override fun markAsSending(timestamp: Long, author: String) {
|
||||||
Log.d(TAG, "markAsSending() called with: timestamp = $timestamp, author = $author")
|
|
||||||
|
|
||||||
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
||||||
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
||||||
if (messageRecord.isMms) {
|
if (messageRecord.isMms) {
|
||||||
@ -432,8 +419,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun markAsSentFailed(timestamp: Long, author: String, error: Exception) {
|
override fun markAsSentFailed(timestamp: Long, author: String, error: Exception) {
|
||||||
Log.d(TAG, "markAsSentFailed() called with: timestamp = $timestamp, author = $author, error = $error")
|
|
||||||
|
|
||||||
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
||||||
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
||||||
if (messageRecord.isMms) {
|
if (messageRecord.isMms) {
|
||||||
@ -457,8 +442,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun markAsSyncFailed(timestamp: Long, author: String, error: Exception) {
|
override fun markAsSyncFailed(timestamp: Long, author: String, error: Exception) {
|
||||||
Log.d(TAG, "markAsSyncFailed() called with: timestamp = $timestamp, author = $author, error = $error")
|
|
||||||
|
|
||||||
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
val database = DatabaseComponent.get(context).mmsSmsDatabase()
|
||||||
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(dispatcherName: String) {
|
override fun execute(dispatcherName: String) {
|
||||||
Log.d(TAG, "MessageSendJob#execute() called with: dispatcherName = $dispatcherName")
|
|
||||||
|
|
||||||
val messageDataProvider = MessagingModuleConfiguration.shared.messageDataProvider
|
val messageDataProvider = MessagingModuleConfiguration.shared.messageDataProvider
|
||||||
val message = message as? VisibleMessage
|
val message = message as? VisibleMessage
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
|
@ -39,8 +39,6 @@ import org.session.libsession.messaging.sending_receiving.attachments.Attachment
|
|||||||
import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview as SignalLinkPreview
|
import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview as SignalLinkPreview
|
||||||
import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote
|
import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote
|
||||||
|
|
||||||
private val TAG = MessageSender::class.java.simpleName
|
|
||||||
|
|
||||||
object MessageSender {
|
object MessageSender {
|
||||||
|
|
||||||
// Error
|
// Error
|
||||||
@ -64,8 +62,6 @@ object MessageSender {
|
|||||||
|
|
||||||
// Convenience
|
// Convenience
|
||||||
fun send(message: Message, destination: Destination, isSyncMessage: Boolean = false): Promise<Unit, Exception> {
|
fun send(message: Message, destination: Destination, isSyncMessage: Boolean = false): Promise<Unit, Exception> {
|
||||||
Log.d(TAG, "send() called with: message = $message, destination = $destination, isSyncMessage = $isSyncMessage")
|
|
||||||
|
|
||||||
return if (destination is Destination.LegacyOpenGroup || destination is Destination.OpenGroup || destination is Destination.OpenGroupInbox) {
|
return if (destination is Destination.LegacyOpenGroup || destination is Destination.OpenGroup || destination is Destination.OpenGroupInbox) {
|
||||||
sendToOpenGroupDestination(destination, message)
|
sendToOpenGroupDestination(destination, message)
|
||||||
} else {
|
} else {
|
||||||
@ -75,8 +71,6 @@ object MessageSender {
|
|||||||
|
|
||||||
// One-on-One Chats & Closed Groups
|
// One-on-One Chats & Closed Groups
|
||||||
private fun sendToSnodeDestination(destination: Destination, message: Message, isSyncMessage: Boolean = false): Promise<Unit, Exception> {
|
private fun sendToSnodeDestination(destination: Destination, message: Message, isSyncMessage: Boolean = false): Promise<Unit, Exception> {
|
||||||
Log.d(TAG, "sendToSnodeDestination() called with: destination = $destination, message = $message, isSyncMessage = $isSyncMessage")
|
|
||||||
|
|
||||||
val deferred = deferred<Unit, Exception>()
|
val deferred = deferred<Unit, Exception>()
|
||||||
val promise = deferred.promise
|
val promise = deferred.promise
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
@ -226,8 +220,6 @@ object MessageSender {
|
|||||||
|
|
||||||
// Open Groups
|
// Open Groups
|
||||||
private fun sendToOpenGroupDestination(destination: Destination, message: Message): Promise<Unit, Exception> {
|
private fun sendToOpenGroupDestination(destination: Destination, message: Message): Promise<Unit, Exception> {
|
||||||
Log.d(TAG, "sendToOpenGroupDestination() called with: destination = $destination, message = $message")
|
|
||||||
|
|
||||||
val deferred = deferred<Unit, Exception>()
|
val deferred = deferred<Unit, Exception>()
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
if (message.sentTimestamp == null) {
|
if (message.sentTimestamp == null) {
|
||||||
@ -326,8 +318,6 @@ object MessageSender {
|
|||||||
|
|
||||||
// Result Handling
|
// Result Handling
|
||||||
fun handleSuccessfulMessageSend(message: Message, destination: Destination, isSyncMessage: Boolean = false, openGroupSentTimestamp: Long = -1) {
|
fun handleSuccessfulMessageSend(message: Message, destination: Destination, isSyncMessage: Boolean = false, openGroupSentTimestamp: Long = -1) {
|
||||||
Log.d(TAG, "handleSuccessfulMessageSend() called with: message = $message, destination = $destination, isSyncMessage = $isSyncMessage, openGroupSentTimestamp = $openGroupSentTimestamp")
|
|
||||||
|
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
val userPublicKey = storage.getUserPublicKey()!!
|
val userPublicKey = storage.getUserPublicKey()!!
|
||||||
// Ignore future self-sends
|
// Ignore future self-sends
|
||||||
@ -393,8 +383,6 @@ object MessageSender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun handleFailedMessageSend(message: Message, error: Exception, isSyncMessage: Boolean = false) {
|
fun handleFailedMessageSend(message: Message, error: Exception, isSyncMessage: Boolean = false) {
|
||||||
Log.d(TAG, "handleFailedMessageSend() called with: message = $message, error = $error, isSyncMessage = $isSyncMessage")
|
|
||||||
|
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
val userPublicKey = storage.getUserPublicKey()!!
|
val userPublicKey = storage.getUserPublicKey()!!
|
||||||
|
|
||||||
@ -408,8 +396,6 @@ object MessageSender {
|
|||||||
// Convenience
|
// Convenience
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun send(message: VisibleMessage, address: Address, attachments: List<SignalAttachment>, quote: SignalQuote?, linkPreview: SignalLinkPreview?) {
|
fun send(message: VisibleMessage, address: Address, attachments: List<SignalAttachment>, quote: SignalQuote?, linkPreview: SignalLinkPreview?) {
|
||||||
Log.d(TAG, "send() called with: message = $message, address = $address, attachments = $attachments, quote = $quote, linkPreview = $linkPreview")
|
|
||||||
|
|
||||||
val messageDataProvider = MessagingModuleConfiguration.shared.messageDataProvider
|
val messageDataProvider = MessagingModuleConfiguration.shared.messageDataProvider
|
||||||
val attachmentIDs = messageDataProvider.getAttachmentIDsFor(message.id!!)
|
val attachmentIDs = messageDataProvider.getAttachmentIDsFor(message.id!!)
|
||||||
message.attachmentIDs.addAll(attachmentIDs)
|
message.attachmentIDs.addAll(attachmentIDs)
|
||||||
@ -428,8 +414,6 @@ object MessageSender {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun send(message: Message, address: Address) {
|
fun send(message: Message, address: Address) {
|
||||||
Log.d(TAG, "send() called with: message = $message, address = $address")
|
|
||||||
|
|
||||||
val threadID = MessagingModuleConfiguration.shared.storage.getOrCreateThreadIdFor(address)
|
val threadID = MessagingModuleConfiguration.shared.storage.getOrCreateThreadIdFor(address)
|
||||||
message.threadID = threadID
|
message.threadID = threadID
|
||||||
val destination = Destination.from(address)
|
val destination = Destination.from(address)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user