use of com.waz.api.IConversation in project wire-android by wireapp.
the class MainActivity method startCall.
private void startCall(final boolean withVideo) {
final IConversation currentConversation = getStoreFactory().getConversationStore().getCurrentConversation();
if (currentConversation == null) {
return;
}
final VoiceChannel voiceChannel = currentConversation.getVoiceChannel();
if (currentConversation.hasUnjoinedCall() && voiceChannel.isVideoCall() != withVideo) {
ViewUtils.showAlertDialog(this, getString(R.string.calling__cannot_start__ongoing_different_kind__title, currentConversation.getName()), getString(R.string.calling__cannot_start__ongoing_different_kind__message), getString(R.string.calling__cannot_start__button), null, true);
return;
}
if (currentConversation.getType() == IConversation.Type.GROUP && currentConversation.getUsers().size() >= 5) {
int users = currentConversation.getUsers().size();
ViewUtils.showAlertDialog(this, getString(R.string.group_calling_title), getString(R.string.group_calling_message, users), getString(R.string.group_calling_confirm), getString(R.string.group_calling_cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
injectJava(CallPermissionsController.class).startCall(new ConvId(voiceChannel.getConversation().getId()), withVideo);
}
}, null);
return;
} else {
injectJava(CallPermissionsController.class).startCall(new ConvId(voiceChannel.getConversation().getId()), withVideo);
}
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ScalaConversationStore method loadConnectRequestInboxConversations.
@Override
public void loadConnectRequestInboxConversations(OnInboxLoadedListener onConversationsLoadedListener, InboxLoadRequester inboxLoadRequester) {
final List<IConversation> matches = new ArrayList<>();
for (int i = 0; i < inboxList.size(); i++) {
IConversation conversation = inboxList.get(i);
if (isPendingIncomingConnectRequest(conversation)) {
matches.add(conversation);
}
}
onConversationsLoadedListener.onConnectRequestInboxConversationsLoaded(matches, inboxLoadRequester);
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ScalaConversationStore method getNextConversation.
@Override
public IConversation getNextConversation() {
if (conversationsList == null || conversationsList.size() == 0) {
return null;
}
for (int i = 0; i < conversationsList.size(); i++) {
IConversation previousConversation = i >= 1 ? conversationsList.get(i - 1) : null;
IConversation conversation = conversationsList.get(i);
IConversation nextConversation = i == (conversationsList.size() - 1) ? null : conversationsList.get(i + 1);
if (selectedConversation.equals(conversation)) {
if (nextConversation != null) {
return nextConversation;
}
return previousConversation;
}
}
return null;
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ScalaConversationStore method setCurrentConversation.
@Override
public void setCurrentConversation(IConversation conversation, ConversationChangeRequester conversationChangerSender) {
if (conversation instanceof InboxLinkConversation) {
conversation = inboxList.get(0);
}
if (conversation != null) {
conversation.setArchived(false);
}
if (conversation != null) {
Timber.i("Set current conversation to %s, requester %s", conversation.getName(), conversationChangerSender);
} else {
Timber.i("Set current conversation to null, requester %s", conversationChangerSender);
}
this.conversationChangeRequester = conversationChangerSender;
IConversation oldConversation = conversationChangerSender == ConversationChangeRequester.FIRST_LOAD ? null : selectedConversation;
conversationsList.setSelectedConversation(conversation);
if (oldConversation == null || (oldConversation != null && conversation != null && oldConversation.getId().equals(conversation.getId()))) {
// Notify explicitly if the conversation doesn't change, the UiSginal notifies only when the conversation changes
notifyCurrentConversationHasChanged(oldConversation, conversation, conversationChangerSender);
}
}
Aggregations