Also check CID when converting plugin_user to hub_user.
Current lookup would return the wrong user if the intended user has left the hub and the SID has been re-used. If the CID matches then we assume the user is still there.
This commit is contained in:
parent
1520026168
commit
24f483f2c6
@ -58,7 +58,12 @@ static struct hub_user* convert_user_type(struct plugin_handle* plugin, struct p
|
|||||||
* the data in case the user quits before the plugin uses the list. Hence
|
* the data in case the user quits before the plugin uses the list. Hence
|
||||||
* we need to look it up by SID. */
|
* we need to look it up by SID. */
|
||||||
struct hub_info* hub = plugin_get_hub(plugin);
|
struct hub_info* hub = plugin_get_hub(plugin);
|
||||||
return uman_get_user_by_sid(hub, user->sid);
|
struct hub_user* huser = uman_get_user_by_sid(hub, user->sid);
|
||||||
|
|
||||||
|
/* Also need to check the CID matches to handle
|
||||||
|
* the case where the SID is re-used. */
|
||||||
|
if(huser->id.cid == user->cid) return huser;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cbfunc_send_message(struct plugin_handle* plugin, struct plugin_user* user, const char* message)
|
static int cbfunc_send_message(struct plugin_handle* plugin, struct plugin_user* user, const char* message)
|
||||||
|
Loading…
Reference in New Issue
Block a user