Commit a08a2dfb authored by Viktor Porvaznik's avatar Viktor Porvaznik Committed by Viktor Porvaznik

Fixed hash creation #2

parent b146023a
......@@ -93,7 +93,7 @@ public class FileSyncPlugin extends Plugin {
Log.i("FileSyncPlugin", "Hash request received.");
List<String> fileList = np.getStringList("fileList");
JSONArray fileHashes = new JSONArray();
JSONArray hashArray = new JSONArray();
if (fileList.size() == 0) {
Log.w("FileSyncPlugin", "Requested hashes for 0 files.");
}
......@@ -109,10 +109,10 @@ public class FileSyncPlugin extends Plugin {
} catch (JSONException e) {
e.printStackTrace();
}
fileHashes.put(fileHash);
hashArray.put(fileHash);
}
NetworkPacket responsePacket = new NetworkPacket(PACKET_TYPE_FILESYNC_HASH_LIST);
responsePacket.set("fileHashes", fileHashes);
responsePacket.set("hashArray", hashArray);
device.sendPacket(responsePacket);
} else if (!errorOccured && np.getType().equals(PACKET_TYPE_FILESYNC_SYNC_RESULT)) {
String syncStatus = np.getString("syncStatus");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment