File tree 2 files changed +9
-8
lines changed
include/session/config/groups
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -344,14 +344,13 @@ class Members : public ConfigBase {
344
344
// / API: groups/Members::set_pending_send
345
345
// /
346
346
// / This function can be used to set the pending send state of a member.
347
+ // / If that effectively made a change, it will set _needs_dump to true.
347
348
// /
348
349
// / Inputs:
349
350
// / - `pubkey_hex` -- hex string of the session id
350
351
// / - `pending` -- pending send state to set for that member
351
352
// /
352
- // / Outputs:
353
- // / - `bool` - true if a change was made.
354
- bool set_pending_send (std::string pubkey_hex, bool pending);
353
+ void set_pending_send (std::string pubkey_hex, bool pending);
355
354
356
355
// / API: groups/Members::get_status
357
356
// /
Original file line number Diff line number Diff line change @@ -150,8 +150,7 @@ bool Members::erase(std::string_view session_id) {
150
150
bool ret = info.exists ();
151
151
info.erase ();
152
152
153
- if (set_pending_send (std::string (session_id), false ))
154
- _needs_dump = true ;
153
+ set_pending_send (std::string (session_id), false );
155
154
156
155
return ret;
157
156
}
@@ -166,11 +165,14 @@ bool Members::has_pending_send(std::string pubkey_hex) const {
166
165
return pending_send_ids.count (pubkey_hex);
167
166
}
168
167
169
- bool Members::set_pending_send (std::string pubkey_hex, bool pending) {
168
+ void Members::set_pending_send (std::string pubkey_hex, bool pending) {
169
+ bool changed = false ;
170
170
if (pending)
171
- return pending_send_ids.insert (pubkey_hex).second ;
171
+ changed = pending_send_ids.insert (pubkey_hex).second ;
172
172
else
173
- return pending_send_ids.erase (pubkey_hex);
173
+ changed = pending_send_ids.erase (pubkey_hex);
174
+ if (changed)
175
+ _needs_dump = true ;
174
176
}
175
177
176
178
member::member (std::string sid) : session_id{std::move (sid)} {
You can’t perform that action at this time.
0 commit comments