Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-android
Commits
79f1ac47
Commit
79f1ac47
authored
Jun 28, 2021
by
Adrien Béraud
Browse files
smartlist: fix crash when searching
Change-Id: Id83ff61029299d77d9661f935f3c1d4d41980700
parent
1b7571c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
ring-android/app/src/main/java/cx/ring/viewholders/SmartListViewHolder.java
View file @
79f1ac47
...
...
@@ -38,6 +38,7 @@ import cx.ring.databinding.ItemSmartlistBinding;
import
cx.ring.databinding.ItemSmartlistHeaderBinding
;
import
cx.ring.utils.ResourceMapper
;
import
cx.ring.views.AvatarDrawable
;
import
io.reactivex.rxjava3.core.Observable
;
import
io.reactivex.rxjava3.disposables.CompositeDisposable
;
public
class
SmartListViewHolder
extends
RecyclerView
.
ViewHolder
{
...
...
@@ -65,10 +66,10 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder {
if
(
binding
!=
null
)
{
itemView
.
setOnClickListener
(
v
->
clickListener
.
onItemClick
(
smartListViewModel
));
compositeDisposable
.
add
(
smartListViewModel
.
getSelected
()
.
subscribe
(
selected
->
{
Log
.
w
(
"SmartListViewHolder"
,
"selected "
+
selected
+
" "
+
smartListViewModel
.
getContactName
());
binding
.
itemLayout
.
setActivated
(
selected
);
}
));
Observable
<
Boolean
>
selected
=
smartListViewModel
.
getSelected
()
;
if
(
selected
!=
null
)
{
compositeDisposable
.
add
(
smartListViewModel
.
getSelected
().
subscribe
(
binding
.
itemLayout
::
setActivated
)
);
}
itemView
.
setOnLongClickListener
(
v
->
{
clickListener
.
onItemLongClick
(
smartListViewModel
);
return
true
;
...
...
ring-android/libringclient/src/main/java/net/jami/model/Conversation.java
View file @
79f1ac47
...
...
@@ -344,8 +344,13 @@ public class Conversation extends ConversationHistory {
if
(
interaction
.
getContact
()
==
null
)
{
if
(
mContacts
.
size
()
==
1
)
interaction
.
setContact
(
mContacts
.
get
(
0
));
else
interaction
.
setContact
(
findContact
(
Uri
.
fromString
(
interaction
.
getAuthor
())));
else
{
if
(
interaction
.
getAuthor
()
==
null
)
{
Log
.
e
(
TAG
,
"Can't set interaction properties: no author for type:"
+
interaction
.
getType
()
+
" id:"
+
interaction
.
getId
()
+
" status:"
+
interaction
.
mStatus
);
}
else
{
interaction
.
setContact
(
findContact
(
Uri
.
fromString
(
interaction
.
getAuthor
())));
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment