Skip to content

Commit a7eb1bb

Browse files
committed
Prepare SNMessage to be used in SN2 Android App
1 parent 87e8cf3 commit a7eb1bb

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/net/sharksystem/asap/sharknet/InMemoSNMessage.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private InMemoSNMessage(byte[] message, CharSequence sender,
4545
this.creationTime = creationTime;
4646
}
4747

48-
static byte[] serializeMessage(byte[] content, CharSequence sender, CharSequence recipient)
48+
public static byte[] serializeMessage(byte[] content, CharSequence sender, CharSequence recipient)
4949
throws IOException, ASAPException {
5050

5151
Set<CharSequence> recipients = null;
@@ -58,14 +58,14 @@ static byte[] serializeMessage(byte[] content, CharSequence sender, CharSequence
5858
false, false, null);
5959
}
6060

61-
static byte[] serializeMessage(byte[] content, CharSequence sender, Set<CharSequence> recipients)
61+
public static byte[] serializeMessage(byte[] content, CharSequence sender, Set<CharSequence> recipients)
6262
throws IOException, ASAPException {
6363

6464
return InMemoSNMessage.serializeMessage(content, sender, recipients,
6565
false, false, null);
6666
}
6767

68-
static byte[] serializeMessage(byte[] content, CharSequence sender, CharSequence recipient,
68+
public static byte[] serializeMessage(byte[] content, CharSequence sender, CharSequence recipient,
6969
boolean sign, boolean encrypt,
7070
BasicKeyStore basicKeyStore)
7171
throws IOException, ASAPException {
@@ -81,7 +81,7 @@ static byte[] serializeMessage(byte[] content, CharSequence sender, CharSequence
8181

8282
}
8383

84-
static byte[] serializeMessage(byte[] content, CharSequence sender, Set<CharSequence> recipients,
84+
public static byte[] serializeMessage(byte[] content, CharSequence sender, Set<CharSequence> recipients,
8585
boolean sign, boolean encrypt, BasicKeyStore basicKeyStore)
8686
throws IOException, ASAPException {
8787

@@ -161,23 +161,22 @@ public Timestamp getCreationTime() {
161161

162162
@Override
163163
public boolean isLaterThan(SNMessage message) throws ASAPException, IOException {
164-
Date sentDateMessage = message.getCreationTime();
165-
Date sentDateMe = this.getCreationTime();
166-
167-
return sentDateMe.after(sentDateMessage);
164+
Timestamp messageCreationTime = message.getCreationTime();
165+
return messageCreationTime.after(this.getCreationTime());
168166
}
167+
169168
//////////////////////////////////////////////////////////////////////////////////////////
170169
// factory methods //
171170
//////////////////////////////////////////////////////////////////////////////////////////
172171

173-
static InMemoSNMessage parseMessage(byte[] message)
172+
public static InMemoSNMessage parseMessage(byte[] message)
174173
throws IOException, ASAPException {
175174

176175
return InMemoSNMessage.parseMessage(message, null);
177176

178177
}
179178

180-
static InMemoSNMessage parseMessage(byte[] message, BasicKeyStore basicKeyStore)
179+
public static InMemoSNMessage parseMessage(byte[] message, BasicKeyStore basicKeyStore)
181180
throws IOException, ASAPException {
182181

183182
ByteArrayInputStream bais = new ByteArrayInputStream(message);

0 commit comments

Comments
 (0)