(long id)
| 282 | } |
| 283 | |
| 284 | private void onJunk(long id) throws JSONException { |
| 285 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
| 286 | boolean block_sender = prefs.getBoolean("notify_block_sender", false); |
| 287 | |
| 288 | DB db = DB.getInstance(this); |
| 289 | try { |
| 290 | db.beginTransaction(); |
| 291 | |
| 292 | EntityMessage message = db.message().getMessage(id); |
| 293 | if (message == null) |
| 294 | return; |
| 295 | |
| 296 | EntityFolder junk = db.folder().getFolderByType(message.account, EntityFolder.JUNK); |
| 297 | if (junk == null) |
| 298 | return; |
| 299 | |
| 300 | EntityOperation.queue(this, message, EntityOperation.MOVE, junk.id); |
| 301 | |
| 302 | if (block_sender) |
| 303 | EntityContact.update(this, |
| 304 | message.account, message.identity, message.from, |
| 305 | EntityContact.TYPE_JUNK, message.received); |
| 306 | |
| 307 | db.setTransactionSuccessful(); |
| 308 | } finally { |
| 309 | db.endTransaction(); |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | private void onReplyDirect(long id, Intent intent) throws IOException { |
| 314 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
no test coverage detected