Smome user manager functions did not have the uman_ prefix.

This commit is contained in:
Jan Vidar Krey 2009-05-16 12:42:30 +02:00
parent 326fcc467c
commit 5ea5efb875
7 changed files with 19 additions and 19 deletions

View File

@ -142,7 +142,7 @@ static int command_kick(struct hub_info* hub, struct user* user, const char* mes
} }
const char* nick = &message[7]; const char* nick = &message[7];
struct user* target = get_user_by_nick(hub, nick); struct user* target = uman_get_user_by_nick(hub, nick);
if (!target) if (!target)
{ {

View File

@ -362,7 +362,7 @@ static void hub_event_dispatcher(void* callback_data, struct event_data* message
case UHUB_EVENT_USER_QUIT: case UHUB_EVENT_USER_QUIT:
{ {
uman_remove(hub, (struct user*) message->ptr); uman_remove(hub, (struct user*) message->ptr);
send_quit_message((struct user*) message->ptr); uman_send_quit_message((struct user*) message->ptr);
on_logout_user(hub, (struct user*) message->ptr); on_logout_user(hub, (struct user*) message->ptr);
user_schedule_destroy((struct user*) message->ptr); user_schedule_destroy((struct user*) message->ptr);
break; break;
@ -611,7 +611,7 @@ void hub_free_variables(struct hub_info* hub)
*/ */
static inline int is_nick_in_use(struct hub_info* hub, const char* nick) static inline int is_nick_in_use(struct hub_info* hub, const char* nick)
{ {
struct user* lookup = get_user_by_nick(hub, nick); struct user* lookup = uman_get_user_by_nick(hub, nick);
if (lookup) if (lookup)
{ {
return 1; return 1;
@ -625,7 +625,7 @@ static inline int is_nick_in_use(struct hub_info* hub, const char* nick)
*/ */
static inline int is_cid_in_use(struct hub_info* hub, const char* cid) static inline int is_cid_in_use(struct hub_info* hub, const char* cid)
{ {
struct user* lookup = get_user_by_cid(hub, cid); struct user* lookup = uman_get_user_by_cid(hub, cid);
if (lookup) if (lookup)
{ {
return 1; return 1;

View File

@ -52,7 +52,7 @@ void on_login_success(struct hub_info* hub, struct user* u)
struct timeval timeout = { TIMEOUT_IDLE, 0 }; struct timeval timeout = { TIMEOUT_IDLE, 0 };
/* Send user list of all existing users */ /* Send user list of all existing users */
if (!send_user_list(u)) if (!uman_send_user_list(u))
return; return;
/* Mark as being in the normal state, and add user to the user list */ /* Mark as being in the normal state, and add user to the user list */

View File

@ -326,8 +326,8 @@ static int check_nick(struct hub_info* hub, struct user* user, struct adc_messag
static int check_logged_in(struct hub_info* hub, struct user* user, struct adc_message* cmd) static int check_logged_in(struct hub_info* hub, struct user* user, struct adc_message* cmd)
{ {
struct user* lookup1 = get_user_by_nick(hub, user->id.nick); struct user* lookup1 = uman_get_user_by_nick(hub, user->id.nick);
struct user* lookup2 = get_user_by_cid(hub, user->id.cid); struct user* lookup2 = uman_get_user_by_cid(hub, user->id.cid);
if (lookup1 == user) if (lookup1 == user)
{ {

View File

@ -31,7 +31,7 @@ int route_message(struct user* u, struct adc_message* msg)
break; break;
case 'D': case 'D':
target = get_user_by_sid(u->hub, msg->target); target = uman_get_user_by_sid(u->hub, msg->target);
if (target) if (target)
{ {
route_to_user(target, msg); route_to_user(target, msg);
@ -39,7 +39,7 @@ int route_message(struct user* u, struct adc_message* msg)
break; break;
case 'E': case 'E':
target = get_user_by_sid(u->hub, msg->target); target = uman_get_user_by_sid(u->hub, msg->target);
if (target) if (target)
{ {
route_to_user(target, msg); route_to_user(target, msg);

View File

@ -171,7 +171,7 @@ int uman_remove(struct hub_info* hub, struct user* user)
} }
struct user* get_user_by_sid(struct hub_info* hub, sid_t sid) struct user* uman_get_user_by_sid(struct hub_info* hub, sid_t sid)
{ {
struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users */ struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users */
while (user) while (user)
@ -184,7 +184,7 @@ struct user* get_user_by_sid(struct hub_info* hub, sid_t sid)
} }
struct user* get_user_by_cid(struct hub_info* hub, const char* cid) struct user* uman_get_user_by_cid(struct hub_info* hub, const char* cid)
{ {
struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */ struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */
while (user) while (user)
@ -197,7 +197,7 @@ struct user* get_user_by_cid(struct hub_info* hub, const char* cid)
} }
struct user* get_user_by_nick(struct hub_info* hub, const char* nick) struct user* uman_get_user_by_nick(struct hub_info* hub, const char* nick)
{ {
struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */ struct user* user = (struct user*) list_get_first(hub->users->list); /* iterate users - only on incoming INF msg */
while (user) while (user)
@ -210,7 +210,7 @@ struct user* get_user_by_nick(struct hub_info* hub, const char* nick)
} }
int send_user_list(struct user* target) int uman_send_user_list(struct user* target)
{ {
int ret = 1; int ret = 1;
user_flag_set(target, flag_user_list); user_flag_set(target, flag_user_list);
@ -234,7 +234,7 @@ int send_user_list(struct user* target)
} }
void send_quit_message(struct user* leaving) void uman_send_quit_message(struct user* leaving)
{ {
struct adc_message* command = adc_msg_construct(ADC_CMD_IQUI, 6); struct adc_message* command = adc_msg_construct(ADC_CMD_IQUI, 6);
adc_msg_add_argument(command, (const char*) sid_to_string(leaving->id.sid)); adc_msg_add_argument(command, (const char*) sid_to_string(leaving->id.sid));

View File

@ -85,19 +85,19 @@ extern sid_t uman_get_free_sid(struct hub_info* hub);
* *
* @return a user if found, or NULL if not found * @return a user if found, or NULL if not found
*/ */
extern struct user* get_user_by_sid(struct hub_info* hub, sid_t sid); extern struct user* uman_get_user_by_sid(struct hub_info* hub, sid_t sid);
/** /**
* Lookup a user based on the client ID (CID). * Lookup a user based on the client ID (CID).
* @return a user if found, or NULL if not found * @return a user if found, or NULL if not found
*/ */
extern struct user* get_user_by_cid(struct hub_info* hub, const char* cid); extern struct user* uman_get_user_by_cid(struct hub_info* hub, const char* cid);
/** /**
* Lookup a user based on the nick name. * Lookup a user based on the nick name.
* @return a user if found, or NULL if not found * @return a user if found, or NULL if not found
*/ */
extern struct user* get_user_by_nick(struct hub_info* hub, const char* nick); extern struct user* uman_get_user_by_nick(struct hub_info* hub, const char* nick);
/** /**
* Send the user list of connected clients to 'user'. * Send the user list of connected clients to 'user'.
@ -105,13 +105,13 @@ extern struct user* get_user_by_nick(struct hub_info* hub, const char* nick);
* *
* @return 1 if sending the user list succeeded, 0 otherwise. * @return 1 if sending the user list succeeded, 0 otherwise.
*/ */
extern int send_user_list(struct user* user); extern int uman_send_user_list(struct user* user);
/** /**
* Send a quit message to all connected users when 'user' is * Send a quit message to all connected users when 'user' is
* leaving the hub (for whatever reason). * leaving the hub (for whatever reason).
*/ */
extern void send_quit_message(struct user* user); extern void uman_send_quit_message(struct user* user);
#endif /* HAVE_UHUB_USER_MANAGER_H */ #endif /* HAVE_UHUB_USER_MANAGER_H */