OTR & another.im #23

Merged
Sergei Poljanski merged 65 commits from develop into master 2024-12-09 18:42:00 +00:00
2 changed files with 25 additions and 0 deletions
Showing only changes of commit e72b866fce - Show all commits

View file

@ -1310,6 +1310,21 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
}
}
protected void startOtrChat() {
int position = contact_context_id;
Contact contact = (Contact) contacts.get(position);
Conversation conversation = xmppConnectionService.findOrCreateConversation(contact.getAccount(), contact.getJid(), null, false, false, false, null);
selectPresence(conversation,
() -> {
Conversation c = xmppConnectionService.findOrCreateConversation(contact.getAccount(), contact.getJid(), null, false, false, false, conversation.getNextCounterpart());
conversation.setNextCounterpart(null);
if (c != null) {
switchToConversation(c);
}
});
}
private void setRefreshing(boolean refreshing) {
MyListFragment fragment = (MyListFragment) mListPagerAdapter.getItem(0);
@ -1451,9 +1466,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock);
final MenuItem showContactDetailsItem = menu.findItem(R.id.context_contact_details);
final MenuItem deleteContactMenuItem = menu.findItem(R.id.context_delete_contact);
final MenuItem startSecrectChat = menu.findItem(R.id.context_contact_start_secrect_chat);
if (contact.isSelf()) {
showContactDetailsItem.setVisible(false);
startSecrectChat.setVisible(false);
}
deleteContactMenuItem.setVisible(contact.showInRoster() && !contact.getOption(Contact.Options.SYNCED_VIA_OTHER));
final XmppConnection xmpp = contact.getAccount().getXmppConnection();
if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) {
@ -1492,6 +1510,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
break;
case R.id.context_delete_conference:
activity.deleteConference();
case R.id.context_contact_start_secrect_chat:
activity.startOtrChat();
}
return true;
}

View file

@ -4,6 +4,11 @@
<item
android:id="@+id/context_contact_details"
android:title="@string/view_contact_details"/>
<item
android:id="@+id/context_contact_start_secrect_chat"
android:title="@string/action_start_secret_chat"/>
<item
android:id="@+id/context_show_qr"
android:title="@string/show_qr_code"/>