Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Similar methods should be merged #37

Open
marcoscaceres opened this issue Apr 25, 2013 · 4 comments
Open

Similar methods should be merged #37

marcoscaceres opened this issue Apr 25, 2013 · 4 comments

Comments

@marcoscaceres
Copy link
Contributor

The spec defines the following methods that all practically do the same thing - the only different is in the method name:

    MessagingRequest findMessages (MessagingFilter filter, FilterOptions options);
    MessagingRequest findConversations (DOMString groupBy, MessagingFilter filter, FilterOptions options);
    MessagingRequest deleteMessage (DOMString messageID);
    MessagingRequest deleteConversation (DOMString conversationID);
    MessagingRequest markMessageRead (DOMString messageID, boolean value);
    MessagingRequest markConversationRead (DOMString conversationID, boolean value);

findMessages could just become "find" if we added an "enum CommunicationType { "message", "conversation" } ".

So:

messaging.find("message", ...);
messaging.find("conversation", ...);

The groupBy can just be added to FilterOption because fileterOptions is required (and just give groupBy a sensible default like "subject"). Also, it looks like groupBy needs it's own enum!

For messaging.delete(), the API should just guarantee that message and conversation and conversations have unique ids. If it can't do that for whatever reason, then again just use the enum:

messaging.delete( "message", id); 
messaging.delete( "conversation", id); 

The same with markAsRead():

messaging.markAsRead( "message", id); 
messaging.markAsRead( "conversation", id); 

And, like I said, if we make the id's unique for conversations and messages, then it makes the API even simpler.

@efullea
Copy link
Member

efullea commented Apr 25, 2013

Use of the conversations under discussion. Issue on hold until that is cleared up.

@marcoscaceres
Copy link
Contributor Author

@efullea seems I missed the email or bug about that. Do you have a pointer?

@efullea
Copy link
Member

efullea commented Apr 25, 2013

It was discussed in Madrid. Depends on the synchronization API proposal expected from Jonas.

@marcoscaceres
Copy link
Contributor Author

I guess I'll need to check the minutes. Regarding synchronization API, relates to: https://github.com/sysapps/sysapps/issues/59

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

No branches or pull requests

2 participants