comparison src/protocols/jabber/jabber.c @ 4732:c15e0699acae

[gaim-migrate @ 5047] hopefully this doesn't break anything. - Capabilities are back in the tooltips - Jabber does the neat status thing in the buddy list - jabber "broken" buddies are gone! woohoo! - most of the right-click menu items moved back to where they used to live, but Get Info remains at the top, because that's where it should be. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 13 Mar 2003 06:08:56 +0000
parents e34fe984f999
children a0746ffce599
comparison
equal deleted inserted replaced
4731:6f0ecc21db46 4732:c15e0699acae
1517 gaim_jid_free(gjid); 1517 gaim_jid_free(gjid);
1518 return; 1518 return;
1519 } 1519 }
1520 } 1520 }
1521 1521
1522 if (type && (strcasecmp(type, "unavailable") == 0)) 1522 if (state == UC_ERROR || (type && (strcasecmp(type, "unavailable") == 0)))
1523 jabber_remove_resource(GJ_GC(gjc), buddy, gjid->resource); 1523 jabber_remove_resource(GJ_GC(gjc), buddy, gjid->resource);
1524 else { 1524 else {
1525 jabber_track_resource(GJ_GC(gjc), buddy, gjid->resource, priority, state); 1525 jabber_track_resource(GJ_GC(gjc), buddy, gjid->resource, priority, state);
1526 1526
1527 /* keep track of away msg somewhat the same as the yahoo plugin */ 1527 /* keep track of away msg somewhat the same as the yahoo plugin */
1531 1531
1532 if (!cnv) { 1532 if (!cnv) {
1533 /* this is where we handle presence information for "regular" buddies */ 1533 /* this is where we handle presence information for "regular" buddies */
1534 jab_res_info jri = jabber_find_resource(GJ_GC(gjc), buddy); 1534 jab_res_info jri = jabber_find_resource(GJ_GC(gjc), buddy);
1535 if(jri) { 1535 if(jri) {
1536 serv_got_update(GJ_GC(gjc), buddy, 1, 0, b->signon, b->idle, jri->state, 0); 1536 serv_got_update(GJ_GC(gjc), buddy, 1, 0, b->signon, b->idle, jri->state);
1537 } else 1537 } else
1538 serv_got_update(GJ_GC(gjc), buddy, 0, 0, 0, 0, 0, 0); 1538 serv_got_update(GJ_GC(gjc), buddy, 0, 0, 0, 0, 0);
1539 1539
1540 } else { 1540 } else {
1541 if (gjid->resource) { 1541 if (gjid->resource) {
1542 if (type && (!strcasecmp(type, "unavailable"))) { 1542 if (type && (!strcasecmp(type, "unavailable"))) {
1543 struct jabber_data *jd; 1543 struct jabber_data *jd;
1795 b = gaim_buddy_new(GJ_GC(gjc)->account, buddyname, name); 1795 b = gaim_buddy_new(GJ_GC(gjc)->account, buddyname, name);
1796 gaim_blist_add_buddy(b, gaim_find_group(groupname), NULL); 1796 gaim_blist_add_buddy(b, gaim_find_group(groupname), NULL);
1797 gaim_blist_save(); 1797 gaim_blist_save();
1798 if(present) { 1798 if(present) {
1799 serv_got_update(GJ_GC(gjc), buddyname, 1, 0, signon, idle, 1799 serv_got_update(GJ_GC(gjc), buddyname, 1, 0, signon, idle,
1800 uc, 0); 1800 uc);
1801 } 1801 }
1802 } else if(name != NULL && strcmp(b->alias, name)) { 1802 } else if(name != NULL && strcmp(b->alias, name)) {
1803 g_free(b->alias); 1803 g_free(b->alias);
1804 b->alias = g_strdup(name); 1804 b->alias = g_strdup(name);
1805 gaim_blist_rename_buddy(b, buddyname); 1805 gaim_blist_rename_buddy(b, buddyname);
3200 jabber_get_away_msg(gc, realwho); 3200 jabber_get_away_msg(gc, realwho);
3201 g_free(realwho); 3201 g_free(realwho);
3202 3202
3203 } 3203 }
3204 3204
3205 static char *jabber_status_text(struct buddy *b)
3206 {
3207 struct jabber_data *jd = b->account->gc->proto_data;
3208 if (b->uc & UC_UNAVAILABLE) {
3209 return strip_html(jabber_lookup_away(jd->gjc, b->name));
3210 }
3211 return NULL;
3212 }
3213
3205 static GList *jabber_buddy_menu(struct gaim_connection *gc, char *who) { 3214 static GList *jabber_buddy_menu(struct gaim_connection *gc, char *who) {
3206 GList *m = NULL; 3215 GList *m = NULL;
3207 struct proto_buddy_menu *pbm; 3216 struct proto_buddy_menu *pbm;
3208 struct buddy *b = gaim_find_buddy(gc->account, who); 3217 struct buddy *b = gaim_find_buddy(gc->account, who);
3209 3218
3219 char *realwho = get_realwho(gjc, who, FALSE, NULL); 3228 char *realwho = get_realwho(gjc, who, FALSE, NULL);
3220 struct jabber_buddy_data *jbd = jabber_find_buddy(gc, realwho); 3229 struct jabber_buddy_data *jbd = jabber_find_buddy(gc, realwho);
3221 3230
3222 g_free(realwho); 3231 g_free(realwho);
3223 3232
3224 pbm = g_new0(struct proto_buddy_menu, 1);
3225 pbm->label = _("Get Info");
3226 pbm->callback = jabber_get_info;
3227 pbm->gc = gc;
3228 m = g_list_append(m, pbm);
3229 pbm = g_new0(struct proto_buddy_menu, 1); 3233 pbm = g_new0(struct proto_buddy_menu, 1);
3230 pbm->label = _("Get Away Msg"); 3234 pbm->label = _("Get Away Msg");
3231 pbm->callback = jabber_get_away_msg; 3235 pbm->callback = jabber_get_away_msg;
3232 pbm->gc = gc; 3236 pbm->gc = gc;
3233 m = g_list_append(m, pbm); 3237 m = g_list_append(m, pbm);
4155 struct proto_user_opt *puo; 4159 struct proto_user_opt *puo;
4156 ret->protocol = PROTO_JABBER; 4160 ret->protocol = PROTO_JABBER;
4157 ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC; 4161 ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC;
4158 ret->name = g_strdup("Jabber"); 4162 ret->name = g_strdup("Jabber");
4159 ret->list_icon = jabber_list_icon; 4163 ret->list_icon = jabber_list_icon;
4164 ret->status_text = jabber_status_text;
4160 ret->away_states = jabber_away_states; 4165 ret->away_states = jabber_away_states;
4161 ret->actions = jabber_actions; 4166 ret->actions = jabber_actions;
4162 ret->buddy_menu = jabber_buddy_menu; 4167 ret->buddy_menu = jabber_buddy_menu;
4163 ret->edit_buddy_menu = jabber_edit_buddy_menu; 4168 ret->edit_buddy_menu = jabber_edit_buddy_menu;
4164 ret->login = jabber_login; 4169 ret->login = jabber_login;