Skip to content

Emojireactions#156

Merged
samantha-kerr merged 40 commits into4.15.0from
emojireactions
Apr 16, 2018
Merged

Emojireactions#156
samantha-kerr merged 40 commits into4.15.0from
emojireactions

Conversation

@claudds
Copy link
Collaborator

@claudds claudds commented Apr 14, 2018

Messages can now be appended with an emoji reaction (both incoming and outgoing).

Messages are given a hashed id upon sending/receiving which consists of the hashed timestamp down to milliseconds. When an emoji reaction for a message is sent, this timestamp is appended to the message and it is associated to the proper message upon receipt.
closes: #88

claudds and others added 30 commits April 4, 2018 13:30
…id unique to each message but accessible to both sender and recipient.

Class uses the simple, existing Base64 encoding method to create the hash. Also includes test for the Base64 mehtod.
…oming messages, and shows when only one message is selected at a time
…ced emoji drawer listener for emoji reactions #107
…emented new EmojiReactionDatabase, and updated MessageHashedId

Defined a hashId value in the MmsSmsDatabase and subclasses, as well as in MessageRecord and subclasses.

Created EmojiReactionDatabase to hold reaction items and keys to hashed column in Sms- and MmsDatabase.

Updated MessagedHashId to take MessageRecord parameter instead of Address, as accessing one's own address as a sender is not straightforward. The hash will now be done with the message body and date sent timestamp instead, which will still produce a unique id for each message.
…hen an emoji is selected in the popup and call message sender
…sation items. Attempted to set up the setting of the reactions in the db when reacting. Found where receiving incoming messages happens. Peer programmed with @claudds @samantha-kerr #88 #108
…database methods and initial hashing method. Peer programmed with @samantha-kerr @claudds #88 #108 #153
…ng message reaction to be able notify conversation listeners of changes #88 #108
…on a timestamp to associate an emoji to a sent message
… a delete for reaction messages on the sender side. #88 #108 #153
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 14, 2018
Repository owner deleted a comment Apr 15, 2018
Repository owner deleted a comment Apr 15, 2018
contentValues.put(ADDRESS, message.getRecipient().getAddress().serialize());
contentValues.put(DELIVERY_RECEIPT_COUNT, Stream.of(earlyDeliveryReceipts.values()).mapToLong(Long::longValue).sum());
contentValues.put(READ_RECEIPT_COUNT, Stream.of(earlyReadReceipts.values()).mapToLong(Long::longValue).sum());
contentValues.put(HASHED_ID, generateHashedId(message.getSentTimeMillis()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you send a multi length message (160+ characters)? Will this still work based off of the sent time?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a multi length message a message that gets auto sent as two+ bubbles?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A message split shouldn't happen, messages are just cut off at 2000 characters.


//check if the emoji drawer is closed & proper emoji is displayed
Expectations.checkIsNotDisplayed(R.id.emoji_drawer);
Expectations.checkIsDisplayed(R.id.emoji_reaction, "🏡");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we test against the unicode string instead of an actual emoji? Seems kinda weird to push this to a repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to replace this with unicode text; however, the actual emoji animation is saved in the database as the "text" part of the view, thus espresso's matchers do not find any matches for unicode text

SQLiteDatabase db = databaseHelper.getWritableDatabase();
db.beginTransaction();
try {
String hashedId = messageRecord.getHashedId();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good usage of try/catch/finally!

}

db.setTransactionSuccessful();
}catch(Exception e){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change catching exception e to catching the specific exceptions instead, to make it more clear what kind of exception these operations can throw/and to not squash other unexpected exceptions.

@samantha-kerr samantha-kerr merged commit 9987265 into 4.15.0 Apr 16, 2018
@jacobrs jacobrs deleted the emojireactions branch April 16, 2018 20:24
@samantha-kerr samantha-kerr restored the emojireactions branch April 17, 2018 22:32
@samantha-kerr samantha-kerr deleted the emojireactions branch April 18, 2018 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emoji Reactions

5 participants