-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Signal supports search based on contacts. We can expand this search based on message body, given that the messages are stored in EDB. This way we can build upon the existing search UI.
- The UI starts in
ConversationListActivity
. - The activity initializes search within
initializeSearch
, which sets a callback for query submission onConversationListFragment
. This callback passes the search query string as a filter toConversationListFragment.queryFilter
. - The
ConversationListFragment
is re-created / re-loaded once thequeryFilter
is set to display the filtered conversations. The reload is throughConversationListLoader
(inConversationListFragment.onCreateLoader
), which uses thequeryFilter
as thefilter
. - The
ConversationListLoader
creates a cursor on the database to perform search based on the filter. Currently it supports only search based on contacts. - The
ConversationListLoader
returns a cursor of a list of conversations, filtered by phone numbers indicated by the filter. First, it retrieves the phone numbers that contains the searched words in the filter from the Android contacts (ContactAccessor#getNumbersForThreadSearchFilter
). Then it uses these phone numbers to retrieve threads fromthread
table.
When clicking a conversation from the conversation list:
- This is during setup time:
ConversationListAdapter.onCreateItemViewHolder
sets a on-click callback forConversationListItem
. -
ConversationListFragment.onItemClick
gets called. ConversationListActivity.onCreateConversation
ConversationActivity
Expand the search based on message body.
- (done) filter conversation list by searched keyword
- (done) filter conversation list by searched keyword
- (done) filter messages within a conversation by searched keyword
The main issue with EDB setup is that it needs to build a multi-map for messages. After installing Signal, the sms
table is empty. The only way to add tuples to the table is through receiving new text messages or importing from an existing SMS app.
This is easiest to test on an Android Emulator. We assume there are existing SMS in Signal (either from importing form another SMS app or from receiving SMS to Signal). We provide a button in the Export
tab to set up an EDB on the existing Signal SMS. To handle new incoming SMS after the EDB setup, please refer to EDB update.
- (done) Add a button to
ExportFragment
view about "Set up EDB". - (done) Add handler for EDBSetup.
- (done) Create cursor to read each messages from the EDB and create a multi-map of each word in a given message body to the message id.
- (done) Create LEX2lev. Find a place to store this instance.
Signal supports importing from a pre-existing SMS app. We can simply redirect the data into a LEX2lev EDB.
We need to use RH2lev
as the construction in Edb
.