Add names to call arguments
This commit is contained in:
parent
58169dfd2c
commit
545439f353
1 changed files with 70 additions and 70 deletions
|
|
@ -148,32 +148,32 @@ fun Context.getMessages(
|
||||||
val phoneNumber = PhoneNumber(number, 0, "", number)
|
val phoneNumber = PhoneNumber(number, 0, "", number)
|
||||||
val participantPhoto = getNameAndPhotoFromPhoneNumber(number)
|
val participantPhoto = getNameAndPhotoFromPhoneNumber(number)
|
||||||
SimpleContact(
|
SimpleContact(
|
||||||
0,
|
rawId = 0,
|
||||||
0,
|
contactId = 0,
|
||||||
participantPhoto.name,
|
name = participantPhoto.name,
|
||||||
photoUri,
|
photoUri = photoUri,
|
||||||
arrayListOf(phoneNumber),
|
phoneNumbers = arrayListOf(phoneNumber),
|
||||||
ArrayList(),
|
birthdays = ArrayList(),
|
||||||
ArrayList()
|
anniversaries = ArrayList()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val isMMS = false
|
val isMMS = false
|
||||||
val message =
|
val message =
|
||||||
Message(
|
Message(
|
||||||
id,
|
id = id,
|
||||||
body,
|
body = body,
|
||||||
type,
|
type = type,
|
||||||
status,
|
status = status,
|
||||||
ArrayList(participants),
|
participants = ArrayList(participants),
|
||||||
date,
|
date = date,
|
||||||
read,
|
read = read,
|
||||||
thread,
|
threadId = thread,
|
||||||
isMMS,
|
isMMS = isMMS,
|
||||||
null,
|
attachment = null,
|
||||||
senderNumber,
|
senderPhoneNumber = senderNumber,
|
||||||
senderName,
|
senderName = senderName,
|
||||||
photoUri,
|
senderPhotoUri = photoUri,
|
||||||
subscriptionId
|
subscriptionId = subscriptionId
|
||||||
)
|
)
|
||||||
messages.add(message)
|
messages.add(message)
|
||||||
}
|
}
|
||||||
|
|
@ -266,20 +266,20 @@ fun Context.getMMS(
|
||||||
|
|
||||||
val message =
|
val message =
|
||||||
Message(
|
Message(
|
||||||
mmsId,
|
id = mmsId,
|
||||||
body,
|
body = body,
|
||||||
type,
|
type = type,
|
||||||
status,
|
status = status,
|
||||||
participants,
|
participants = participants,
|
||||||
date,
|
date = date,
|
||||||
read,
|
read = read,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
isMMS,
|
isMMS = isMMS,
|
||||||
attachment,
|
attachment = attachment,
|
||||||
senderNumber,
|
senderPhoneNumber = senderNumber,
|
||||||
senderName,
|
senderName = senderName,
|
||||||
senderPhotoUri,
|
senderPhotoUri = senderPhotoUri,
|
||||||
subscriptionId
|
subscriptionId = subscriptionId
|
||||||
)
|
)
|
||||||
messages.add(message)
|
messages.add(message)
|
||||||
|
|
||||||
|
|
@ -383,14 +383,14 @@ fun Context.getConversations(
|
||||||
val archived =
|
val archived =
|
||||||
if (archiveAvailable) cursor.getIntValue(Threads.ARCHIVED) == 1 else false
|
if (archiveAvailable) cursor.getIntValue(Threads.ARCHIVED) == 1 else false
|
||||||
val conversation = Conversation(
|
val conversation = Conversation(
|
||||||
id,
|
threadId = id,
|
||||||
snippet,
|
snippet = snippet,
|
||||||
date.toInt(),
|
date = date.toInt(),
|
||||||
read,
|
read = read,
|
||||||
title,
|
title = title,
|
||||||
photoUri,
|
photoUri = photoUri,
|
||||||
isGroupConversation,
|
isGroupConversation = isGroupConversation,
|
||||||
phoneNumbers.first(),
|
phoneNumber = phoneNumbers.first(),
|
||||||
isArchived = archived
|
isArchived = archived
|
||||||
)
|
)
|
||||||
conversations.add(conversation)
|
conversations.add(conversation)
|
||||||
|
|
@ -491,13 +491,13 @@ fun Context.getMmsAttachment(id: Long, getImageResolutions: Boolean): MessageAtt
|
||||||
} else if (mimetype != "application/smil") {
|
} else if (mimetype != "application/smil") {
|
||||||
val attachmentName = attachmentNames?.getOrNull(attachmentCount) ?: ""
|
val attachmentName = attachmentNames?.getOrNull(attachmentCount) ?: ""
|
||||||
val attachment = Attachment(
|
val attachment = Attachment(
|
||||||
partId,
|
id = partId,
|
||||||
id,
|
messageId = id,
|
||||||
Uri.withAppendedPath(uri, partId.toString()).toString(),
|
uriString = Uri.withAppendedPath(uri, partId.toString()).toString(),
|
||||||
mimetype,
|
mimetype = mimetype,
|
||||||
0,
|
width = 0,
|
||||||
0,
|
height = 0,
|
||||||
attachmentName
|
filename = attachmentName
|
||||||
)
|
)
|
||||||
messageAttachment.attachments.add(attachment)
|
messageAttachment.attachments.add(attachment)
|
||||||
attachmentCount++
|
attachmentCount++
|
||||||
|
|
@ -593,13 +593,13 @@ fun Context.getThreadParticipants(
|
||||||
val photoUri = namePhoto.photoUri ?: ""
|
val photoUri = namePhoto.photoUri ?: ""
|
||||||
val phoneNumber = PhoneNumber(number, 0, "", number)
|
val phoneNumber = PhoneNumber(number, 0, "", number)
|
||||||
val contact = SimpleContact(
|
val contact = SimpleContact(
|
||||||
addressId,
|
rawId = addressId,
|
||||||
addressId,
|
contactId = addressId,
|
||||||
name,
|
name = name,
|
||||||
photoUri,
|
photoUri = photoUri,
|
||||||
arrayListOf(phoneNumber),
|
phoneNumbers = arrayListOf(phoneNumber),
|
||||||
ArrayList(),
|
birthdays = ArrayList(),
|
||||||
ArrayList()
|
anniversaries = ArrayList()
|
||||||
)
|
)
|
||||||
participants.add(contact)
|
participants.add(contact)
|
||||||
}
|
}
|
||||||
|
|
@ -695,13 +695,13 @@ fun Context.getSuggestedContacts(privateContacts: ArrayList<SimpleContact>): Arr
|
||||||
|
|
||||||
val phoneNumber = PhoneNumber(senderNumber, 0, "", senderNumber)
|
val phoneNumber = PhoneNumber(senderNumber, 0, "", senderNumber)
|
||||||
val contact = SimpleContact(
|
val contact = SimpleContact(
|
||||||
0,
|
rawId = 0,
|
||||||
0,
|
contactId = 0,
|
||||||
senderName,
|
name = senderName,
|
||||||
photoUri,
|
photoUri = photoUri,
|
||||||
arrayListOf(phoneNumber),
|
phoneNumbers = arrayListOf(phoneNumber),
|
||||||
ArrayList(),
|
birthdays = ArrayList(),
|
||||||
ArrayList()
|
anniversaries = ArrayList()
|
||||||
)
|
)
|
||||||
if (!contacts.map { it.phoneNumbers.first().normalizedNumber.trimToComparableNumber() }
|
if (!contacts.map { it.phoneNumbers.first().normalizedNumber.trimToComparableNumber() }
|
||||||
.contains(senderNumber.trimToComparableNumber())) {
|
.contains(senderNumber.trimToComparableNumber())) {
|
||||||
|
|
@ -978,12 +978,12 @@ fun Context.showReceivedMessageNotification(
|
||||||
|
|
||||||
Handler(Looper.getMainLooper()).post {
|
Handler(Looper.getMainLooper()).post {
|
||||||
notificationHelper.showMessageNotification(
|
notificationHelper.showMessageNotification(
|
||||||
messageId,
|
messageId = messageId,
|
||||||
address,
|
address = address,
|
||||||
body,
|
body = body,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
bitmap,
|
bitmap = bitmap,
|
||||||
senderName
|
sender = senderName
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue