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

Updated contact model #4

Merged
merged 6 commits into from Mar 5, 2020
Merged

Updated contact model #4

merged 6 commits into from Mar 5, 2020

Conversation

@TortoiseWrath
Copy link
Member

TortoiseWrath commented Mar 5, 2020

as discussed on Tuesday

This commit:
* Renames ContactModel to MultaccContact
* Adds serverKey and clientKey strings to MultaccContact
    - The serverKey should correspond to a key on the server-side
      graph database.
    - The clientKey should correspond to a key on the client-side
      SQL database.
* Creates the MultaccItem class within contact_model.dart
* Adds a List<MultaccItem> to MultaccContact
This commit creates a new package, contact_types. It contains:
* item.dart
    * MultaccItem is the base multacc item class
    * MultaccItemType is an enum of item types
* twitter.dart
    * TwitterItem is a class extending MultaccItem and demonstrating
      what the implementations of MultaccItem should look like.

In the future there should be one class for each item type.

The indices from MultaccItemType will be used to identify the item types
(Snapchat, Instagram, etc.) in the database.

This package should contain classes that extend MultaccItem for each
item type. A MultaccContact will then contain a List of instances of
these classes, which will also be persisted in databases as necessary.

MultaccItem is an abstract class; all items should be instances of
classes such as TwitterItem that extend MultaccItem.
@TortoiseWrath TortoiseWrath requested a review from mayank99 Mar 5, 2020
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Frontend team should add something like getIcon to MultaccItem

// @todo Frontend team should add something like getIcon to MultaccItem
}
enum MultaccItemType {
Twitter,
Snapchat, // @todo Implement snapchat


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Implement snapchat

Snapchat, // @todo Implement snapchat
Instagram, // @todo Implement instagram
Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Implement instagram

Instagram, // @todo Implement instagram
Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Implement facebook

Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Implement discord

Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Implement dogecoin

Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Implement Twitter launching

// @todo Implement Twitter launching
}
@override
bool isLaunchable() {
return true;


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

move this to ContactCard

this.isSelected = false; // @todo move this to ContactCard
// Base contact model - stored in contacts app:
this.androidAccountName = baseContact.androidAccountName;
this.androidAccountType = baseContact.androidAccountType;
this.androidAccountTypeRaw = baseContact.androidAccountTypeRaw;


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Figure out how to store Multacc key in Contact

// @todo Figure out how to store Multacc key in Contact
// @todo Get IM, notes, etc. from base contact
// Multacc additional contact data
this.clientKey = null; // Key in client-side database
this.serverKey = null; // Key in server-side database


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Get IM, notes, etc. from base contact

// @todo Get IM, notes, etc. from base contact
// Multacc additional contact data
this.clientKey = null; // Key in client-side database
this.serverKey = null; // Key in server-side database
// @todo Pull multacc items from database when loading a contact


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 5, 2020

Pull multacc items from database when loading a contact

// @todo Pull multacc items from database when loading a contact
this.multaccItems = []; // Multacc extension items
}
}


This comment was generated by todo based on a todo comment in 15474cf in #4. cc @multacc.
@TortoiseWrath

This comment has been minimized.

Copy link
Member Author

TortoiseWrath commented Mar 5, 2020

i love todobot

@mayank99

This comment has been minimized.

Copy link
Contributor

mayank99 commented Mar 5, 2020

This is good 💯👌

this.serverKey = null; // Key in server-side database
// @todo Pull multacc items from database when loading a contact
this.multaccItems = []; // Multacc extension items
Comment on lines +36 to +38

This comment has been minimized.

Copy link
@TortoiseWrath

TortoiseWrath Mar 5, 2020

Author Member

Will be populated from local database

enum MultaccItemType {
Twitter,
Snapchat, // @todo Implement snapchat
Instagram, // @todo Implement instagram
Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}
Comment on lines +28 to +35

This comment has been minimized.

Copy link
@TortoiseWrath

TortoiseWrath Mar 5, 2020

Author Member

Types can never be removed if we use an enum, since the key is what gets stored in the database. This might be bad.

lib/contact_types/item.dart Show resolved Hide resolved
@mayank99 mayank99 linked an issue that may be closed by this pull request Mar 5, 2020
@mayank99 mayank99 merged commit f894fbe into master Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.