| 112 | |
| 113 | === Track which messages have been processed === |
| 114 | |
| 115 | We don't want to add fields to {{{msg_message}}} just for our module. But we need a way to tell when |
| 116 | a message has been processed, so we can select unprocessed messages to give to users. Later, when we |
| 117 | add more human intelligence task features such as sending the same task to multiple workers, we'll need |
| 118 | somewhere to record how complete the work is for one message. |
| 119 | |
| 120 | So we may want to add a table that gets a record added when each message intended for processing arrives. |
| 121 | The table should be defined in the same model file as the task table. It should refer to the {{{msg_message}}} |
| 122 | record in the same way as above, and should have a boolean field for whether the message is processed. |
| 123 | (Later, this can be changed to support processing by multiple workers, but for now, we can consider it |
| 124 | done when one worker has processed it.) |
| 125 | |
| 126 | We don't want to enter all messages, just ones for our workers (e.g. incoming email for individuals |
| 127 | should not be sent to workers). We'll need a way to recognize our messages, e.g. a Twitter direct message |
| 128 | recipient or hashtag, or a particular SMS shortcode. There is a new and somewhat experimental feature |
| 129 | for selecting out messages, which may be useful for this, but documentation is lacking. This will |
| 130 | require consultation on IRC. IF we cannot use this, we can (temporarily) add specialized code in the |
| 131 | {{{msg}}} module's incoming message handling to pick out the desired messages and create records for them. |
| 132 | |