How to get the new message id after a sync/delete request

人走茶凉 提交于 2019-12-12 02:04:22

问题


When a message is deleted, my application will send a Sync request with a Delete command within the Commands element. The application also sets the DeletesAsMoves option so that the message is not deleted permanently, but instead moved to the Deleted Items folder. This all works great. However, my challenge is to now move the message back out of the Deleted Items folder. This is failing because once the message is deleted in the Sync command, its message id changes.

In the MoveItems request, the new message id comes back in the response. Is there a similar way for me to track the changed message id after a Sync/Delete command?

Below is the request:

<?xml version="1.0"?>
<Sync>
  <Collections>
    <Collection>
      <Class>Email</Class>
      <SyncKey>{F8654B17-4BF2-439F-9875-22EDDE1138FF}154</SyncKey>
      <CollectionId>03cd385d379ece4988b9c88834382ea7-68cc1f</CollectionId>
      <DeletesAsMoves/>
      <GetChanges/>
      <WindowSize>50</WindowSize>
      <Options>
        <FilterType>2</FilterType>
        <Truncation>7</Truncation>
      </Options>
      <Commands>
        <Delete>
          <ServerId>3:225</ServerId>
        </Delete>
      </Commands>
    </Collection>
  </Collections>
</Sync>

And the response:

<?xml version="1.0"?>
<Sync>
  <Collections>
    <Collection>
      <Class>Email</Class>
      <SyncKey>{F8654B17-4BF2-439F-9875-22EDDE1138FF}155</SyncKey>
      <CollectionId>03cd385d379ece4988b9c88834382ea7-68cc1f</CollectionId>
      <Status>1</Status>
    </Collection>
  </Collections>
</Sync>

The response indicates that the delete command was successful, however the message is now in another folder with an entirely new ServerId. I would like to be able to know what that new ServerId is.

来源:https://stackoverflow.com/questions/7716926/how-to-get-the-new-message-id-after-a-sync-delete-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!