--- a/libpurple/protocols/msn/user.h Thu Feb 04 20:57:01 2010 +0000 +++ b/libpurple/protocols/msn/user.h Sat Feb 06 05:15:35 2010 +0000 @@ -53,13 +53,25 @@ CURRENT_MEDIA_OFFICE } CurrentMediaType; -typedef struct _CurrentMedia +/** + * Contains optional info about a user that is fairly uncommon. We + * put this info in in a separate struct to save memory because we + * allocate an MsnUser struct for each buddy, but we generally only + * need this information for a small percentage of our buddies + * (usually less than 1%). Putting it in a separate struct saves + * makes MsnUser smaller by the size of a few pointers. + */ +typedef struct _MsnUserExtendedInfo { - CurrentMediaType type; /**< Type. */ - char *title; /**< Title. */ - char *artist; /**< Artist. */ - char *album; /**< Album. */ -} CurrentMedia; + CurrentMediaType media_type; /**< Type of the user's current media. */ + char *media_title; /**< Title of the user's current media. */ + char *media_artist; /**< Artist of the user's current media. */ + char *media_album; /**< Album of the user's current media. */ + + char *phone_home; /**< E.T. uses this. */ + char *phone_work; /**< Work phone number. */ + char *phone_mobile; /**< Mobile phone number. */ +} MsnUserExtendedInfo; /** * A user. @@ -71,22 +83,15 @@ char *passport; /**< The passport account. */ char *friendly_name; /**< The friendly name. */ - char * uid; /*< User Id */ - GHashTable *endpoints; /*< Endpoint-specific data */ + char *uid; /*< User ID */ + GHashTable *endpoints; /*< Endpoint-specific data */ const char *status; /**< The state of the user. */ char *statusline; /**< The state of the user. */ - CurrentMedia media; /**< Current media of the user. */ gboolean idle; /**< The idle state of the user. */ - struct - { - char *home; /**< Home phone number. */ - char *work; /**< Work phone number. */ - char *mobile; /**< Mobile phone number. */ - - } phone; + MsnUserExtendedInfo *extinfo; /**< Extended info for the user. */ gboolean authorized; /**< Authorized to add this user. */ gboolean mobile; /**< Signed up with MSN Mobile. */ @@ -105,8 +110,11 @@ int list_op; /**< Which lists the user is in */ - guint membership_id[5]; /**< The membershipId sent by the contacts server, - indexed by the list it belongs to */ + /** + * The membershipId for this buddy on our pending list. Sent by + * the contact's server + */ + guint member_id_on_pending_list; char *invite_message; /**< Invite message of user request */ }; @@ -165,14 +173,6 @@ */ void msn_user_set_statusline(MsnUser *user, const char *statusline); - /** - * Sets the current media of user. - * - * @param user The user. - * @param cmedia Current media. - */ -void msn_user_set_currentmedia(MsnUser *user, const CurrentMedia *cmedia); - /** * Sets the new state of user. *