Skip to content

Commit ef2ddf0

Browse files
committed
ready to start debugging sn channels
1 parent 16ede0b commit ef2ddf0

5 files changed

Lines changed: 28 additions & 22 deletions

File tree

0 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
24.1 KB
Binary file not shown.

app/src/main/java/net/sharksystem/asap/sharknet/android/SNChannelAddMessageActivity.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import net.sharksystem.SharkException;
1212
import net.sharksystem.android.ASAPChannelIntent;
1313
import net.sharksystem.asap.ASAPException;
14-
import net.sharksystem.asap.sharknet.SharkNetMessage;
14+
import net.sharksystem.asap.sharknet.InMemoSNMessage;
15+
import net.sharksystem.asap.sharknet.SNMessage;
1516
import net.sharksystem.crypto.BasicKeyStore;
1617

1718
import java.io.IOException;
@@ -58,7 +59,7 @@ public void onAddClick(View view) {
5859
} else {
5960
try {
6061

61-
// let's sort the things out.
62+
// let's sort things out.
6263
CharSequence topic = this.uri;
6364
CharSequence sender =
6465
SNChannelsComponent.getSharkNetChannelComponent().getOwnerID();
@@ -71,20 +72,9 @@ public void onAddClick(View view) {
7172

7273
byte[] content = "TestContent".getBytes(); // TODO must come from GUI
7374

74-
// create sn message
75-
SharkNetMessage snMessage;
76-
77-
if(recipients.size() < 2) {
78-
snMessage = new SharkNetMessage(
79-
content, topic, sender, recipients.iterator().next(),
80-
sign, encrypt, basicKeyStore);
81-
} else { // more recipients
82-
snMessage = new SharkNetMessage(
83-
content, topic, sender, recipients, sign, basicKeyStore);
84-
}
85-
86-
// serialize
87-
byte[] serializedMessage = snMessage.getSerializedMessage();
75+
byte[] serializedMessage = null;
76+
serializedMessage = InMemoSNMessage.serializeMessage(
77+
content, sender, recipients, sign, encrypt, basicKeyStore);
8878

8979
// deliver as asap message
9080
this.sendASAPMessage(SNChannelsComponent.APP_NAME, this.uri,

app/src/main/java/net/sharksystem/asap/sharknet/android/SNChannelViewContentAdapter.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import net.sharksystem.R;
1212
import net.sharksystem.asap.ASAPChannel;
1313
import net.sharksystem.asap.ASAPException;
14-
import net.sharksystem.asap.sharknet.SharkNetMessage;
14+
import net.sharksystem.asap.sharknet.InMemoSNMessage;
15+
import net.sharksystem.asap.sharknet.SNMessage;
1516
import net.sharksystem.crypto.BasicKeyStore;
1617
import net.sharksystem.makan.Makan;
1718
import net.sharksystem.makan.android.MakanApp;
@@ -75,14 +76,11 @@ public static SharkNetMessage parseMessage(byte[] message, String sender, String
7576
CharSequence ownerID, BasicKeyStore basicKeyStore) throws IOException, ASAPException {
7677
*/
7778
CharSequence sender;
78-
String uri = this.asapChannel.getUri().toString();
79-
CharSequence ownerID = SNChannelsComponent.getSharkNetChannelComponent().getOwnerID();
80-
8179
BasicKeyStore basicKeyStore =
8280
SNChannelsComponent.getSharkNetChannelComponent().getBasicKeyStore();
8381

84-
SharkNetMessage snMessage =
85-
SharkNetMessage.parseMessage(asapMessage, uri, ownerID, basicKeyStore);
82+
SNMessage snMessage =
83+
InMemoSNMessage.parseMessage(asapMessage, basicKeyStore);
8684

8785
// produce SNMessage
8886
String date = "dummy Date";

0 commit comments

Comments
 (0)