From 0b99a3303d0cb24d9b57a51ac0401f03be8c45ac Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Wed, 9 Oct 2013 18:57:08 -0300 Subject: [PATCH] Add getter for friend name --- friend.c | 5 +++++ friend.h | 2 ++ 2 files changed, 7 insertions(+) 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 -- 2.20.1