New history types

pull/14/head
Sam Bosley 13 years ago
parent d1b0b66de7
commit 5d963bc441

@ -131,5 +131,9 @@ public class History extends AbstractModel {
public static final String COL_IS_SILENT = "is_silent";
public static final String COL_IS_FAVORITE = "is_favorite";
public static final String COL_USER_ID = "user_id";
public static final String COL_ATTACHMENT_ADDED = "attachment_added";
public static final String COL_ATTACHMENT_REMOVED = "attachment_removed";
public static final String COL_ACKNOWLEDGED = "acknowledged";
}

@ -25,6 +25,8 @@
<string name="history_this_task">this task</string>
<string name="history_tag_added">added %1$s to %2$s</string>
<string name="history_tag_removed">removed %1$s from %2$s</string>
<string name="history_attach_added">attached %1$s to %2$s</string>
<string name="history_attach_removed">removed %1$s from %2$s</string>
<string name="history_left_list">left %s</string>
<string name="history_deleted">deleted %s</string>
<string name="history_undeleted">undeleted %s</string>
@ -68,6 +70,7 @@
<string name="history_repeat_every">every %s</string>
<string name="history_repeat_on">on %s</string>
<string name="history_repeat_from_completion">after completion</string>
<string name="history_acknowledged">viewed %s</string>
<string name="history_default">changed %1$s to %2$s</string>
</resources>

@ -467,6 +467,15 @@ public class UpdateAdapter extends CursorAdapter {
else
result = context.getString(R.string.history_tag_removed, item, tagName);
} else if (History.COL_ATTACHMENT_ADDED.equals(column) || History.COL_ATTACHMENT_REMOVED.equals(column)) {
JSONArray attachmentArray = new JSONArray(newValue);
String attachmentName = attachmentArray.getString(1);
if (History.COL_ATTACHMENT_ADDED.equals(column))
result = context.getString(R.string.history_attach_added, item, attachmentName);
else
result = context.getString(R.string.history_attach_removed, item, attachmentName);
} else if (History.COL_ACKNOWLEDGED.equals(column)) {
result = context.getString(R.string.history_acknowledged, item);
} else if (History.COL_SHARED_WITH.equals(column) || History.COL_UNSHARED_WITH.equals(column)) {
JSONArray members = new JSONArray(newValue);
String userId = history.getValue(History.USER_UUID);

Loading…
Cancel
Save