comparison src/protocols/oscar/oscar.c @ 12595:3169cd6727ad

[gaim-migrate @ 14925] I've been meaning to spend the time to commit these changes separately, but it's been a couple days without me finding the time... 1. Allow the creation of GaimStatusTypes by passing NULL for the name and/or id. The core uses the default name and/or id. This eliminates quite a bit of duplication in the prpls. 2. Make statuses more consistent. For example, in some prpls, "Busy" was descended from the UNAVAILABLE primitive and on others it was a case of AWAY. Another example... "On Vacation" is definitely an EXTENDED_AWAY not an AWAY. 3. Rename some pixmaps to elminate some special cases. The names of the pixmaps should now match the primitive default IDs. 4. Rename the HIDDEN primitive to INVISIBLE, since we seem to be using that term everywhere. In conjunction with #1, more duplication was eliminated. 5. Add a MOBILE status primitive. It's not used now. It'll be needed in the (hopefully not-too-distant) future, so I'm planning ahead. 6. Shrink the status select for small blist folks. Now if someone can get rid of that stupid extra padding, we'll be set (well, after we deal with imhtml space issues). I've fought with this for many many hours over several days and I can't get it. It's clear that the combo box is requesting more space than is really necessary, but I don't know why. This is really my first go at anything significant status-related. Everyone should check their favorite prpls carefully to make sure I didn't break anything. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 21 Dec 2005 08:24:17 +0000
parents cce0e97b36c2
children e856f985a0b9
comparison
equal deleted inserted replaced
12594:3d34460ecfd6 12595:3169cd6727ad
6525 gboolean invisible; 6525 gboolean invisible;
6526 6526
6527 od = gc->proto_data; 6527 od = gc->proto_data;
6528 account = gaim_connection_get_account(gc); 6528 account = gaim_connection_get_account(gc);
6529 presence = gaim_account_get_presence(account); 6529 presence = gaim_account_get_presence(account);
6530 invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_HIDDEN); 6530 invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE);
6531 6531
6532 if (invisible) 6532 if (invisible)
6533 aim_setextstatus(od->sess, AIM_ICQ_STATE_INVISIBLE); 6533 aim_setextstatus(od->sess, AIM_ICQ_STATE_INVISIBLE);
6534 else if (!gaim_presence_is_available(presence)) 6534 else if (!gaim_presence_is_available(presence))
6535 aim_setextstatus(od->sess, AIM_ICQ_STATE_AWAY); 6535 aim_setextstatus(od->sess, AIM_ICQ_STATE_AWAY);
6559 gsize awaylen = 0; 6559 gsize awaylen = 0;
6560 6560
6561 status_type = gaim_status_get_type(status); 6561 status_type = gaim_status_get_type(status);
6562 primitive = gaim_status_type_get_primitive(status_type); 6562 primitive = gaim_status_type_get_primitive(status_type);
6563 presence = gaim_account_get_presence(account); 6563 presence = gaim_account_get_presence(account);
6564 invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_HIDDEN); 6564 invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE);
6565 6565
6566 if (!setinfo) 6566 if (!setinfo)
6567 { 6567 {
6568 /* Do nothing! */ 6568 /* Do nothing! */
6569 } 6569 }
6654 if (gc) 6654 if (gc)
6655 od = (OscarData *)gc->proto_data; 6655 od = (OscarData *)gc->proto_data;
6656 if (!od) 6656 if (!od)
6657 return; 6657 return;
6658 6658
6659 if (gaim_status_type_get_primitive(gaim_status_get_type(status)) == GAIM_STATUS_HIDDEN) 6659 if (gaim_status_type_get_primitive(gaim_status_get_type(status)) == GAIM_STATUS_INVISIBLE)
6660 account->perm_deny = GAIM_PRIVACY_ALLOW_USERS; 6660 account->perm_deny = GAIM_PRIVACY_ALLOW_USERS;
6661 else 6661 else
6662 account->perm_deny = GAIM_PRIVACY_DENY_USERS; 6662 account->perm_deny = GAIM_PRIVACY_DENY_USERS;
6663 6663
6664 if ((od->sess->ssi.received_data) && (aim_ssi_getpermdeny(od->sess->ssi.local) != account->perm_deny)) 6664 if ((od->sess->ssi.received_data) && (aim_ssi_getpermdeny(od->sess->ssi.local) != account->perm_deny))
7537 else if (!strcmp(status_id, OSCAR_STATUS_ID_FREE4CHAT)) 7537 else if (!strcmp(status_id, OSCAR_STATUS_ID_FREE4CHAT))
7538 emblems[i++] = "freeforchat"; 7538 emblems[i++] = "freeforchat";
7539 else if (!strcmp(status_id, OSCAR_STATUS_ID_DND)) 7539 else if (!strcmp(status_id, OSCAR_STATUS_ID_DND))
7540 emblems[i++] = "dnd"; 7540 emblems[i++] = "dnd";
7541 else if (!strcmp(status_id, OSCAR_STATUS_ID_NA)) 7541 else if (!strcmp(status_id, OSCAR_STATUS_ID_NA))
7542 emblems[i++] = "na"; 7542 emblems[i++] = "unavailable";
7543 else if (!strcmp(status_id, OSCAR_STATUS_ID_OCCUPIED)) 7543 else if (!strcmp(status_id, OSCAR_STATUS_ID_OCCUPIED))
7544 emblems[i++] = "occupied"; 7544 emblems[i++] = "occupied";
7545 else if (!strcmp(status_id, OSCAR_STATUS_ID_AWAY)) 7545 else if (!strcmp(status_id, OSCAR_STATUS_ID_AWAY))
7546 emblems[i++] = "away"; 7546 emblems[i++] = "away";
7547 } else if (!strcmp(status_id, OSCAR_STATUS_ID_AWAY)) { 7547 } else if (!strcmp(status_id, OSCAR_STATUS_ID_AWAY)) {
7817 g_return_val_if_fail(account != NULL, NULL); 7817 g_return_val_if_fail(account != NULL, NULL);
7818 7818
7819 /* Oscar-common status types */ 7819 /* Oscar-common status types */
7820 type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, 7820 type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE,
7821 OSCAR_STATUS_ID_OFFLINE, 7821 OSCAR_STATUS_ID_OFFLINE,
7822 _("Offline"), TRUE, TRUE, FALSE); 7822 NULL, TRUE, TRUE, FALSE);
7823 status_types = g_list_append(status_types, type); 7823 status_types = g_list_append(status_types, type);
7824 7824
7825 type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, 7825 type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE,
7826 OSCAR_STATUS_ID_AVAILABLE, 7826 OSCAR_STATUS_ID_AVAILABLE,
7827 _("Available"), TRUE, TRUE, FALSE, 7827 NULL, TRUE, TRUE, FALSE,
7828 "message", _("Message"), 7828 "message", _("Message"),
7829 gaim_value_new(GAIM_TYPE_STRING), NULL); 7829 gaim_value_new(GAIM_TYPE_STRING), NULL);
7830 status_types = g_list_append(status_types, type); 7830 status_types = g_list_append(status_types, type);
7831 7831
7832 type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, 7832 type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY,
7833 OSCAR_STATUS_ID_AWAY, 7833 OSCAR_STATUS_ID_AWAY,
7834 _("Away"), TRUE, TRUE, FALSE, 7834 NULL, TRUE, TRUE, FALSE,
7835 "message", _("Message"), 7835 "message", _("Message"),
7836 gaim_value_new(GAIM_TYPE_STRING), NULL); 7836 gaim_value_new(GAIM_TYPE_STRING), NULL);
7837 status_types = g_list_append(status_types, type); 7837 status_types = g_list_append(status_types, type);
7838 7838
7839 type = gaim_status_type_new_full(GAIM_STATUS_HIDDEN, 7839 type = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE,
7840 OSCAR_STATUS_ID_INVISIBLE, 7840 OSCAR_STATUS_ID_INVISIBLE,
7841 _("Invisible"), TRUE, TRUE, FALSE); 7841 NULL, TRUE, TRUE, FALSE);
7842 status_types = g_list_append(status_types, type); 7842 status_types = g_list_append(status_types, type);
7843 7843
7844 if (aim_sn_is_icq(gaim_account_get_username(account)) == FALSE ) 7844 if (aim_sn_is_icq(gaim_account_get_username(account)) == FALSE )
7845 return status_types; 7845 return status_types;
7846 7846