Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class MentionAutocompleteItem extends AbstractFlexibleItem<ParticipantIte
public static final String SOURCE_CALLS = "calls";
public static final String SOURCE_GUESTS = "guests";

public static final String SOURCE_GROUPS = "groups";

private String source;
private final String objectId;
private final String displayName;
Expand Down Expand Up @@ -153,7 +155,7 @@ public void bindViewHolder(FlexibleAdapter<IFlexible> adapter,
holder.binding.secondaryText.setText("@" + objectId);
}

if (SOURCE_CALLS.equals(source)) {
if (SOURCE_CALLS.equals(source) || SOURCE_GROUPS.equals(source)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
ImageViewExtensionsKt.loadAvatar(
holder.binding.avatarView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : MessageHolde
val individualHashMap = message.messageParameters!![key]
if (individualHashMap != null) {
when (individualHashMap["type"]) {
"user", "guest", "call" -> {
"user", "guest", "call", "user-group" -> {
val chip = if (individualHashMap["id"] == message.activeUser!!.userId) {
R.xml.chip_you
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
val individualHashMap: HashMap<String?, String?>? = message.messageParameters!![key]
if (individualHashMap != null) {
when (individualHashMap["type"]) {
"user", "guest", "call" -> {
"user", "guest", "call", "user-group" -> {
val chip = if (individualHashMap["id"] == message.activeUser!!.userId) {
R.xml.chip_you
} else {
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,10 @@ class ChatActivity :
for (i in mentionSpans.indices) {
mentionSpan = mentionSpans[i]
var mentionId = mentionSpan.id
if (mentionId.contains(" ") || mentionId.startsWith("guest/")) {
if (mentionId.contains(" ") ||
mentionId.startsWith("guest/") ||
mentionId.startsWith("group/")
) {
mentionId = "\"" + mentionId + "\""
}
editable.replace(editable.getSpanStart(mentionSpan), editable.getSpanEnd(mentionSpan), "@$mentionId")
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ public static Drawable getDrawableForMentionChipSpan(Context context,

int drawable;

boolean isCall = "call".equals(type) || "calls".equals(type);
boolean isCallOrGroup =
"call".equals(type) || "calls".equals(type) || "groups".equals(type) || "user-group".equals(type);

if (!isCall) {
if (!isCallOrGroup) {
if (chipResource == R.xml.chip_you) {
drawable = R.drawable.mention_chip;
} else {
Expand All @@ -198,7 +199,7 @@ public static Drawable getDrawableForMentionChipSpan(Context context,

chip.setBounds(0, 0, chip.getIntrinsicWidth(), chip.getIntrinsicHeight());

if (!isCall) {
if (!isCallOrGroup) {
String url = ApiUtils.getUrlForAvatar(conversationUser.getBaseUrl(), id, true);
if ("guests".equals(type) || "guest".equals(type)) {
url = ApiUtils.getUrlForGuestAvatar(
Expand Down