summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <richy@cyborgsociety.org>2013-12-16 23:11:41 +0100
committercyBerta <richy@cyborgsociety.org>2013-12-16 23:11:41 +0100
commit4d9b896481594297421a157a5906b5a8ead48ab6 (patch)
tree3627ff7ad1736a54976c7f35571c87c043065084
parent72f1d170adbaa08ca846a0e4ec77556c9a7ffc7d (diff)
Correct the location name in the notification (Bug #4660)
-rw-r--r--src/se/leap/bitmaskclient/EIP.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java
index ec2f6972..edd73e83 100644
--- a/src/se/leap/bitmaskclient/EIP.java
+++ b/src/se/leap/bitmaskclient/EIP.java
@@ -439,7 +439,8 @@ public final class EIP extends IntentService {
String ports = "ports";
String protos = "protocols";
String capabilities = "capabilities";
- String location = "location";
+ String location_key = "location";
+ String locations = "locations";
Vector<String> arg = new Vector<String>();
Vector<Vector<String>> args = new Vector<Vector<String>>();
@@ -456,7 +457,6 @@ public final class EIP extends IntentService {
arg.add(word);
value.add( (Vector<String>) arg.clone() );
options.put(key, (Vector<Vector<String>>) value.clone());
-
value.clear();
arg.clear();
}
@@ -477,16 +477,22 @@ public final class EIP extends IntentService {
arg.clear();
args.clear();
+
try {
- arg.add(location);
- arg.add(mGateway.getString(location));
+
+ arg.add(location_key);
+ String locationText = "";
+ locationText = eipDefinition.getJSONObject(locations).getJSONObject(mGateway.getString(location_key)).getString("name");
+ arg.add(locationText);
+
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
args.add((Vector<String>) arg.clone());
options.put("location", (Vector<Vector<String>>) args.clone() );
+
arg.clear();
args.clear();
JSONArray protocolsJSON = null;