Don't make thrasher_action_presence() calls we know will end in assert failure.
[thrasher.git] / thrasher.h
blob6a8953713a30427cd5f5873b83329f082c923c15
1 /*
2 * Thrasher Bird - XMPP transport via libpurple
3 * Copyright (C) 2008 Barracuda Networks, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Thrasher Bird; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
19 #ifndef THRASHER_H
20 #define THRASHER_H
22 #include <error.h>
23 #include "purple.h"
25 #define THRASHER_DEBUG "thrasher"
26 #define THRASHER_PORT 31415
27 #define USER_ROOT_DIR "/tmp/purpletest"
28 #define MAX_NAME_LEN 128
29 #define CUSTOM_PLUGIN_PATH ""
30 #define PLUGIN_SAVE_PREF "/purple/thrasher/plugins/saved"
31 #define UI_ID "thrasher"
33 #define PURPLE_GLIB_READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR)
34 #define PURPLE_GLIB_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)
37 /* Errors */
38 #define NO_PROTOCOLS 1
41 typedef struct _PurpleGLibIOClosure {
42 PurpleInputFunction function;
43 guint result;
44 gpointer data;
45 } PurpleGLibIOClosure;
48 char * get_current_login_jid(void);
49 void set_got_error(uint);
50 PurpleAccount *
51 thrasher_login (char *service, char *username, char *password, char *jid,
52 GHashTable *other_args);
53 void thrasher_init(void);
54 gboolean thrasher_send_msg (PurpleAccount *pa, const char *name, const char *message);
55 void thrasher_signing_off_cb(PurpleConnection *gc);
56 void thrasher_logout (PurpleAccount *pa);
57 void thrasher_whoami (PurpleAccount *pa);
58 PurpleAccount* thrasher_get_account_by_jid(const char* jid);
59 PurpleConnection* thrasher_get_connection_by_account(const PurpleAccount*);
61 void thrasher_connection(PurpleConnection *);
62 PurpleConnection* thrasher_connection_for_account(PurpleAccount *);
64 typedef struct _Thrasher_PurpleAccount_UI_Data {
65 gchar *jid; /* not owned */
66 GHashTable *pending_send_file; /* char* who => Thrasher_Xfer_UI_Data* */
67 } Thrasher_PurpleAccount_UI_Data;
69 gchar* thrasher_account_get_jid(PurpleAccount *account);
70 GHashTable* thrasher_account_get_pending_send_file(PurpleAccount *account);
71 gboolean thrasher_account_buddy_is_authorized(PurpleAccount *account, PurpleBuddy *buddy);
73 #endif /* THRASHER_H */