comparison mcabber/src/jabglue.c @ 1099:7804dbac3875

Fix a potential JEP22/85 issue introduced by changeset 10f9d6fcfeab If the remote client has JEP85 resource, make sure we do not send a JEP22 event.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 10 Dec 2006 15:01:18 +0100
parents 10f9d6fcfeab
children 382972712208
comparison
equal deleted inserted replaced
1098:b3bfdecfd178 1099:7804dbac3875
791 void jb_send_chatstate(gpointer buddy, guint chatstate) 791 void jb_send_chatstate(gpointer buddy, guint chatstate)
792 { 792 {
793 const char *bjid; 793 const char *bjid;
794 #ifdef JEP0085 794 #ifdef JEP0085
795 GSList *resources, *p_res, *p_next; 795 GSList *resources, *p_res, *p_next;
796 struct jep0085 *jep85; 796 struct jep0085 *jep85 = NULL;;
797 #endif 797 #endif
798 #ifdef JEP0022 798 #ifdef JEP0022
799 struct jep0022 *jep22; 799 struct jep0022 *jep22;
800 #endif 800 #endif
801 801
820 jb_send_jep85_chatstate(bjid, p_res->data, chatstate); 820 jb_send_jep85_chatstate(bjid, p_res->data, chatstate);
821 } 821 }
822 g_free(p_res->data); 822 g_free(p_res->data);
823 } 823 }
824 g_slist_free(resources); 824 g_slist_free(resources);
825 // If the last resource had chatstates support when can return now,
826 // we don't want to send a JEP22 event.
827 if (jep85 && jep85->support == CHATSTATES_SUPPORT_OK)
828 return;
825 #endif 829 #endif
826 #ifdef JEP0022 830 #ifdef JEP0022
827 jep22 = buddy_resource_jep22(buddy, NULL); 831 jep22 = buddy_resource_jep22(buddy, NULL);
828 if (jep22 && jep22->support == CHATSTATES_SUPPORT_OK) { 832 if (jep22 && jep22->support == CHATSTATES_SUPPORT_OK) {
829 jb_send_jep22_event(bjid, chatstate); 833 jb_send_jep22_event(bjid, chatstate);