summary refs log tree commit diff stats
path: root/src/common/userlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/userlist.c')
-rw-r--r--src/common/userlist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/userlist.c b/src/common/userlist.c
index 18ac4bed..a18485b1 100644
--- a/src/common/userlist.c
+++ b/src/common/userlist.c
@@ -326,12 +326,19 @@ int
 userlist_remove (struct session *sess, char *name)
 {
 	struct User *user;
-	int pos;
 
 	user = userlist_find (sess, name);
 	if (!user)
 		return FALSE;
 
+	userlist_remove_user (sess, user);
+	return TRUE;
+}
+
+void
+userlist_remove_user (struct session *sess, struct User *user)
+{
+	int pos;
 	if (user->voice)
 		sess->voices--;
 	if (user->op)
@@ -348,8 +355,6 @@ userlist_remove (struct session *sess, char *name)
 	tree_remove (sess->usertree, user, &pos);
 	tree_remove (sess->usertree_alpha, user, &pos);
 	free_user (user, NULL);
-
-	return TRUE;
 }
 
 void