Commit 773bf72b by Sebastián Katzer

Change attribute for message from text: to message:

parent 402e3a09
...@@ -106,6 +106,13 @@ public final class Options { ...@@ -106,6 +106,13 @@ public final class Options {
} }
/** /**
* JSON object as string.
*/
public String toString() {
return options.toString();
}
/**
* Gets the ID for the local notification. * Gets the ID for the local notification.
* *
* @return 0 if the user did not specify. * @return 0 if the user did not specify.
...@@ -558,12 +565,12 @@ public final class Options { ...@@ -558,12 +565,12 @@ public final class Options {
* @return null if there are no messages. * @return null if there are no messages.
*/ */
Message[] getMessages() { Message[] getMessages() {
Object value = options.opt("text"); Object text = options.opt("text");
if (value == null || value instanceof String) if (text == null || text instanceof String)
return null; return null;
JSONArray list = (JSONArray) value; JSONArray list = (JSONArray) text;
if (list.length() == 0) if (list.length() == 0)
return null; return null;
...@@ -573,24 +580,17 @@ public final class Options { ...@@ -573,24 +580,17 @@ public final class Options {
for (int i = 0; i < messages.length; i++) { for (int i = 0; i < messages.length; i++) {
JSONObject msg = list.optJSONObject(i); JSONObject msg = list.optJSONObject(i);
String text = msg.optString("text"); String message = msg.optString("message");
long timestamp = msg.optLong("date", now); long timestamp = msg.optLong("date", now);
String person = msg.optString("person", null); String person = msg.optString("person", null);
messages[i] = new Message(text, timestamp, person); messages[i] = new Message(message, timestamp, person);
} }
return messages; return messages;
} }
/** /**
* JSON object as string.
*/
public String toString() {
return options.toString();
}
/**
* Strips the hex code #FF00FF => FF00FF * Strips the hex code #FF00FF => FF00FF
* *
* @param hex The hex code to strip. * @param hex The hex code to strip.
......
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