libpurple/protocols/gg/servconn.c

changeset 34350
89441dbabc83
parent 33368
6aa16fdab83f
child 35145
01ef7274b440
child 36744
a7c26ee6e466
equal deleted inserted replaced
34349:dab5af140c43 34350:89441dbabc83
66 } 66 }
67 67
68 void ggp_servconn_add_server(const gchar *server) 68 void ggp_servconn_add_server(const gchar *server)
69 { 69 {
70 GList *old_entry; 70 GList *old_entry;
71 gchar *joined;
71 72
72 old_entry = g_list_find_custom(global_data.server_history, server, 73 old_entry = g_list_find_custom(global_data.server_history, server,
73 (GCompareFunc)g_strcmp0); 74 (GCompareFunc)g_strcmp0);
74 if (old_entry) 75 if (old_entry)
75 { 76 {
82 g_strdup(server)); 83 g_strdup(server));
83 global_data.server_history = ggp_list_truncate( 84 global_data.server_history = ggp_list_truncate(
84 global_data.server_history, GGP_SERVCONN_HISTORY_MAXLEN, 85 global_data.server_history, GGP_SERVCONN_HISTORY_MAXLEN,
85 g_free); 86 g_free);
86 87
87 purple_prefs_set_string(GGP_SERVCONN_HISTORY_PREF, ggp_strjoin_list(";", 88 joined = ggp_strjoin_list(";", global_data.server_history);
88 global_data.server_history)); 89 purple_prefs_set_string(GGP_SERVCONN_HISTORY_PREF, joined);
90 g_free(joined);
89 purple_account_option_string_set_hints(global_data.server_option, 91 purple_account_option_string_set_hints(global_data.server_option,
90 ggp_servconn_get_servers()); 92 ggp_servconn_get_servers());
91 } 93 }
92 94
93 GSList * ggp_servconn_get_servers(void) 95 GSList * ggp_servconn_get_servers(void)

mercurial