From: Thadeu Lima de Souza Cascardo Date: Wed, 9 Oct 2013 21:57:08 +0000 (-0300) Subject: Add getter for friend name X-Git-Url: http://git.cascardo.info/?p=cascardo%2Ff2fchat.git;a=commitdiff_plain;h=0b99a3303d0cb24d9b57a51ac0401f03be8c45ac Add getter for friend name --- diff --git a/friend.c b/friend.c index 7386f83..e3d987f 100644 --- a/friend.c +++ b/friend.c @@ -96,6 +96,11 @@ int destroy_cache(struct cache *cache) g_slice_free(struct cache, cache); } +char * friend_get_name(struct friend *friend) +{ + return friend->name; +} + int cache_add_friend(struct cache *cache, char *name, char *address, uint16_t port) { struct friend *friend; diff --git a/friend.h b/friend.h index c92814d..46f8ffe 100644 --- a/friend.h +++ b/friend.h @@ -36,4 +36,6 @@ int store_cache(struct cache *cache, char *fname); int friend_send_message(struct friend *friend, char *buffer, size_t len); struct friend *friend_get_by_address(GInetAddress *address); +char *friend_get_name(); + #endif