Skip to content

Commit

Permalink
ews: rename EWSPlugin::SubManager::subscriptions member
Browse files Browse the repository at this point in the history
Make the expression ``x->subscriptions`` for any given x unambiguous;
make a distinction between EWSPlugin::subscriptions and
EWSPlugin::SubManager::subscriptions;
  • Loading branch information
jengelh committed Oct 23, 2024
1 parent ac724ea commit ba078e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions exch/ews/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2141,10 +2141,10 @@ tSubscriptionId EWSContext::subscribe(const std::vector<sFolderId>& folderIds, u
detail::ExmdbSubscriptionKey key =
m_plugin.subscribe(m_auth_info.maildir, eventMask, true, rop_util_make_eid_ex(1, PRIVATE_FID_IPMSUBTREE),
subscriptionId.ID);
mgr->subscriptions.emplace_back(key);
mgr->inner_subs.emplace_back(key);
return subscriptionId;
}
mgr->subscriptions.reserve(folderIds.size());
mgr->inner_subs.reserve(folderIds.size());
std::string target;
std::string maildir;
for(const sFolderId& f : folderIds) {
Expand All @@ -2159,8 +2159,8 @@ tSubscriptionId EWSContext::subscribe(const std::vector<sFolderId>& folderIds, u
throw EWSError::InvalidSubscriptionRequest(E3200);
if(!(permissions(maildir, folderspec.folderId) & frightsReadAny))
continue; // TODO: proper error handling
mgr->subscriptions.emplace_back(m_plugin.subscribe(maildir, eventMask, all, folderspec.folderId,
subscriptionId.ID));
mgr->inner_subs.emplace_back(m_plugin.subscribe(maildir,
eventMask, all, folderspec.folderId, subscriptionId.ID));
}
return subscriptionId;
}
Expand Down
2 changes: 1 addition & 1 deletion exch/ews/ews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ EWSPlugin::SubManager::SubManager(const char *uname, const EWSPlugin &plugin) :
EWSPlugin::SubManager::~SubManager()
{
std::lock_guard ss_lock(ews.subscriptionLock);
for(const auto& subKey : subscriptions)
for (const auto &subKey : inner_subs)
ews.unsubscribe(subKey);
if(waitingContext)
ews.unlinkSubscription(*waitingContext);
Expand Down
2 changes: 1 addition & 1 deletion exch/ews/ews.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class EWSPlugin {
std::string username; ///< Name of the user who created the subscription
Structures::sMailboxInfo mailboxInfo; ///< Target mailbox metadata
std::mutex lock; ///< I/O mutex
std::vector<detail::ExmdbSubscriptionKey> subscriptions; ///< Exmdb subscription keys
std::vector<detail::ExmdbSubscriptionKey> inner_subs; ///< Exmdb subscription keys
std::list<Structures::sNotificationEvent> events; ///< Events that occured since last check
std::optional<int> waitingContext; ///< ID of context waiting for events
};
Expand Down

0 comments on commit ba078e4

Please sign in to comment.