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

Unread flag on Messages ContentProvider #37

Merged
merged 4 commits into from
Jun 2, 2011

Conversation

joaopedrotaveira
Copy link
Contributor

Since k-9 recommends not to hold cursors to content providers, it's difficult to track changes on mail accounts.

Using the new mail broadcast, one is notified for that event but one can't known which mail is new or was really read. With this flag, one can get cursor, pull the records and close it and then known which one is new or not.

@obra
Copy link
Contributor

obra commented Jun 2, 2011

Thanks! - Having not messed around with ContentProviders much -- What effect would this have on existing apps that use the provider?

@Fiouz
Copy link
Contributor

Fiouz commented Jun 2, 2011

Since the default projection is modified, existing apps relying on it could now get the wrong value for some columns, especially since the new column was not added at the last position.
It would be wiser not to alter the default projection and have interested client to include the new column as part of their request.

@joaopedrotaveira
Copy link
Contributor Author

The applications that make a getContentResolver().query(...) without projection specification will get the k-9 DEFAULT_MESSAGE_PROJECTION that changed (MessageProvider.java).

This position on the record was URI before, and now unread flag. If one access fields by name or with projection, it would be no effect.

The new flag could move to end of default projection.

@joaopedrotaveira
Copy link
Contributor Author

what would you prefer?

  • Change default projection: move column to last position
  • Remove from default projection

Regards

@Fiouz Fiouz merged commit feea44c into thunderbird:master Jun 2, 2011
@Fiouz
Copy link
Contributor

Fiouz commented Jun 2, 2011

I left the default projection unmodified so that existing clients should not see any difference.

It should be noted that Android seems to specify otherwise: null should mean "all columns" according to the API documentation but that would increase K-9 workload for each new column when clients rely on that null value even if they don't expect those new columns.

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

Successfully merging this pull request may close these issues.

3 participants