comparison libpurple/protocols/msn/user.h @ 29350:99d1b433dba0

Keep CurrentMedia in a separate object outside of MsnUser that needs to be allocated if a user has media. This makes MsnUser smaller by the size of 3 pointers (apparently) for each buddy in your buddy list. In practice it looks like less than 1% of MSN users have media set, so this should save a little bit of memory.
author Mark Doliner <mark@kingant.net>
date Thu, 04 Feb 2010 00:15:41 +0000
parents 452043d200f0
children 08296b862f98
comparison
equal deleted inserted replaced
29349:3de19f8f5c92 29350:99d1b433dba0
73 73
74 char * uid; /*< User Id */ 74 char * uid; /*< User Id */
75 75
76 const char *status; /**< The state of the user. */ 76 const char *status; /**< The state of the user. */
77 char *statusline; /**< The state of the user. */ 77 char *statusline; /**< The state of the user. */
78 CurrentMedia media; /**< Current media of the user. */ 78 CurrentMedia *media; /**< Current media of the user. */
79 79
80 gboolean idle; /**< The idle state of the user. */ 80 gboolean idle; /**< The idle state of the user. */
81 81
82 struct 82 struct
83 { 83 {
156 156
157 /** 157 /**
158 * Sets the current media of user. 158 * Sets the current media of user.
159 * 159 *
160 * @param user The user. 160 * @param user The user.
161 * @param cmedia Current media. 161 * @param cmedia Current media. This function takes ownership of this
162 * object and its contents.
162 */ 163 */
163 void msn_user_set_currentmedia(MsnUser *user, const CurrentMedia *cmedia); 164 void msn_user_set_currentmedia(MsnUser *user, CurrentMedia *cmedia);
164 165
165 /** 166 /**
166 * Sets the new state of user. 167 * Sets the new state of user.
167 * 168 *
168 * @param user The user. 169 * @param user The user.