mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Clean
This commit is contained in:
parent
86c765b1c2
commit
52a0b2a5e8
@ -827,11 +827,11 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
||||
}
|
||||
|
||||
private void handleFriendRequestIfNeeded(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceContent content, @NonNull SignalServiceDataMessage message) {
|
||||
Recipient recipient = getMessageDestination(content, message);
|
||||
long threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdIfExistsFor(recipient);
|
||||
LokiThreadFriendRequestDatabase threadFriendRequestDatabase = DatabaseFactory.getLokiThreadFriendRequestDatabase(context);
|
||||
LokiThreadFriendRequestStatus threadFriendRequestStatus = threadFriendRequestDatabase.getFriendRequestStatus(threadID);
|
||||
LokiMessageFriendRequestDatabase messageFriendRequestDatabase = DatabaseFactory.getLokiMessageFriendRequestDatabase(context);
|
||||
Recipient contactID = getMessageDestination(content, message);
|
||||
long threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdIfExistsFor(contactID);
|
||||
LokiThreadFriendRequestStatus threadFriendRequestStatus = threadFriendRequestDatabase.getFriendRequestStatus(threadID);
|
||||
long messageID = DatabaseFactory.getSmsDatabase(context).getLastMessageIDForThread(threadID);
|
||||
if (envelope.isFriendRequest()) {
|
||||
if (threadFriendRequestStatus == LokiThreadFriendRequestStatus.REQUEST_SENT) {
|
||||
|
@ -82,7 +82,6 @@ class FriendRequestView(context: Context, attrs: AttributeSet?, defStyleAttr: In
|
||||
buttonLinearLayout.layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, toPx(50, resources))
|
||||
addView(buttonLinearLayout)
|
||||
}
|
||||
// TODO: Observe friend request status changes
|
||||
}
|
||||
|
||||
private fun updateUI() {
|
||||
|
@ -42,8 +42,4 @@ class LokiMessageFriendRequestDatabase(context: Context, helper: SQLCipherOpenHe
|
||||
fun isFriendRequest(messageID: Long): Boolean {
|
||||
return getFriendRequestStatus(messageID) != LokiMessageFriendRequestStatus.NONE
|
||||
}
|
||||
|
||||
fun hasFriendRequestStatusMessage(messageID: Long): Boolean {
|
||||
return isFriendRequest(messageID) && getFriendRequestStatus(messageID) != LokiMessageFriendRequestStatus.REQUEST_SENDING_OR_FAILED
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user