Skip to content
Snippets Groups Projects
Verified Commit 80ee35d9 authored by Torsten Grote's avatar Torsten Grote
Browse files

[core] Return fake mini PNG as Attachment instead of throwing exception

parent 4796902b
No related branches found
No related tags found
1 merge request!1006Store attachments and actually attach them to sent messages
...@@ -32,6 +32,7 @@ import org.briarproject.briar.api.messaging.PrivateMessageHeader; ...@@ -32,6 +32,7 @@ import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent; import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.client.ConversationClientImpl; import org.briarproject.briar.client.ConversationClientImpl;
import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
...@@ -42,6 +43,7 @@ import javax.annotation.concurrent.Immutable; ...@@ -42,6 +43,7 @@ import javax.annotation.concurrent.Immutable;
import javax.inject.Inject; import javax.inject.Inject;
import static java.util.Collections.emptyList; import static java.util.Collections.emptyList;
import static org.briarproject.bramble.util.StringUtils.fromHexString;
import static org.briarproject.briar.client.MessageTrackerConstants.MSG_KEY_READ; import static org.briarproject.briar.client.MessageTrackerConstants.MSG_KEY_READ;
@Immutable @Immutable
...@@ -237,7 +239,11 @@ class MessagingManagerImpl extends ConversationClientImpl ...@@ -237,7 +239,11 @@ class MessagingManagerImpl extends ConversationClientImpl
@Override @Override
public Attachment getAttachment(MessageId m) { public Attachment getAttachment(MessageId m) {
// TODO add real implementation // TODO add real implementation
throw new IllegalStateException("Not yet implemented"); byte[] bytes = fromHexString("89504E470D0A1A0A0000000D49484452" +
"000000010000000108060000001F15C4" +
"890000000A49444154789C6300010000" +
"0500010D0A2DB40000000049454E44AE426082");
return new Attachment(new ByteArrayInputStream(bytes));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment