Make pending messages indexable by sender and timestamp.

Rather than just timestamp.

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2015-04-15 16:43:44 -07:00
parent 37976455bc
commit 558c72bbb7
6 changed files with 21 additions and 19 deletions

View File

@@ -160,12 +160,14 @@ public class MessageController {
@Timed
@DELETE
@Path("/{message_id}")
public void removePendingMessage(@Auth Account account, @PathParam("message_id") long id)
@Path("/{source}/{timestamp}")
public void removePendingMessage(@Auth Account account,
@PathParam("source") String source,
@PathParam("timestamp") long timestamp)
throws IOException
{
try {
Optional<OutgoingMessageEntity> message = messagesManager.delete(account.getNumber(), id);
Optional<OutgoingMessageEntity> message = messagesManager.delete(account.getNumber(), source, timestamp);
if (message.isPresent() && message.get().getType() != OutgoingMessageSignal.Type.RECEIPT_VALUE) {
receiptSender.sendReceipt(account,