aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-18 14:38:06 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-18 14:38:06 +0000
commit638feab58aebc97d646820dd1bc9b8d9fbeec29d (patch)
treec4022afb6ffef2b672f3aaf16c8bd7a9f7b23ea8 /protocols/jabber/jabber.h
parent6ce01bec119c96243a8d43e28681cc512fbd0950 (diff)
parent842cd8dbfb98b61af33b5fe481364c3cfbeaca04 (diff)
Merging in Jabber resource selection fix. This adds the activity_timeout
setting, which makes BitlBee send a message to bare JIDs if there was no recent seen activity from any of the person's resources. This should fix most issues with messages going to the wrong resource (i.e. someone's mobile phone instead of something more sensible).
Diffstat (limited to 'protocols/jabber/jabber.h')
-rw-r--r--protocols/jabber/jabber.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h
index 8e3bf036..40cf3957 100644
--- a/protocols/jabber/jabber.h
+++ b/protocols/jabber/jabber.h
@@ -107,6 +107,13 @@ struct jabber_cache_entry
jabber_cache_event func;
};
+/* Somewhat messy data structure: We have a hash table with the bare JID as
+ the key and the head of a struct jabber_buddy list as the value. The head
+ is always a bare JID. If the JID has other resources (often the case,
+ except for some transports that don't support multiple resources), those
+ follow. In that case, the bare JID at the beginning doesn't actually
+ refer to a real session and should only be used for operations that
+ support incomplete JIDs. */
struct jabber_buddy
{
char *bare_jid;
@@ -120,7 +127,7 @@ struct jabber_buddy
struct jabber_away_state *away_state;
char *away_message;
- time_t last_act;
+ time_t last_msg;
jabber_buddy_flags_t flags;
struct jabber_buddy *next;
@@ -208,6 +215,8 @@ typedef enum
GET_BUDDY_CREAT = 1, /* Try to create it, if necessary. */
GET_BUDDY_EXACT = 2, /* Get an exact match (only makes sense with bare JIDs). */
GET_BUDDY_FIRST = 4, /* No selection, simply get the first resource for this JID. */
+ GET_BUDDY_BARE = 8, /* Get the bare version of the JID (possibly inexistent). */
+ GET_BUDDY_BARE_OK = 16, /* Allow returning a bare JID if that seems better. */
} get_buddy_flags_t;
struct jabber_error