Fri, 29 Mar 2019 02:04:05 -0400
Regroup conversation types definitions.
| libpurple/conversationtypes.c | file | annotate | diff | comparison | revisions |
--- a/libpurple/conversationtypes.c Fri Mar 29 00:04:08 2019 -0400 +++ b/libpurple/conversationtypes.c Fri Mar 29 02:04:05 2019 -0400 @@ -27,16 +27,43 @@ #define SEND_TYPED_TIMEOUT_SECONDS 5 -typedef struct _PurpleChatConversationPrivate PurpleChatConversationPrivate; +/**************************************************************************/ +/* PurpleIMConversation */ +/**************************************************************************/ + +/* + * Data specific to Instant Messages. + */ +typedef struct _PurpleIMConversationPrivate +{ + PurpleIMTypingState typing_state; /* The current typing state. */ + guint typing_timeout; /* The typing timer handle. */ + time_t type_again; /* The type again time. */ + guint send_typed_timeout; /* The type again timer handle. */ + PurpleBuddyIcon *icon; /* The buddy icon. */ +} PurpleIMConversationPrivate; -typedef struct _PurpleIMConversationPrivate PurpleIMConversationPrivate; +/* IM Property enums */ +enum { + IM_PROP_0, + IM_PROP_TYPING_STATE, + IM_PROP_ICON, + IM_PROP_LAST +}; -typedef struct _PurpleChatUserPrivate PurpleChatUserPrivate; +static GParamSpec *im_properties[IM_PROP_LAST]; + +G_DEFINE_TYPE_WITH_PRIVATE(PurpleIMConversation, purple_im_conversation, + PURPLE_TYPE_CONVERSATION); + +/**************************************************************************/ +/* PurpleChatConversation */ +/**************************************************************************/ /* * Data specific to Chats. */ -struct _PurpleChatConversationPrivate +typedef struct _PurpleChatConversationPrivate { GList *ignored; /* Ignored users. */ char *who; /* The person who set the topic. */ @@ -45,7 +72,7 @@ char *nick; /* Your nick in this chat. */ gboolean left; /* We left the chat and kept the window open */ GHashTable *users; /* Hash table of the users in the room. */ -}; +} PurpleChatConversationPrivate; /* Chat Property enums */ enum { @@ -58,30 +85,19 @@ CHAT_PROP_LAST }; -/* - * Data specific to Instant Messages. - */ -struct _PurpleIMConversationPrivate -{ - PurpleIMTypingState typing_state; /* The current typing state. */ - guint typing_timeout; /* The typing timer handle. */ - time_t type_again; /* The type again time. */ - guint send_typed_timeout; /* The type again timer handle. */ - PurpleBuddyIcon *icon; /* The buddy icon. */ -}; +static GParamSpec *chat_properties[CHAT_PROP_LAST]; -/* IM Property enums */ -enum { - IM_PROP_0, - IM_PROP_TYPING_STATE, - IM_PROP_ICON, - IM_PROP_LAST -}; +G_DEFINE_TYPE_WITH_PRIVATE(PurpleChatConversation, purple_chat_conversation, + PURPLE_TYPE_CONVERSATION); + +/**************************************************************************/ +/* PurpleChatUser */ +/**************************************************************************/ /* * Data for "Chat Buddies" */ -struct _PurpleChatUserPrivate +typedef struct _PurpleChatUserPrivate { PurpleChatConversation *chat; /* The chat */ char *name; /* The chat participant's name in the @@ -97,7 +113,7 @@ PurpleChatUserFlags flags; /* A bitwise OR of flags for this participant, such as whether they are a channel operator. */ -}; +} PurpleChatUserPrivate; /* Chat User Property enums */ enum { @@ -109,14 +125,8 @@ CU_PROP_LAST }; -static GParamSpec *chat_properties[CHAT_PROP_LAST]; -static GParamSpec *im_properties[IM_PROP_LAST]; static GParamSpec *cu_properties[CU_PROP_LAST]; -G_DEFINE_TYPE_WITH_PRIVATE(PurpleChatConversation, purple_chat_conversation, - PURPLE_TYPE_CONVERSATION); -G_DEFINE_TYPE_WITH_PRIVATE(PurpleIMConversation, purple_im_conversation, - PURPLE_TYPE_CONVERSATION); G_DEFINE_TYPE_WITH_PRIVATE(PurpleChatUser, purple_chat_user, G_TYPE_OBJECT);