express: Add function(s) to find a user in a channel

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-02-20 12:20:45 -05:00
parent 3bd87f8739
commit 86e612da39
4 changed files with 26 additions and 0 deletions

View File

@ -1058,3 +1058,14 @@ _channel_tabspacer_destroy(Channel *chl)
edje_object_message_signal_process(chl->o_bg);
}
}
Eina_Bool
_channel_user_find(Channel *chl, const char *user)
{
if ((!chl) || (!user)) return EINA_FALSE;
if (eina_list_data_find(chl->userlist.users, user) == user)
return EINA_TRUE;
return EINA_FALSE;
}

View File

@ -62,4 +62,6 @@ void _channel_tabbar_update(Channel *chl);
void _channel_tabspacer_create(Channel *chl, double v1, double v2);
void _channel_tabspacer_destroy(Channel *chl);
Eina_Bool _channel_user_find(Channel *chl, const char *user);
#endif

View File

@ -486,6 +486,18 @@ _window_channel_server_find(const char *server)
return NULL;
}
Channel *
_window_channel_user_find(const char *user)
{
Eina_List *l;
Channel *chl;
EINA_LIST_FOREACH(_win->channels, l, chl)
if (_channel_user_find(chl, user)) return chl;
return NULL;
}
void
_window_update(void)
{

View File

@ -10,6 +10,7 @@ Channel *_window_channel_create(const char *name, const char *server);
void _window_channel_destroy(const char *name);
Channel *_window_channel_find(const char *name);
Channel *_window_channel_server_find(const char *server);
Channel *_window_channel_user_find(const char *user);
void _window_channel_swallow(Channel *chl);
void _window_channel_unswallow(Channel *chl);