mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-06 03:49:58 +02:00
remove DC_MSG_VIDEOCHAT_INVITATION
This commit is contained in:
parent
cb465ec85e
commit
f6ce98f9a2
8 changed files with 4 additions and 229 deletions
|
@ -18,7 +18,6 @@ public class DcMsg {
|
||||||
public final static int DC_MSG_VOICE = 41;
|
public final static int DC_MSG_VOICE = 41;
|
||||||
public final static int DC_MSG_VIDEO = 50;
|
public final static int DC_MSG_VIDEO = 50;
|
||||||
public final static int DC_MSG_FILE = 60;
|
public final static int DC_MSG_FILE = 60;
|
||||||
public final static int DC_MSG_VIDEOCHAT_INVITATION = 70;
|
|
||||||
public final static int DC_MSG_WEBXDC = 80;
|
public final static int DC_MSG_WEBXDC = 80;
|
||||||
public final static int DC_MSG_VCARD = 90;
|
public final static int DC_MSG_VCARD = 90;
|
||||||
|
|
||||||
|
@ -191,7 +190,7 @@ public class DcMsg {
|
||||||
|
|
||||||
public boolean canSave() {
|
public boolean canSave() {
|
||||||
// saving info-messages out of context results in confusion, see https://github.com/deltachat/deltachat-ios/issues/2567
|
// saving info-messages out of context results in confusion, see https://github.com/deltachat/deltachat-ios/issues/2567
|
||||||
return !isInfo() && getType() != DC_MSG_VIDEOCHAT_INVITATION;
|
return !isInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getFileAsFile() {
|
public File getFileAsFile() {
|
||||||
|
|
|
@ -1459,7 +1459,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
Recipient author = new Recipient(this, dcContext.getContact(msg.getFromId()));
|
Recipient author = new Recipient(this, dcContext.getContact(msg.getFromId()));
|
||||||
|
|
||||||
SlideDeck slideDeck = new SlideDeck();
|
SlideDeck slideDeck = new SlideDeck();
|
||||||
if (msg.getType() != DcMsg.DC_MSG_TEXT) {
|
if (msg.hasFile()) {
|
||||||
slideDeck.addSlide(MediaUtil.getSlideForMsg(this, msg));
|
slideDeck.addSlide(MediaUtil.getSlideForMsg(this, msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,6 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
|
||||||
private static final int MESSAGE_TYPE_THUMBNAIL_INCOMING = 6;
|
private static final int MESSAGE_TYPE_THUMBNAIL_INCOMING = 6;
|
||||||
private static final int MESSAGE_TYPE_DOCUMENT_OUTGOING = 7;
|
private static final int MESSAGE_TYPE_DOCUMENT_OUTGOING = 7;
|
||||||
private static final int MESSAGE_TYPE_DOCUMENT_INCOMING = 8;
|
private static final int MESSAGE_TYPE_DOCUMENT_INCOMING = 8;
|
||||||
private static final int MESSAGE_TYPE_VIDEOCHAT_INVITE = 9;
|
|
||||||
private static final int MESSAGE_TYPE_STICKER_INCOMING = 10;
|
private static final int MESSAGE_TYPE_STICKER_INCOMING = 10;
|
||||||
private static final int MESSAGE_TYPE_STICKER_OUTGOING = 11;
|
private static final int MESSAGE_TYPE_STICKER_OUTGOING = 11;
|
||||||
|
|
||||||
|
@ -279,7 +278,6 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
|
||||||
case MESSAGE_TYPE_STICKER_INCOMING:
|
case MESSAGE_TYPE_STICKER_INCOMING:
|
||||||
case MESSAGE_TYPE_INCOMING: return R.layout.conversation_item_received;
|
case MESSAGE_TYPE_INCOMING: return R.layout.conversation_item_received;
|
||||||
case MESSAGE_TYPE_INFO: return R.layout.conversation_item_update;
|
case MESSAGE_TYPE_INFO: return R.layout.conversation_item_update;
|
||||||
case MESSAGE_TYPE_VIDEOCHAT_INVITE:return R.layout.conversation_item_videochat;
|
|
||||||
default: throw new IllegalArgumentException("unsupported item view type given to ConversationAdapter");
|
default: throw new IllegalArgumentException("unsupported item view type given to ConversationAdapter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,9 +301,6 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
|
||||||
else if (type == DcMsg.DC_MSG_STICKER) {
|
else if (type == DcMsg.DC_MSG_STICKER) {
|
||||||
return dcMsg.isOutgoing()? MESSAGE_TYPE_STICKER_OUTGOING : MESSAGE_TYPE_STICKER_INCOMING;
|
return dcMsg.isOutgoing()? MESSAGE_TYPE_STICKER_OUTGOING : MESSAGE_TYPE_STICKER_INCOMING;
|
||||||
}
|
}
|
||||||
else if (type == DcMsg.DC_MSG_VIDEOCHAT_INVITATION) {
|
|
||||||
return MESSAGE_TYPE_VIDEOCHAT_INVITE;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
return dcMsg.isOutgoing()? MESSAGE_TYPE_OUTGOING : MESSAGE_TYPE_INCOMING;
|
return dcMsg.isOutgoing()? MESSAGE_TYPE_OUTGOING : MESSAGE_TYPE_INCOMING;
|
||||||
}
|
}
|
||||||
|
|
|
@ -362,11 +362,11 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean canReplyToMsg(DcMsg dcMsg) {
|
static boolean canReplyToMsg(DcMsg dcMsg) {
|
||||||
return !dcMsg.isInfo() && dcMsg.getType() != DcMsg.DC_MSG_VIDEOCHAT_INVITATION;
|
return !dcMsg.isInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean canEditMsg(DcMsg dcMsg) {
|
static boolean canEditMsg(DcMsg dcMsg) {
|
||||||
return dcMsg.isOutgoing() && !dcMsg.isInfo() && dcMsg.getType() != DcMsg.DC_MSG_VIDEOCHAT_INVITATION && !dcMsg.hasHtml() && !dcMsg.getText().isEmpty();
|
return dcMsg.isOutgoing() && !dcMsg.isInfo() && !dcMsg.hasHtml() && !dcMsg.getText().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleClearChat() {
|
public void handleClearChat() {
|
||||||
|
@ -738,9 +738,6 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||||
actionMode.setTitleOptionalHint(false); // the title represents important information, also indicating implicitly, more items can be selected
|
actionMode.setTitleOptionalHint(false); // the title represents important information, also indicating implicitly, more items can be selected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (messageRecord.getType()==DcMsg.DC_MSG_VIDEOCHAT_INVITATION) {
|
|
||||||
VideochatUtil.joinMeeting(getActivity(), messageRecord.getId());
|
|
||||||
}
|
|
||||||
else if(DozeReminder.isDozeReminderMsg(getContext(), messageRecord)) {
|
else if(DozeReminder.isDozeReminderMsg(getContext(), messageRecord)) {
|
||||||
DozeReminder.dozeReminderTapped(getContext());
|
DozeReminder.dozeReminderTapped(getContext());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,99 +0,0 @@
|
||||||
package org.thoughtcrime.securesms;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.b44t.messenger.DcChat;
|
|
||||||
import com.b44t.messenger.DcContact;
|
|
||||||
import com.b44t.messenger.DcContext;
|
|
||||||
import com.b44t.messenger.DcMsg;
|
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.components.AvatarImageView;
|
|
||||||
import org.thoughtcrime.securesms.components.ConversationItemFooter;
|
|
||||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
|
||||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
|
||||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class ConversationVideochatItem extends LinearLayout
|
|
||||||
implements BindableConversationItem
|
|
||||||
{
|
|
||||||
private TextView body;
|
|
||||||
private ConversationItemFooter footer;
|
|
||||||
private AvatarImageView contactPhoto;
|
|
||||||
private ViewGroup contactPhotoHolder;
|
|
||||||
private DcMsg dcMsg;
|
|
||||||
|
|
||||||
public ConversationVideochatItem(Context context) {
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConversationVideochatItem(Context context, AttributeSet attrs) {
|
|
||||||
super(context, attrs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinishInflate() {
|
|
||||||
super.onFinishInflate();
|
|
||||||
this.body = findViewById(R.id.conversation_update_body);
|
|
||||||
this.footer = findViewById(R.id.conversation_item_footer);
|
|
||||||
this.contactPhoto = findViewById(R.id.contact_photo);
|
|
||||||
this.contactPhotoHolder = findViewById(R.id.contact_photo_container);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void bind(@NonNull DcMsg dcMsg,
|
|
||||||
@NonNull DcChat dcChat,
|
|
||||||
@NonNull GlideRequests glideRequests,
|
|
||||||
@NonNull Set<DcMsg> batchSelected,
|
|
||||||
@NonNull Recipient conversationRecipient,
|
|
||||||
boolean pulseUpdate)
|
|
||||||
{
|
|
||||||
this.dcMsg = dcMsg;
|
|
||||||
DcContext dcContext = DcHelper.getContext(getContext());
|
|
||||||
DcContact dcContact = dcContext.getContact(dcMsg.getFromId());
|
|
||||||
|
|
||||||
CharSequence line1 = dcMsg.isOutgoing()? getContext().getString(R.string.videochat_you_invited_hint) :
|
|
||||||
getContext().getString(R.string.videochat_contact_invited_hint, dcContact.getDisplayName());
|
|
||||||
CharSequence line2 = Util.getBoldedString(dcMsg.isOutgoing()? getContext().getString(R.string.videochat_tap_to_open) :
|
|
||||||
getContext().getString(R.string.videochat_tap_to_join));
|
|
||||||
|
|
||||||
body.setText(TextUtils.concat(line1, "\n", line2));
|
|
||||||
|
|
||||||
contactPhoto.setAvatar(glideRequests, new Recipient(getContext(), dcContact), true);
|
|
||||||
|
|
||||||
setSelected(batchSelected.contains(dcMsg));
|
|
||||||
setFooter(dcMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setFooter(@NonNull DcMsg dcMsg) {
|
|
||||||
ViewUtil.updateLayoutParams(footer, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
|
||||||
|
|
||||||
footer.setVisibility(VISIBLE);
|
|
||||||
footer.setMessageRecord(dcMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setEventListener(@Nullable EventListener listener) {
|
|
||||||
// No events to report yet
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DcMsg getMessageRecord() {
|
|
||||||
return dcMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void unbind() {
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -66,7 +66,6 @@ public class AddReactionView extends LinearLayout {
|
||||||
init(); // init delayed as needed
|
init(); // init delayed as needed
|
||||||
|
|
||||||
if ( msgToReactTo.isInfo()
|
if ( msgToReactTo.isInfo()
|
||||||
|| msgToReactTo.getType() == DcMsg.DC_MSG_VIDEOCHAT_INVITATION
|
|
||||||
|| !dcContext.getChat(msgToReactTo.getChatId()).canSend()) {
|
|| !dcContext.getChat(msgToReactTo.getChatId()).canSend()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,26 +5,15 @@ import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
|
|
||||||
import com.b44t.messenger.DcChat;
|
|
||||||
import com.b44t.messenger.DcContext;
|
import com.b44t.messenger.DcContext;
|
||||||
import com.b44t.messenger.DcMsg;
|
import com.b44t.messenger.DcMsg;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
import org.thoughtcrime.securesms.connect.DcHelper;
|
||||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||||
import org.thoughtcrime.securesms.util.IntentUtils;
|
|
||||||
|
|
||||||
public class VideochatUtil {
|
public class VideochatUtil {
|
||||||
|
|
||||||
public static void joinMeeting(Activity activity, int msgId) {
|
|
||||||
DcContext dcContext = DcHelper.getContext(activity);
|
|
||||||
DcMsg dcMsg = dcContext.getMsg(msgId);
|
|
||||||
String videochatUrl = dcMsg.getVideochatUrl();
|
|
||||||
IntentUtils.showInBrowser(activity, videochatUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void startCall(Activity activity, int chatId) {
|
public static void startCall(Activity activity, int chatId) {
|
||||||
openCall(activity, chatId, 0, "#call");
|
openCall(activity, chatId, 0, "#call");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,105 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<org.thoughtcrime.securesms.ConversationVideochatItem
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/conversation_item_background"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="13dp"
|
|
||||||
android:paddingBottom="13dp"
|
|
||||||
android:paddingLeft="28dp"
|
|
||||||
android:paddingRight="28dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/video_icon_container"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginLeft="2dp"
|
|
||||||
android:layout_marginRight="2dp"
|
|
||||||
android:background="@drawable/circle_universal_overlay"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentBottom="true">
|
|
||||||
<ImageView android:id="@+id/video_icon"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
app:srcCompat="@drawable/ic_videocam_white_24dp" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/contact_photo_container"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="2dp"
|
|
||||||
android:layout_marginRight="2dp"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentBottom="true">
|
|
||||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
|
||||||
android:id="@+id/contact_photo"
|
|
||||||
android:foreground="@drawable/contact_photo_background"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:cropToPadding="true"
|
|
||||||
android:contentDescription="@null" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/conversation_update_body"
|
|
||||||
style="@style/Delta.Text.UpdateHeader"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:autoLink="none"
|
|
||||||
android:linksClickable="false"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?attr/conversation_item_update_text_color"
|
|
||||||
android:background="@drawable/conversation_item_update_background"
|
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingTop="9dp"
|
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:lineSpacingMultiplier="1.3"
|
|
||||||
tools:text="Paddy invited to a video chat" />
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.ConversationItemFooter
|
|
||||||
android:id="@+id/conversation_item_footer"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
|
|
||||||
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:paddingTop="2dp"
|
|
||||||
android:paddingBottom="2dp"
|
|
||||||
android:paddingLeft="@dimen/message_bubble_horizontal_padding"
|
|
||||||
android:paddingRight="@dimen/message_bubble_horizontal_padding"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:gravity="end"
|
|
||||||
android:clipChildren="false"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:background="@drawable/conversation_item_update_background"
|
|
||||||
app:footer_text_color="@color/core_dark_05"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</org.thoughtcrime.securesms.ConversationVideochatItem>
|
|
Loading…
Add table
Add a link
Reference in a new issue