aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-10-08 18:11:16 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-10-08 18:11:16 +0200
commit038d17f834219505cbbdae469b2b150117467dd0 (patch)
treeee752d2e307c3e82931337e85d79d23707378f1f /protocols/jabber/jabber.h
parent36e9f62a6e6fdb1217b3b819320ac5a94025c448 (diff)
Implemented a better node cache using a GLib hash, and preparing to add
event handlers that can be set when sending a packet to handle the reply to this specific packet. This should allow me to make the iq handler a lot cleaner.
Diffstat (limited to 'protocols/jabber/jabber.h')
-rw-r--r--protocols/jabber/jabber.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h
index 8ca7d545..58a81810 100644
--- a/protocols/jabber/jabber.h
+++ b/protocols/jabber/jabber.h
@@ -59,7 +59,7 @@ struct jabber_data
struct jabber_away_state *away_state;
char *away_message;
- struct xt_node *node_cache;
+ GHashTable *node_cache;
};
struct jabber_away_state
@@ -68,6 +68,14 @@ struct jabber_away_state
char *full_name;
};
+typedef xt_status (*jabber_cache_event) ( struct gaim_connection *gc, struct xt_node *packet );
+
+struct jabber_cache_entry
+{
+ struct xt_node *node;
+ jabber_cache_event func;
+};
+
/* iq.c */
xt_status jabber_pkt_iq( struct xt_node *node, gpointer data );
int jabber_start_iq_auth( struct gaim_connection *gc );
@@ -87,8 +95,10 @@ int presence_send_request( struct gaim_connection *gc, char *handle, char *reque
char *set_eval_priority( set_t *set, char *value );
char *set_eval_tls( set_t *set, char *value );
struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children );
-void jabber_cache_packet( struct gaim_connection *gc, struct xt_node *node );
-struct xt_node *jabber_packet_from_cache( struct gaim_connection *gc, char *id );
+void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node );
+struct xt_node *jabber_cache_get( struct gaim_connection *gc, char *id );
+void jabber_cache_entry_free( gpointer entry );
+void jabber_cache_clean( struct gaim_connection *gc );
const struct jabber_away_state *jabber_away_state_by_code( char *code );
const struct jabber_away_state *jabber_away_state_by_name( char *name );
void jabber_buddy_ask( struct gaim_connection *gc, char *handle );