Mercurial > pidgin
comparison src/protocols/jabber/jabber.c @ 4916:d9b6b5ae34e4
[gaim-migrate @ 5250]
Buddy list editing.
Does this work? I don't know; I don't test things. It compiles though.
It probably does work though, because I'm perfect.
So, see, I did really terribly in school last semester (really terribly--
like, why didn't they kick me out terribly) and so I'm working really hard
to do well this semester (and I am so far :)). Anyway, that's why you may
have noticed I'm a bit slow with the development of late. In fact, I would
test and fix this stuff up, but I really need to work on an English paper,
so I figured it'd be best just to commit it as is and let Rob, Nathan, Chip
and the boys work out the kinks. Besides, I've had most of this code written
for weeks already.
Thank you all for your patience.
Oh, so there's now an Edit menu on your buddy list (which makes the minimum
buddy list width wider :-D) and here you'll find things with which to edit
your list and privacy, prefs and accounts. It should all be real intuitive.
Feel free to IM me if you want to talk about my paper.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 31 Mar 2003 07:19:46 +0000 |
parents | 0230df73f56a |
children | c0c6efda8151 |
comparison
equal
deleted
inserted
replaced
4915:0230df73f56a | 4916:d9b6b5ae34e4 |
---|---|
2646 gjab_send(((struct jabber_data *)gc->proto_data)->gjc, x); | 2646 gjab_send(((struct jabber_data *)gc->proto_data)->gjc, x); |
2647 g_free(realwho); | 2647 g_free(realwho); |
2648 xmlnode_free(x); | 2648 xmlnode_free(x); |
2649 } | 2649 } |
2650 | 2650 |
2651 #if 0 /* Faceprint! Look here! */ | |
2651 /* | 2652 /* |
2652 * Remove a buddy item from the roster entirely | 2653 * Remove a buddy item from the roster entirely |
2653 */ | 2654 */ |
2654 static void jabber_remove_buddy_roster_item(struct gaim_connection *gc, char *name) | 2655 static void jabber_remove_buddy_roster_item(struct gaim_connection *gc, char *name) |
2655 { | 2656 { |
2664 gjab_send(((struct jabber_data *)gc->proto_data)->gjc, x); | 2665 gjab_send(((struct jabber_data *)gc->proto_data)->gjc, x); |
2665 g_free(realwho); | 2666 g_free(realwho); |
2666 xmlnode_free(x); | 2667 xmlnode_free(x); |
2667 } | 2668 } |
2668 } | 2669 } |
2670 #endif | |
2669 | 2671 |
2670 /* | 2672 /* |
2671 * Unsubscribe a buddy from our presence | 2673 * Unsubscribe a buddy from our presence |
2672 */ | 2674 */ |
2673 static void jabber_unsubscribe_buddy_from_us(struct gaim_connection *gc, char *name) | 2675 static void jabber_unsubscribe_buddy_from_us(struct gaim_connection *gc, char *name) |
2774 | 2776 |
2775 static const char *jabber_list_icon(struct gaim_account *a, struct buddy *b) | 2777 static const char *jabber_list_icon(struct gaim_account *a, struct buddy *b) |
2776 { | 2778 { |
2777 return "jabber"; | 2779 return "jabber"; |
2778 } | 2780 } |
2779 /* | 2781 |
2780 switch (uc) { | 2782 static void jabber_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne) |
2781 case UC_AWAY: | 2783 { |
2782 return available_away_xpm; | 2784 if (b->present == 0) { |
2783 case UC_CHAT: | 2785 *se = "offline"; |
2784 return available_chat_xpm; | 2786 } else { |
2785 case UC_XA: | 2787 switch (b->uc) { |
2786 return available_xa_xpm; | 2788 case UC_AWAY: |
2787 case UC_DND: | 2789 *se = "away"; |
2788 return available_dnd_xpm; | 2790 break; |
2789 case UC_ERROR: | 2791 case UC_CHAT: |
2790 return available_error_xpm; | 2792 *se = "chat"; |
2791 default: | 2793 break; |
2792 return available_xpm; | 2794 case UC_XA: |
2793 } | 2795 *se = "extendedaway"; |
2794 }*/ | 2796 break; |
2797 case UC_DND: | |
2798 *se = "dnd"; | |
2799 break; | |
2800 case UC_ERROR: | |
2801 *se = "error"; | |
2802 break; | |
2803 } | |
2804 } | |
2805 } | |
2795 | 2806 |
2796 static GList *jabber_chat_info(struct gaim_connection *gc) | 2807 static GList *jabber_chat_info(struct gaim_connection *gc) |
2797 { | 2808 { |
2798 gjconn gjc = ((struct jabber_data *)gc->proto_data)->gjc; | 2809 gjconn gjc = ((struct jabber_data *)gc->proto_data)->gjc; |
2799 | 2810 |
3282 pbm->callback = jabber_visible_to_buddy; | 3293 pbm->callback = jabber_visible_to_buddy; |
3283 } else { | 3294 } else { |
3284 pbm->label = _("Temporarily Hide From"); | 3295 pbm->label = _("Temporarily Hide From"); |
3285 pbm->callback = jabber_invisible_to_buddy; | 3296 pbm->callback = jabber_invisible_to_buddy; |
3286 } | 3297 } |
3298 | |
3287 pbm->gc = gc; | 3299 pbm->gc = gc; |
3288 m = g_list_append(m, pbm); | 3300 m = g_list_append(m, pbm); |
3289 } | 3301 pbm = g_new0(struct proto_buddy_menu, 1); |
3290 | 3302 pbm->label = _("Cancel Presence Notification"); |
3291 return m; | 3303 pbm->callback = jabber_unsubscribe_buddy_from_us; |
3292 } | 3304 pbm->gc = gc; |
3293 | 3305 m = g_list_append(m, pbm); |
3294 /* | 3306 } |
3295 * Jabber protocol-specific "edit buddy menu" item(s) | |
3296 */ | |
3297 static GList *jabber_edit_buddy_menu(struct gaim_connection *gc, char *who) { | |
3298 GList *m = NULL; | |
3299 struct proto_buddy_menu *pbm; | |
3300 | |
3301 pbm = g_new0(struct proto_buddy_menu, 1); | |
3302 pbm->label = _("Get Info"); | |
3303 pbm->callback = jabber_get_info; | |
3304 pbm->gc = gc; | |
3305 m = g_list_append(m, pbm); | |
3306 pbm = g_new0(struct proto_buddy_menu, 1); | |
3307 pbm->label = _("Remove From Roster"); | |
3308 pbm->callback = jabber_remove_buddy_roster_item; | |
3309 pbm->gc = gc; | |
3310 m = g_list_append(m, pbm); | |
3311 pbm = g_new0(struct proto_buddy_menu, 1); | |
3312 pbm->label = _("Cancel Presence Notification"); | |
3313 pbm->callback = jabber_unsubscribe_buddy_from_us; | |
3314 pbm->gc = gc; | |
3315 m = g_list_append(m, pbm); | |
3316 | 3307 |
3317 return m; | 3308 return m; |
3318 } | 3309 } |
3319 | 3310 |
3320 static GList *jabber_away_states(struct gaim_connection *gc) { | 3311 static GList *jabber_away_states(struct gaim_connection *gc) { |
4217 struct proto_user_opt *puo; | 4208 struct proto_user_opt *puo; |
4218 ret->protocol = PROTO_JABBER; | 4209 ret->protocol = PROTO_JABBER; |
4219 ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC; | 4210 ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC; |
4220 ret->name = g_strdup("Jabber"); | 4211 ret->name = g_strdup("Jabber"); |
4221 ret->list_icon = jabber_list_icon; | 4212 ret->list_icon = jabber_list_icon; |
4213 ret->list_emblems = jabber_list_emblems; | |
4222 ret->status_text = jabber_status_text; | 4214 ret->status_text = jabber_status_text; |
4223 ret->tooltip_text = jabber_tooltip_text; | 4215 ret->tooltip_text = jabber_tooltip_text; |
4224 ret->away_states = jabber_away_states; | 4216 ret->away_states = jabber_away_states; |
4225 ret->actions = jabber_actions; | 4217 ret->actions = jabber_actions; |
4226 ret->buddy_menu = jabber_buddy_menu; | 4218 ret->buddy_menu = jabber_buddy_menu; |
4227 ret->edit_buddy_menu = jabber_edit_buddy_menu; | |
4228 ret->login = jabber_login; | 4219 ret->login = jabber_login; |
4229 ret->close = jabber_close; | 4220 ret->close = jabber_close; |
4230 ret->send_im = jabber_send_im; | 4221 ret->send_im = jabber_send_im; |
4231 ret->set_info = jabber_set_info; | 4222 ret->set_info = jabber_set_info; |
4232 ret->get_info = jabber_get_info; | 4223 ret->get_info = jabber_get_info; |