Skip to content

Commit 205d2ed

Browse files
committed
Properly initialize the bee_user data
This is mainly for sanity and consistency as the bee_user should be zeroed.
1 parent e9b15f9 commit 205d2ed

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

facebook/facebook.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fb_cb_api_contacts(FbApi *api, GSList *users, gboolean complete, gpointer data)
243243
}
244244

245245
if (GPOINTER_TO_INT(bu->data)) {
246-
bu->data = NULL;
246+
bu->data = GINT_TO_POINTER(FALSE);
247247
} else {
248248
imcb_remove_buddy(ic, bu->handle, NULL);
249249
}
@@ -870,6 +870,18 @@ fb_away_states(struct im_connection *ic)
870870
return m;
871871
}
872872

873+
static void
874+
fb_buddy_data_add(struct bee_user *bu)
875+
{
876+
bu->data = GINT_TO_POINTER(FALSE);
877+
}
878+
879+
static void
880+
fb_buddy_data_free(struct bee_user *bu)
881+
{
882+
bu->data = NULL;
883+
}
884+
873885
static account_t *
874886
fb_cmd_account(irc_t *irc, char **args, guint required, guint *offset)
875887
{
@@ -1068,7 +1080,9 @@ init_plugin(void)
10681080
.chat_join = fb_chat_join,
10691081
.chat_topic = fb_chat_topic,
10701082
.away_states = fb_away_states,
1071-
.handle_cmp = g_strcmp0
1083+
.handle_cmp = g_strcmp0,
1084+
.buddy_data_add = fb_buddy_data_add,
1085+
.buddy_data_free = fb_buddy_data_free
10721086
};
10731087

10741088
#if !GLIB_CHECK_VERSION(2, 36, 0)

0 commit comments

Comments
 (0)