comparison src/protocols/oscar/oscar.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 ad589b887af9
children 8896e0894112
comparison
equal deleted inserted replaced
4915:0230df73f56a 4916:d9b6b5ae34e4
3013 3013
3014 static char *oscar_tooltip_text(struct buddy *b) { 3014 static char *oscar_tooltip_text(struct buddy *b) {
3015 struct gaim_connection *gc = b->account->gc; 3015 struct gaim_connection *gc = b->account->gc;
3016 struct oscar_data *od = gc->proto_data; 3016 struct oscar_data *od = gc->proto_data;
3017 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name)); 3017 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name));
3018 3018
3019 if (bi) { 3019 if (bi) {
3020 gchar *yay; 3020 gchar *yay;
3021 char *caps = caps_string(bi->caps); 3021 char *caps = caps_string(bi->caps);
3022 char *tstr = sec_to_text(time(NULL) - bi->signon + 3022 char *tstr = sec_to_text(time(NULL) - bi->signon +
3023 (gc->login_time_official ? gc->login_time_official - gc->login_time : 0)); 3023 (gc->login_time_official ? gc->login_time_official - gc->login_time : 0));
5145 static void oscar_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne) 5145 static void oscar_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
5146 { 5146 {
5147 char *emblems[4] = {NULL,NULL,NULL,NULL}; 5147 char *emblems[4] = {NULL,NULL,NULL,NULL};
5148 int i = 0; 5148 int i = 0;
5149 5149
5150 if (b->present == 0)
5151 emblems[i++] = "offline";
5152
5150 if (b->name && (b->uc & 0xffff0000) && isdigit(b->name[0])) { 5153 if (b->name && (b->uc & 0xffff0000) && isdigit(b->name[0])) {
5151 /* int uc = b->uc >> 16; 5154 /* int uc = b->uc >> 16;
5152 if (uc & AIM_ICQ_STATE_INVISIBLE) 5155 if (uc & AIM_ICQ_STATE_INVISIBLE)
5153 emblems[i++] = "icq_invisible"; 5156 emblems[i++] = "icq_invisible";
5154 else if (uc & AIM_ICQ_STATE_CHAT) 5157 else if (uc & AIM_ICQ_STATE_CHAT)
5543 pbm->callback = oscar_get_away_msg; 5546 pbm->callback = oscar_get_away_msg;
5544 pbm->gc = gc; 5547 pbm->gc = gc;
5545 m = g_list_append(m, pbm); 5548 m = g_list_append(m, pbm);
5546 } 5549 }
5547 5550
5548 if (aim_sncmp(gc->username, who)) { 5551 if ((aim_sncmp(gc->username, who)) && b->present) {
5549 pbm = g_new0(struct proto_buddy_menu, 1); 5552 pbm = g_new0(struct proto_buddy_menu, 1);
5550 pbm->label = _("Direct IM"); 5553 pbm->label = _("Direct IM");
5551 pbm->callback = oscar_ask_direct_im; 5554 pbm->callback = oscar_ask_direct_im;
5552 pbm->gc = gc; 5555 pbm->gc = gc;
5553 m = g_list_append(m, pbm); 5556 m = g_list_append(m, pbm);
5555 pbm = g_new0(struct proto_buddy_menu, 1); 5558 pbm = g_new0(struct proto_buddy_menu, 1);
5556 pbm->label = _("Send File"); 5559 pbm->label = _("Send File");
5557 pbm->callback = oscar_ask_sendfile; 5560 pbm->callback = oscar_ask_sendfile;
5558 pbm->gc = gc; 5561 pbm->gc = gc;
5559 m = g_list_append(m, pbm); 5562 m = g_list_append(m, pbm);
5560
5561 #if 0 5563 #if 0
5562 pbm = g_new0(struct proto_buddy_menu, 1); 5564 pbm = g_new0(struct proto_buddy_menu, 1);
5563 pbm->label = _("Get File"); 5565 pbm->label = _("Get File");
5564 pbm->callback = oscar_ask_getfile; 5566 pbm->callback = oscar_ask_getfile;
5565 pbm->gc = gc; 5567 pbm->gc = gc;
5566 m = g_list_append(m, pbm); 5568 m = g_list_append(m, pbm);
5567 #endif 5569 #endif
5568 } 5570 }
5569 } 5571
5570 5572 if (od->sess->ssi.received_data) {
5571 return m; 5573 char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, who);
5572 } 5574 if (gname && aim_ssi_waitingforauth(od->sess->ssi.local, gname, who)) {
5573 5575 pbm = g_new0(struct proto_buddy_menu, 1);
5574 static GList *oscar_edit_buddy_menu(struct gaim_connection *gc, char *who) 5576 pbm->label = _("Re-request Authorization");
5575 { 5577 pbm->callback = gaim_auth_sendrequest;
5576 struct oscar_data *od = gc->proto_data; 5578 pbm->gc = gc;
5577 GList *m = NULL; 5579 m = g_list_append(m, pbm);
5578 struct proto_buddy_menu *pbm; 5580 }
5579 5581 }
5580 if (od->icq) { 5582
5581 pbm = g_new0(struct proto_buddy_menu, 1); 5583 }
5582 pbm->label = _("Get Info"); 5584
5583 pbm->callback = oscar_get_info;
5584 pbm->gc = gc;
5585 m = g_list_append(m, pbm);
5586 }
5587
5588 if (od->sess->ssi.received_data) {
5589 char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, who);
5590 if (gname && aim_ssi_waitingforauth(od->sess->ssi.local, gname, who)) {
5591 pbm = g_new0(struct proto_buddy_menu, 1);
5592 pbm->label = _("Re-request Authorization");
5593 pbm->callback = gaim_auth_sendrequest;
5594 pbm->gc = gc;
5595 m = g_list_append(m, pbm);
5596 }
5597 }
5598
5599 return m; 5585 return m;
5600 } 5586 }
5601 5587
5602 static void oscar_format_screenname(struct gaim_connection *gc, char *nick) { 5588 static void oscar_format_screenname(struct gaim_connection *gc, char *nick) {
5603 struct oscar_data *od = gc->proto_data; 5589 struct oscar_data *od = gc->proto_data;
5901 ret->list_icon = oscar_list_icon; 5887 ret->list_icon = oscar_list_icon;
5902 ret->list_emblems = oscar_list_emblems; 5888 ret->list_emblems = oscar_list_emblems;
5903 ret->away_states = oscar_away_states; 5889 ret->away_states = oscar_away_states;
5904 ret->actions = oscar_actions; 5890 ret->actions = oscar_actions;
5905 ret->buddy_menu = oscar_buddy_menu; 5891 ret->buddy_menu = oscar_buddy_menu;
5906 ret->edit_buddy_menu = oscar_edit_buddy_menu;
5907 ret->login = oscar_login; 5892 ret->login = oscar_login;
5908 ret->close = oscar_close; 5893 ret->close = oscar_close;
5909 ret->send_im = oscar_send_im; 5894 ret->send_im = oscar_send_im;
5910 ret->send_typing = oscar_send_typing; 5895 ret->send_typing = oscar_send_typing;
5911 ret->set_info = oscar_set_info; 5896 ret->set_info = oscar_set_info;