From 0f17557c46d72926ecc667ed76624a03f9656156 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 17 Feb 2010 08:53:46 -0800 Subject: [PATCH] Fix bug with meeting responses * We were sending the wrong collectionId to the server, resulting in a failure (status == 2) Change-Id: I02ef4039a4ecfbc54ab5cdac2c36e39aea5d7170 --- src/com/android/exchange/EasSyncService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index b048a8ab9..3feeba8c4 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -38,11 +38,11 @@ import com.android.exchange.adapter.ContactsSyncAdapter; import com.android.exchange.adapter.EmailSyncAdapter; import com.android.exchange.adapter.FolderSyncParser; import com.android.exchange.adapter.MeetingResponseParser; -import com.android.exchange.adapter.Parser.EasParserException; import com.android.exchange.adapter.PingParser; import com.android.exchange.adapter.ProvisionParser; import com.android.exchange.adapter.Serializer; import com.android.exchange.adapter.Tags; +import com.android.exchange.adapter.Parser.EasParserException; import org.apache.http.Header; import org.apache.http.HttpEntity; @@ -765,11 +765,15 @@ public class EasSyncService extends AbstractSyncService { * @throws IOException */ protected void sendMeetingResponse(MeetingResponseRequest req) throws IOException { + // Retrieve the message and mailbox; punt if either are null Message msg = Message.restoreMessageWithId(mContext, req.mMessageId); + if (msg == null) return; + Mailbox mailbox = Mailbox.restoreMailboxWithId(mContext, msg.mMailboxKey); + if (mailbox == null) return; Serializer s = new Serializer(); s.start(Tags.MREQ_MEETING_RESPONSE).start(Tags.MREQ_REQUEST); s.data(Tags.MREQ_USER_RESPONSE, Integer.toString(req.mResponse)); - s.data(Tags.MREQ_COLLECTION_ID, Long.toString(msg.mMailboxKey)); + s.data(Tags.MREQ_COLLECTION_ID, mailbox.mServerId); s.data(Tags.MREQ_REQ_ID, msg.mServerId); s.end().end().done(); HttpResponse res = sendHttpClientPost("MeetingResponse", s.toByteArray());