added cmd_ban and all functions depending on
[NeonServV5.git] / UserNode.c
index e857cb7f46785bf4597f6d97e876751f7986e1b7..a20fb1e49b9ee1dd4627f24f4079e0f091663d72 100644 (file)
@@ -1,5 +1,6 @@
 #include "UserNode.h"
 #include "ChanUser.h"
+#include "tools.h"
 
 static struct UserNode **userList;
 
@@ -114,6 +115,19 @@ int countUsersWithHost(char *host) {
     return count;
 }
 
+char *getAuthFakehost(char *auth) {
+    int i;
+    struct UserNode *user;
+    for(i = 0; i < VALID_NICK_CHARS_FIRST_LEN+1; i++) {
+        for(user = userList[i]; user; user = user->next) {
+            if((user->flags & USERFLAG_ISAUTHED) && !strcmp(user->auth, auth) && isFakeHost(user->host)) {
+                return user->host;
+            }
+        }
+    }
+    return NULL;
+}
+
 struct UserNode* addUser(const char *nick) {
     int userListIndex = get_nicklist_entry(*nick);
     if(userListIndex == -1 || !is_valid_nick(nick))