# HG changeset patch # User Mikael Berthe # Date 1265476566 -3600 # Node ID b2e0083891cc192011a6d6921f33c6ba096723e6 # Parent 46f1cf3b637327482cbec514346dd2e80626b70e Replace JEP with XEP diff -r 46f1cf3b6373 -r b2e0083891cc mcabber/mcabber/roster.c --- a/mcabber/mcabber/roster.c Sat Feb 06 01:50:29 2010 +0200 +++ b/mcabber/mcabber/roster.c Sat Feb 06 18:16:06 2010 +0100 @@ -68,10 +68,10 @@ gchar *realjid; /* for chatrooms, if buddy's real jid is known */ guint events; char *caps; -#ifdef JEP0022 +#ifdef XEP0022 struct jep0022 jep22; #endif -#ifdef JEP0085 +#ifdef XEP0085 struct jep0085 jep85; #endif #ifdef HAVE_GPGME @@ -144,7 +144,7 @@ g_free((gchar*)p_res->status_msg); g_free((gchar*)p_res->name); g_free((gchar*)p_res->realjid); -#ifdef JEP0022 +#ifdef XEP0022 g_free(p_res->jep22.last_msgid_sent); g_free(p_res->jep22.last_msgid_rcvd); #endif @@ -1220,7 +1220,7 @@ struct jep0022 *buddy_resource_jep22(gpointer rosterdata, const char *resname) { -#ifdef JEP0022 +#ifdef XEP0022 roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) @@ -1231,7 +1231,7 @@ struct jep0085 *buddy_resource_jep85(gpointer rosterdata, const char *resname) { -#ifdef JEP0085 +#ifdef XEP0085 roster *roster_usr = rosterdata; res *p_res = get_resource(roster_usr, resname); if (p_res) diff -r 46f1cf3b6373 -r b2e0083891cc mcabber/mcabber/roster.h --- a/mcabber/mcabber/roster.h Sat Feb 06 01:50:29 2010 +0200 +++ b/mcabber/mcabber/roster.h Sat Feb 06 18:16:06 2010 +0100 @@ -98,8 +98,8 @@ #define ROSTER_FLAG_USRLOCK (1U<<3) // Node should not be removed from buddylist // ROSTER_FLAG_LOCAL (1U<<4) // Buddy not on server's roster (??) -#define JEP0022 -#define JEP0085 +#define XEP0022 +#define XEP0085 struct jep0022 { guint support; @@ -130,13 +130,13 @@ /* Message event and chat state flags */ #define ROSTER_EVENT_NONE 0U -/* JEP-22 Message Events */ +/* XEP-22 Message Events */ #define ROSTER_EVENT_OFFLINE (1U<<0) #define ROSTER_EVENT_DELIVERED (1U<<1) #define ROSTER_EVENT_DISPLAYED (1U<<2) -/* JEP-22 & JEP-85 */ +/* XEP-22 & XEP-85 */ #define ROSTER_EVENT_COMPOSING (1U<<3) -/* JEP-85 Chat State Notifications */ +/* XEP-85 Chat State Notifications */ #define ROSTER_EVENT_ACTIVE (1U<<4) #define ROSTER_EVENT_PAUSED (1U<<5) #define ROSTER_EVENT_INACTIVE (1U<<6) diff -r 46f1cf3b6373 -r b2e0083891cc mcabber/mcabber/screen.c --- a/mcabber/mcabber/screen.c Sat Feb 06 01:50:29 2010 +0200 +++ b/mcabber/mcabber/screen.c Sat Feb 06 18:16:06 2010 +0100 @@ -2146,7 +2146,7 @@ // If the chat state has changed, call xmpp_send_chatstate() static inline void set_chatstate(int state) { -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 if (chatstates_disabled) return; if (!chatmode) @@ -2175,7 +2175,7 @@ #endif } -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 gboolean scr_ChatStatesTimeout(void) { time_t now; diff -r 46f1cf3b6373 -r b2e0083891cc mcabber/mcabber/screen.h --- a/mcabber/mcabber/screen.h Sat Feb 06 01:50:29 2010 +0200 +++ b/mcabber/mcabber/screen.h Sat Feb 06 18:16:06 2010 +0100 @@ -125,7 +125,7 @@ void scr_CheckAutoAway(int activity); -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 gboolean scr_ChatStatesTimeout(); #endif int chatstates_disabled; diff -r 46f1cf3b6373 -r b2e0083891cc mcabber/mcabber/xmpp.c --- a/mcabber/mcabber/xmpp.c Sat Feb 06 01:50:29 2010 +0200 +++ b/mcabber/mcabber/xmpp.c Sat Feb 06 18:16:06 2010 +0100 @@ -300,11 +300,11 @@ #ifdef HAVE_LIBOTR int otr_msg = 0; #endif -#if defined HAVE_GPGME || defined JEP0022 || defined JEP0085 +#if defined HAVE_GPGME || defined XEP0022 || defined XEP0085 char *rname, *barejid; GSList *sl_buddy; #endif -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 LmMessageNode *event; guint use_jep85 = 0; struct jep0085 *jep85 = NULL; @@ -330,7 +330,7 @@ } #if defined HAVE_GPGME || defined HAVE_LIBOTR || \ - defined JEP0022 || defined JEP0085 + defined XEP0022 || defined XEP0085 rname = strchr(fjid, JID_RESOURCE_SEPARATOR); barejid = jidtodisp(fjid); sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); @@ -387,7 +387,7 @@ #endif // HAVE_GPGME g_free(barejid); -#endif // HAVE_GPGME || defined JEP0022 || defined JEP0085 +#endif // HAVE_GPGME || defined XEP0022 || defined XEP0085 x = lm_message_new_with_sub_type(fjid, LM_MESSAGE_TYPE_MESSAGE, subtype); lm_message_node_add_child(x->node, "body", @@ -415,7 +415,7 @@ *xep184 = lm_message_handler_new(cb_xep184, NULL, NULL); } -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 // If typing notifications are disabled, we can skip all this stuff... if (chatstates_disabled || type == ROSTER_TYPE_ROOM) goto xmpp_send_msg_no_chatstates; @@ -424,8 +424,8 @@ jep85 = buddy_resource_jep85(sl_buddy->data, rname); #endif -#ifdef JEP0085 - /* JEP-0085 5.1 +#ifdef XEP0085 + /* XEP-0085 5.1 * "Until receiving a reply to the initial content message (or a standalone * notification) from the Contact, the User MUST NOT send subsequent chat * state notifications to the Contact." @@ -443,10 +443,10 @@ jep85->last_state_sent = ROSTER_EVENT_ACTIVE; } #endif -#ifdef JEP0022 - /* JEP-22 - * If the Contact supports JEP-0085, we do not use JEP-0022. - * If not, we try to fall back to JEP-0022. +#ifdef XEP0022 + /* XEP-22 + * If the Contact supports XEP-0085, we do not use XEP-0022. + * If not, we try to fall back to XEP-0022. */ if (!use_jep85) { struct jep0022 *jep22 = NULL; @@ -459,7 +459,7 @@ if (jep22) jep22->last_state_sent = ROSTER_EVENT_ACTIVE; - // An id is mandatory when using JEP-0022. + // An id is mandatory when using XEP-0022. if (text || subject) { const gchar *msgid = lm_message_get_id(x); // Let's update last_msgid_sent @@ -482,9 +482,9 @@ lm_message_unref(x); } -#ifdef JEP0085 +#ifdef XEP0085 // xmpp_send_jep85_chatstate() -// Send a JEP-85 chatstate. +// Send a XEP-85 chatstate. static void xmpp_send_jep85_chatstate(const char *bjid, const char *resname, guint state) { @@ -518,7 +518,7 @@ else if (state == ROSTER_EVENT_PAUSED) chattag = "paused"; else { - scr_LogPrint(LPRINT_LOGNORM, "Error: unsupported JEP-85 state (%d)", state); + scr_LogPrint(LPRINT_LOGNORM, "Error: unsupported XEP-85 state (%d)", state); return; } @@ -541,9 +541,9 @@ } #endif -#ifdef JEP0022 +#ifdef XEP0022 // xmpp_send_jep22_event() -// Send a JEP-22 message event (delivered, composing...). +// Send a XEP-22 message event (delivered, composing...). static void xmpp_send_jep22_event(const char *fjid, guint type) { LmMessage *x; @@ -575,7 +575,7 @@ msgid = jep22->last_msgid_rcvd; // For composing events (composing, active, inactive, paused...), - // JEP22 only has 2 states; we'll use composing and active. + // XEP22 only has 2 states; we'll use composing and active. if (type == ROSTER_EVENT_COMPOSING) jep22_state = ROSTER_EVENT_COMPOSING; else if (type == ROSTER_EVENT_ACTIVE || @@ -608,24 +608,24 @@ #endif // xmpp_send_chatstate(buddy, state) -// Send a chatstate or event (JEP-22/85) according to the buddy's capabilities. +// Send a chatstate or event (XEP-22/85) according to the buddy's capabilities. // The message is sent to one of the resources with the highest priority. -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 void xmpp_send_chatstate(gpointer buddy, guint chatstate) { const char *bjid; -#ifdef JEP0085 +#ifdef XEP0085 GSList *resources, *p_res, *p_next; struct jep0085 *jep85 = NULL; #endif -#ifdef JEP0022 +#ifdef XEP0022 struct jep0022 *jep22; #endif bjid = buddy_getjid(buddy); if (!bjid) return; -#ifdef JEP0085 +#ifdef XEP0085 /* Send the chatstate to the last resource (which should have the highest priority). If chatstate is "active", send an "active" state to all resources @@ -646,11 +646,11 @@ } g_slist_free(resources); // If the last resource had chatstates support when can return now, - // we don't want to send a JEP22 event. + // we don't want to send a XEP22 event. if (jep85 && jep85->support == CHATSTATES_SUPPORT_OK) return; #endif -#ifdef JEP0022 +#ifdef XEP0022 jep22 = buddy_resource_jep22(buddy, NULL); if (jep22 && jep22->support == CHATSTATES_SUPPORT_OK) { xmpp_send_jep22_event(bjid, chatstate); @@ -661,9 +661,9 @@ // chatstates_reset_probed(fulljid) -// If the JEP has been probed for this contact, set it back to unknown so +// If the XEP has been probed for this contact, set it back to unknown so // that we probe it again. The parameter must be a full jid (w/ resource). -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 static void chatstates_reset_probed(const char *fulljid) { char *rname, *barejid; @@ -940,7 +940,7 @@ static void handle_state_events(const char *from, LmMessageNode *node) { -#if defined JEP0022 || defined JEP0085 +#if defined XEP0022 || defined XEP0085 LmMessageNode *state_ns = NULL; const char *body; char *rname, *bjid; @@ -949,10 +949,10 @@ struct jep0022 *jep22 = NULL; struct jep0085 *jep85 = NULL; enum { - JEP_none, - JEP_85, - JEP_22 - } which_jep = JEP_none; + XEP_none, + XEP_85, + XEP_22 + } which_jep = XEP_none; rname = strchr(from, JID_RESOURCE_SEPARATOR); if (rname) @@ -964,29 +964,29 @@ g_free(bjid); /* XXX Actually that's wrong, since it filters out server "offline" - messages (for JEP-0022). This JEP is (almost) deprecated so + messages (for XEP-0022). This XEP is (almost) deprecated so we don't really care. */ if (!sl_buddy) { return; } - /* Let's see chich JEP the contact uses. If possible, we'll use - JEP-85, if not we'll look for JEP-22 support. */ + /* Let's see chich XEP the contact uses. If possible, we'll use + XEP-85, if not we'll look for XEP-22 support. */ events = buddy_resource_getevents(sl_buddy->data, rname); jep85 = buddy_resource_jep85(sl_buddy->data, rname); if (jep85) { state_ns = lm_message_node_find_xmlns(node, NS_CHATSTATES); if (state_ns) - which_jep = JEP_85; + which_jep = XEP_85; } - if (which_jep != JEP_85) { /* Fall back to JEP-0022 */ + if (which_jep != XEP_85) { /* Fall back to XEP-0022 */ jep22 = buddy_resource_jep22(sl_buddy->data, rname); if (jep22) { state_ns = lm_message_node_find_xmlns(node, NS_EVENT); if (state_ns) - which_jep = JEP_22; + which_jep = XEP_22; } } @@ -996,7 +996,7 @@ body = lm_message_node_get_child_value(node, "body"); - if (which_jep == JEP_85) { /* JEP-0085 */ + if (which_jep == XEP_85) { /* XEP-0085 */ jep85->support = CHATSTATES_SUPPORT_OK; if (!strcmp(state_ns->name, "composing")) { @@ -1011,8 +1011,8 @@ jep85->last_state_rcvd = ROSTER_EVENT_GONE; } events = jep85->last_state_rcvd; - } else { /* JEP-0022 */ -#ifdef JEP0022 + } else { /* XEP-0022 */ +#ifdef XEP0022 const char *msgid; jep22->support = CHATSTATES_SUPPORT_OK; jep22->last_state_rcvd = ROSTER_EVENT_NONE; @@ -1233,8 +1233,8 @@ if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { x = lm_message_node_get_child(m->node, "error"); display_server_error(x); -#if defined JEP0022 || defined JEP0085 - // If the JEP85/22 support is probed, set it back to unknown so that +#if defined XEP0022 || defined XEP0085 + // If the XEP85/22 support is probed, set it back to unknown so that // we probe it again. chatstates_reset_probed(from); #endif