Mercurial > pidgin
diff src/protocols/yahoo/yahoo.c @ 9283:66ff39319900
[gaim-migrate @ 10086]
Just some boring accessor function stuff. Move along folks.
committer: Tailor Script <tailor@pidgin.im>
| author | Tim Ringenbach <marv@pidgin.im> |
|---|---|
| date | Mon, 14 Jun 2004 16:44:32 +0000 |
| parents | adde46ad65e9 |
| children | fe0291162312 |
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c Mon Jun 14 07:06:37 2004 +0000 +++ b/src/protocols/yahoo/yahoo.c Mon Jun 14 16:44:32 2004 +0000 @@ -327,19 +327,14 @@ f->idle = time(NULL); else f->idle = 0; - if (f->status != YAHOO_STATUS_CUSTOM) { - g_free(f->msg); - f->msg = NULL; - } + if (f->status != YAHOO_STATUS_CUSTOM) + yahoo_friend_set_status_message(f, NULL); f->sms = 0; break; case 19: /* custom message */ - if (f) { - if (f->msg) - g_free(f->msg); - f->msg = yahoo_string_decode(gc, pair->value, FALSE); - } + if (f) + yahoo_friend_set_status_message(f, yahoo_string_decode(gc, pair->value, FALSE)); break; case 11: /* this is the buddy's session id */ break; @@ -678,13 +673,10 @@ if (!f) return; /* if they're not on the list, don't bother */ - if (f->game) { - g_free(f->game); - f->game = NULL; - } + yahoo_friend_set_game(f, NULL); if (*stat == '1') { - f->game = g_strdup(game); + yahoo_friend_set_game(f, game); if (bud) yahoo_update_status(gc, from, f); } @@ -2345,7 +2337,7 @@ emblems[i++] = "away"; if (f->sms) emblems[i++] = "wireless"; - if (f->game) + if (yahoo_friend_get_game(f)) emblems[i++] = "game"; } *se = emblems[0]; @@ -2419,7 +2411,8 @@ GaimConnection *gc; struct yahoo_data *yd; - char *game = NULL; + const char *game; + char *game2; char *t; char url[256]; YahooFriend *f; @@ -2434,22 +2427,23 @@ if (!f) return; - game = f->game; + game = yahoo_friend_get_game(f); if (!game) return; - t = game = g_strdup(strstr(game, "ante?room=")); - while (*t != '\t') + t = game2 = g_strdup(strstr(game, "ante?room=")); + while (*t && *t != '\t') t++; *t = 0; - g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game); + g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game2); gaim_notify_uri(gc, url); - g_free(game); + g_free(game2); } static char *yahoo_status_text(GaimBuddy *b) { YahooFriend *f = NULL; + const char *msg; f = yahoo_friend_find(b->account->gc, b->name); if (!f) @@ -2463,9 +2457,9 @@ return g_strdup(yahoo_get_status_string(f->status)); return NULL; case YAHOO_STATUS_CUSTOM: - if (!f->msg) + if (!(msg = yahoo_friend_get_status_message(f))) return NULL; - return g_markup_escape_text(f->msg, strlen(f->msg)); + return g_markup_escape_text(msg, strlen(msg)); default: return g_strdup(yahoo_get_status_string(f->status)); @@ -2489,9 +2483,9 @@ } return NULL; case YAHOO_STATUS_CUSTOM: - if (!f->msg) + if (!yahoo_friend_get_status_message(f)) return NULL; - status = g_strdup(f->msg); + status = g_strdup(yahoo_friend_get_status_message(f)); break; default: status = g_strdup(yahoo_get_status_string(f->status)); @@ -2583,14 +2577,11 @@ yahoo_ask_send_file_menu, NULL); m = g_list_append(m, act); - if (f->game) { - char *game = f->game; + if (yahoo_friend_get_game(f)) { + const char *game = yahoo_friend_get_game(f); char *room; char *t; - if (!game) - return m; - if (!(room = strstr(game, "&follow="))) /* skip ahead to the url */ return m; while (*room && *room != '\t') /* skip to the tab */
