Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a public interface (backend) to set nicknames #38

Closed
Radu-Raicea opened this issue Feb 15, 2018 · 3 comments
Closed

Provide a public interface (backend) to set nicknames #38

Radu-Raicea opened this issue Feb 15, 2018 · 3 comments
Assignees
Milestone

Comments

@Radu-Raicea
Copy link
Owner

User Story #34

Estimated Time: 4h

@veken1199
Copy link
Collaborator

I believe the best approach for this is:
1- introduce new database update to include "nickname" attribute in "identities table"
2- create new handler to set the nicknames, this will help us to easily write unit tests

@veken1199
Copy link
Collaborator

@Dan-Yoo @shelbaz interesting fact, Signal stores all your contacts in table called "recipient_preferences". It gets accessed through RecipientDatabase class, there is method that returns all the info related to a recipient to "getIndividualRecipientDetails" in RecipientProvider class in a form of RecipientDetails object

veken1199 pushed a commit that referenced this issue Feb 23, 2018
1- Added RecipientDatabase 'setNickname' public interface
2- Added processNicknameSqlRequest to handle the database calls, this also can be used by removeNickname method in the future
3- Changed the default type of nickname attri in DatabaseFactory from NULL to 'null' - String
veken1199 pushed a commit that referenced this issue Feb 23, 2018
1- Create class NicknameHandler responsible for setting and unsetting the nickname
2- Sample use:

    NicknameHandler handler = new NicknameHandler(getContext());
    handler.setupDatabaseHandler().setNickname(recipient,"test");
    handler.removeNickname(recipient);
veken1199 pushed a commit that referenced this issue Feb 23, 2018
veken1199 pushed a commit that referenced this issue Feb 25, 2018
1- also fixed a typo regarding old tests in pin messages
2- moved up the initialization of the mocked object to the parent 'NicknameMocks'
veken1199 pushed a commit that referenced this issue Feb 25, 2018
veken1199 pushed a commit that referenced this issue Feb 25, 2018
veken1199 pushed a commit that referenced this issue Feb 27, 2018
1- Removed TODO parts related for removeNickname functionality
2- Fixed a functional inconsistency in PinnedMessagesMocks
3- General code formatting
veken1199 pushed a commit that referenced this issue Feb 27, 2018
g-harel added a commit that referenced this issue Feb 27, 2018
veken1199 pushed a commit that referenced this issue Feb 28, 2018
1- Added NicknameHandler
2- Setting and Changing nicknames interfaces 
3- Nickname db attributes
4- Setting and changing unittests
@veken1199
Copy link
Collaborator

Actual time : 5h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants