fixed some clang warnings
[k8lowj.git] / src / history.c
blob28e786b47ccdb1b601fd7e9e41d92cd493049cfc
1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
3 */
4 #include "gtk-all.h"
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <time.h>
11 #include "liblj/getevents.h"
13 #include "conf.h"
14 #include "history.h"
15 #include "network.h"
16 #include "spawn.h"
19 LJEntry *history_load_itemid (GtkWindow *parent, JamAccount *acc, const char *usejournal, int itemid) {
20 NetContext *ctx;
21 LJGetEventsSingle *getevents;
22 LJEntry *entry;
24 if (!JAM_ACCOUNT_IS_LJ(acc)) {
25 g_warning("XXX blogger: history for blogger\n");
26 return NULL;
29 getevents = lj_getevents_single_new(jam_account_lj_get_user(JAM_ACCOUNT_LJ(acc)), usejournal, itemid);
30 ctx = net_ctx_gtk_new(parent, _("Loading Entry"));
31 if (!net_run_verb_ctx((LJVerb *) getevents, ctx, NULL)) {
32 lj_getevents_single_free(getevents, TRUE);
33 net_ctx_gtk_free(ctx);
34 return NULL;
36 entry = getevents->entry;
37 lj_getevents_single_free(getevents, FALSE);
38 net_ctx_gtk_free(ctx);
40 return entry;
44 LJEntry *history_load_latest (GtkWindow *win, JamAccount *acc, const char *usejournal) {
45 return history_load_itemid(win, acc, usejournal, -1);