Mercurial > pidgin.yaz
comparison src/protocols/jabber/presence.c @ 10755:fffc664d5294
[gaim-migrate @ 12358]
Some TLC for Jabber and Yahoo!. Jabber no longer crashes at signoff.
Is Left Eye Lopez the one that burned down that guy's house?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 27 Mar 2005 19:29:18 +0000 |
parents | 55af3fa46329 |
children | cef48e318125 |
comparison
equal
deleted
inserted
replaced
10754:8a97b59f0071 | 10755:fffc664d5294 |
---|---|
89 | 89 |
90 void jabber_presence_send(GaimAccount *account, GaimStatus *status) | 90 void jabber_presence_send(GaimAccount *account, GaimStatus *status) |
91 { | 91 { |
92 GaimConnection *gc = NULL; | 92 GaimConnection *gc = NULL; |
93 JabberStream *js = NULL; | 93 JabberStream *js = NULL; |
94 gboolean connected; | |
95 int primitive; | |
94 xmlnode *presence, *x, *photo; | 96 xmlnode *presence, *x, *photo; |
95 char *stripped = NULL; | 97 char *stripped = NULL; |
96 const char *msg; | 98 const char *msg; |
97 JabberBuddyState state; | 99 JabberBuddyState state; |
98 int priority; | 100 int priority; |
99 | 101 |
100 if(!gaim_status_is_active(status)) | 102 if(!gaim_status_is_active(status)) |
101 return; | 103 return; |
102 | 104 |
103 if(!account) return ; | 105 connected = gaim_account_is_connected(account); |
104 gc = account->gc; | 106 primitive = gaim_status_type_get_primitive(gaim_status_get_type(status)); |
105 | 107 |
106 if (!gc && strcmp(gaim_status_get_id(status), "offline")) | 108 if(primitive != GAIM_STATUS_OFFLINE && !connected) { |
107 gaim_account_connect(account); | 109 gaim_account_connect(account); |
108 | 110 } else if(primitive == GAIM_STATUS_OFFLINE && connected) { |
109 if(!gc) return; | 111 gaim_account_disconnect(account); |
110 js= gc->proto_data; | 112 } |
111 | 113 |
114 if(!connected) | |
115 return; | |
116 | |
117 gc = gaim_account_get_connection(account); | |
118 js = gc->proto_data; | |
119 | |
112 gaim_status_to_jabber(status, &state, &msg, &priority); | 120 gaim_status_to_jabber(status, &state, &msg, &priority); |
113 | 121 |
114 if(msg) | 122 if(msg) |
115 gaim_markup_html_to_xhtml(msg, NULL, &stripped); | 123 gaim_markup_html_to_xhtml(msg, NULL, &stripped); |
116 | 124 |