src/protocols/irc/irc.c

changeset 2393
cfef0212506b
parent 2382
69a4e3665132
child 2394
8b1b56d55d75
equal deleted inserted replaced
2392:c8eed9c44ab4 2393:cfef0212506b
1317 static void irc_set_away(struct gaim_connection *gc, char *state, char *msg) 1317 static void irc_set_away(struct gaim_connection *gc, char *state, char *msg)
1318 { 1318 {
1319 struct irc_data *idata = gc->proto_data; 1319 struct irc_data *idata = gc->proto_data;
1320 char buf[IRC_BUF_LEN]; 1320 char buf[IRC_BUF_LEN];
1321 1321
1322 if (msg) 1322 if (gc->away)
1323 g_free(gc->away);
1324 gc->away = NULL;
1325
1326 if (msg) {
1323 g_snprintf(buf, sizeof(buf), "AWAY :%s\r\n", msg); 1327 g_snprintf(buf, sizeof(buf), "AWAY :%s\r\n", msg);
1324 else 1328 gc->away = g_strdup(msg);
1329 } else
1325 g_snprintf(buf, sizeof(buf), "AWAY\r\n"); 1330 g_snprintf(buf, sizeof(buf), "AWAY\r\n");
1326 irc_write(idata->fd, buf, strlen(buf)); 1331 irc_write(idata->fd, buf, strlen(buf));
1327 } 1332 }
1328 1333
1329 static char **irc_list_icon(int uc) 1334 static char **irc_list_icon(int uc)

mercurial