use of android.content.ContentValues in project Signal-Android by WhisperSystems.
the class RecipientPreferenceDatabase method setSeenInviteReminder.
public void setSeenInviteReminder(Recipients recipients, boolean seen) {
ContentValues values = new ContentValues(1);
values.put(SEEN_INVITE_REMINDER, seen ? 1 : 0);
updateOrInsert(recipients, values);
}
use of android.content.ContentValues in project Signal-Android by WhisperSystems.
the class RecipientPreferenceDatabase method setMuted.
public void setMuted(Recipients recipients, long until) {
Log.w(TAG, "Setting muted until: " + until);
ContentValues values = new ContentValues();
values.put(MUTE_UNTIL, until);
updateOrInsert(recipients, values);
}
use of android.content.ContentValues in project Signal-Android by WhisperSystems.
the class GroupDatabase method updateMembers.
public void updateMembers(byte[] id, List<String> members) {
ContentValues contents = new ContentValues();
contents.put(MEMBERS, Util.join(members, ","));
contents.put(ACTIVE, 1);
databaseHelper.getWritableDatabase().update(TABLE_NAME, contents, GROUP_ID + " = ?", new String[] { GroupUtil.getEncodedId(id) });
}
use of android.content.ContentValues in project Signal-Android by WhisperSystems.
the class GroupDatabase method create.
public void create(byte[] groupId, String title, List<String> members, SignalServiceAttachmentPointer avatar, String relay) {
ContentValues contentValues = new ContentValues();
contentValues.put(GROUP_ID, GroupUtil.getEncodedId(groupId));
contentValues.put(TITLE, title);
contentValues.put(MEMBERS, Util.join(members, ","));
if (avatar != null) {
contentValues.put(AVATAR_ID, avatar.getId());
contentValues.put(AVATAR_KEY, avatar.getKey());
contentValues.put(AVATAR_CONTENT_TYPE, avatar.getContentType());
contentValues.put(AVATAR_DIGEST, avatar.getDigest().orNull());
}
contentValues.put(AVATAR_RELAY, relay);
contentValues.put(TIMESTAMP, System.currentTimeMillis());
contentValues.put(ACTIVE, 1);
databaseHelper.getWritableDatabase().insert(TABLE_NAME, null, contentValues);
notifyConversationListListeners();
}
use of android.content.ContentValues in project Signal-Android by WhisperSystems.
the class GroupDatabase method update.
public void update(byte[] groupId, String title, SignalServiceAttachmentPointer avatar) {
ContentValues contentValues = new ContentValues();
if (title != null)
contentValues.put(TITLE, title);
if (avatar != null) {
contentValues.put(AVATAR_ID, avatar.getId());
contentValues.put(AVATAR_CONTENT_TYPE, avatar.getContentType());
contentValues.put(AVATAR_KEY, avatar.getKey());
contentValues.put(AVATAR_DIGEST, avatar.getDigest().orNull());
}
databaseHelper.getWritableDatabase().update(TABLE_NAME, contentValues, GROUP_ID + " = ?", new String[] { GroupUtil.getEncodedId(groupId) });
RecipientFactory.clearCache(context);
notifyDatabaseListeners();
notifyConversationListListeners();
}
Aggregations