Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 9ff0975

Browse files
Sam1301timabbott
authored andcommitted
Correct emoji file paths in Message.java.
Fixes #299.
1 parent 9d27952 commit 9ff0975

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/src/main/java/com/zulip/android/models/Message.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,16 @@ public static Spanned formatContent(String source, final ZulipApp app) {
321321
Html.ImageGetter emojiGetter = new Html.ImageGetter() {
322322
@Override
323323
public Drawable getDrawable(String source) {
324-
int lastIndex = -1;
324+
int imagesIndex = -1;
325325
if (source != null) {
326-
lastIndex = source.lastIndexOf('/');
326+
imagesIndex = source.indexOf("images/");
327327
}
328-
if (lastIndex != -1) {
329-
String filename = source.substring(lastIndex + 1);
328+
if (imagesIndex != -1) {
329+
String filename = source.substring(imagesIndex + "images/".length());
330+
330331
try {
331332
Drawable drawable = Drawable.createFromStream(context
332-
.getAssets().open("emoji/" + filename),
333-
"emoji/" + filename);
333+
.getAssets().open(filename), filename);
334334
if (drawable == null) {
335335
Drawable transparentDrawable = new ColorDrawable(Color.TRANSPARENT);
336336
transparentDrawable.setBounds(new Rect(0, 0, 0, 0));

0 commit comments

Comments
 (0)