Skip to content

Commit 20eeee3

Browse files
authored
Merge pull request #35 from ixian-platform/feat/SPIXIUP-3
Feat/SPIXIUP-3
2 parents eebdbfe + 923f2e9 commit 20eeee3

File tree

8 files changed

+20
-18
lines changed

8 files changed

+20
-18
lines changed

Spixi/Data/TransferManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public static bool sendFileData(Friend friend, string uid, ulong packet_number)
360360
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.fileData, m.ToArray());
361361

362362

363-
StreamMessage message = new StreamMessage();
363+
StreamMessage message = new StreamMessage(friend.protocolVersion);
364364
message.type = StreamMessageCode.data;
365365
message.recipient = friend.walletAddress;
366366
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -566,7 +566,7 @@ public static void sendFileTransferCompleted(Address sender, string uid)
566566

567567
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.fileFullyReceived, Crypto.stringToHash(uid));
568568

569-
StreamMessage message = new StreamMessage();
569+
StreamMessage message = new StreamMessage(friend.protocolVersion);
570570
message.type = StreamMessageCode.data;
571571
message.recipient = friend.walletAddress;
572572
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -594,7 +594,7 @@ public static void requestFileData(Address sender, string uid, ulong packet_numb
594594

595595
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.requestFileData, m.ToArray());
596596

597-
StreamMessage message = new StreamMessage();
597+
StreamMessage message = new StreamMessage(friend.protocolVersion);
598598
message.type = StreamMessageCode.data;
599599
message.recipient = friend.walletAddress;
600600
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -640,7 +640,7 @@ public static void acceptFile(Friend friend, string uid)
640640

641641
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.acceptFile, m.ToArray());
642642

643-
StreamMessage message = new StreamMessage();
643+
StreamMessage message = new StreamMessage(friend.protocolVersion);
644644
message.type = StreamMessageCode.data;
645645
message.recipient = friend.walletAddress;
646646
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();

Spixi/Meta/Config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class Config
3333
public static readonly int packetDataSize = 102400; // 100 Kb per packet for file transfers
3434
public static readonly long packetRequestTimeout = 60; // Time in seconds to re-request packets
3535

36-
public static readonly string version = "spixi-0.9.7"; // Spixi version
36+
public static readonly string version = "spixi-0.9.8-dev"; // Spixi version
3737

3838
public static readonly string checkVersionUrl = "https://resources.ixian.io/spixi-update.txt";
3939
public static readonly int checkVersionSeconds = 1 * 60 * 60; // 1 hour

Spixi/Network/StreamProcessor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ public override ReceiveDataResponse receiveData(byte[] bytes, RemoteEndpoint end
298298
}
299299

