@@ -216,10 +216,24 @@ exceptionWithStatusCode: statusCode response: response client: self]); return; } + + OFString *nextBatch = response[@"next_batch"]; + if (![nextBatch isKindOfClass: OFString.class]) { + block([OFInvalidServerReplyException exception]); + return; + } + + @try { + [_storage setNextBatch: nextBatch + forDeviceID: _deviceID]; + } @catch (id e) { + block(e); + return; + } block(nil); }]; objc_autoreleasePoolPop(pool);