300300
case SpixiMessageCode.requestAdd:
301+
case SpixiMessageCode.requestAdd2:
301302
{
302303
if (friend.approved)
303304
{
@@ -315,6 +316,7 @@ public override ReceiveDataResponse receiveData(byte[] bytes, RemoteEndpoint end
315316
break;
316317

317318
case SpixiMessageCode.acceptAdd:
319+
case SpixiMessageCode.acceptAdd2:
318320
{
319321
Node.addMessageWithType(new byte[] { 1 }, FriendMessageType.standard, friend.walletAddress, 0, string.Format(SpixiLocalization._SL("global-friend-request-accepted"), friend.nickname));
320322
ProtocolMessage.resubscribeEvents();
@@ -470,7 +472,7 @@ public static StreamMessage sendAppRequest(Friend friend, string app_id, byte[]
470472
spixi_msg.type = SpixiMessageCode.appRequest;
471473
spixi_msg.data = new SpixiAppData(session_id, data, app_info).getBytes();
472474

473-
StreamMessage new_msg = new StreamMessage();
475+
StreamMessage new_msg = new StreamMessage(friend.protocolVersion);
474476
new_msg.type = StreamMessageCode.data;
475477
new_msg.recipient = friend.walletAddress;
476478
new_msg.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -488,7 +490,7 @@ public static void sendAppRequestAccept(Friend friend, byte[] session_id, byte[]
488490
spixi_msg.type = SpixiMessageCode.appRequestAccept;
489491
spixi_msg.data = new SpixiAppData(session_id, data).getBytes();
490492

491-
StreamMessage new_msg = new StreamMessage();
493+
StreamMessage new_msg = new StreamMessage(friend.protocolVersion);
492494
new_msg.type = StreamMessageCode.data;
493495
new_msg.recipient = friend.walletAddress;
494496
new_msg.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -504,7 +506,7 @@ public static void sendAppRequestReject(Friend friend, byte[] session_id, byte[]
504506
spixi_msg.type = SpixiMessageCode.appRequestReject;
505507
spixi_msg.data = new SpixiAppData(session_id, data).getBytes();
506508

507-
StreamMessage new_msg = new StreamMessage();
509+
StreamMessage new_msg = new StreamMessage(friend.protocolVersion);
508510
new_msg.type = StreamMessageCode.data;
509511
new_msg.recipient = friend.walletAddress;
510512
new_msg.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -520,7 +522,7 @@ public static void sendAppData(Friend friend, byte[] session_id, byte[] data)
520522
spixi_msg.type = SpixiMessageCode.appData;
521523
spixi_msg.data = (new SpixiAppData(session_id, data)).getBytes();
522524

523-
StreamMessage msg = new StreamMessage();
525+
StreamMessage msg = new StreamMessage(friend.protocolVersion);
524526
msg.type = StreamMessageCode.data;
525527
msg.recipient = friend.walletAddress;
526528
msg.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -541,7 +543,7 @@ public static void sendAppEndSession(Friend friend, byte[] session_id, byte[] da
541543
return;
542544
}
543545

544-
StreamMessage msg = new StreamMessage();
546+
StreamMessage msg = new StreamMessage(friend.protocolVersion);
545547
msg.type = StreamMessageCode.data;
546548
msg.recipient = friend.walletAddress;
547549
msg.sender = IxianHandler.getWalletStorage().getPrimaryAddress();

Spixi/Pages/Chat/SingleChatPage.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ public async void onSend(string str)
576576
Utils.sendUiCommand(this, "clearInput");
577577

578578

579-
StreamMessage message = new StreamMessage();
579+
StreamMessage message = new StreamMessage(friend.protocolVersion);
580580
message.type = StreamMessageCode.data;
581581
message.recipient = friend.walletAddress;
582582
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -632,7 +632,7 @@ public async Task onSendFile()
632632

633633
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.fileHeader, transfer.getBytes(), selectedChannel);
634634

635-
StreamMessage message = new StreamMessage();
635+
StreamMessage message = new StreamMessage(friend.protocolVersion);
636636
message.type = StreamMessageCode.data;
637637
message.recipient = friend.walletAddress;
638638
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -1375,7 +1375,7 @@ private void updateMessageReadStatus(FriendMessage message, int channel)
13751375
if (!friend.bot)
13761376
{
13771377
// Send read confirmation
1378-
StreamMessage msg_received = new StreamMessage();
1378+
StreamMessage msg_received = new StreamMessage(friend.protocolVersion);
13791379
msg_received.type = StreamMessageCode.info;
13801380
msg_received.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
13811381
msg_received.recipient = friend.walletAddress;

Spixi/Pages/Wallet/WalletContactRequestPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private void onDecline()
9191

9292
requestMsg.message = "::" + requestMsg.message;
9393

94-
StreamMessage message = new StreamMessage();
94+
StreamMessage message = new StreamMessage(friend.protocolVersion);
9595
message.type = StreamMessageCode.info;
9696
message.recipient = friend.walletAddress;
9797
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();
@@ -149,7 +149,7 @@ private void onSend()
149149

150150
requestMsg.message = ":" + transaction.getTxIdString();
151151

152-
StreamMessage message = new StreamMessage();
152+
StreamMessage message = new StreamMessage(friend.protocolVersion);
153153
message.type = StreamMessageCode.info;
154154
message.recipient = to;
155155
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();

Spixi/Pages/Wallet/WalletReceivePage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private void onRequest(string recipient, string amount)
184184

185185
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.requestFunds, Encoding.UTF8.GetBytes(amount));
186186

187-
StreamMessage message = new StreamMessage();
187+
StreamMessage message = new StreamMessage(friend.protocolVersion);
188188
message.type = StreamMessageCode.info;
189189
message.recipient = recipient_address;
190190
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();

Spixi/Pages/Wallet/WalletSend2Page.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private void sendPayment(string amount)
188188

189189
SpixiMessage spixi_message = new SpixiMessage(SpixiMessageCode.sentFunds, transaction.id);
190190

191-
StreamMessage message = new StreamMessage();
191+
StreamMessage message = new StreamMessage(friend.protocolVersion);
192192
message.type = StreamMessageCode.info;
193193
message.recipient = friend.walletAddress;
194194
message.sender = IxianHandler.getWalletStorage().getPrimaryAddress();

Spixi/Spixi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
</ItemGroup>
221221

222222
<ItemGroup>
223+
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.1" />
223224
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.1" />
224225
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.72" />
225226
<PackageReference Include="Concentus" Version="1.1.7" />
@@ -228,7 +229,6 @@
228229
<PackageReference Include="OneSignalSDK.DotNet" Version="5.2.1" />
229230
<PackageReference Include="Open.Nat" Version="2.1.0" />
230231
<PackageReference Include="Plugin.Fingerprint" Version="3.0.0-beta.1" />
231-
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
232232
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
233233
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
234234
<PackageReference Include="System.Drawing.Common" Version="8.0.4" />

0 commit comments

Comments
 (0)