Update of /cvsroot/gaim/gaim/src/protocols/oscar
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10111
Modified Files:
locate.c oscar.c
Log Message:
A few oscar fixes:
* Show the available message in the buddy info box
* ICQ accounts can view available messages
* AIM accounts can view the DND/extended away/occupied statuses of
ICQ buddies
Index: locate.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/locate.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -p -r1.44 -r1.45
--- locate.c 21 Dec 2005 18:36:18 -0000 1.44
+++ locate.c 23 Jan 2006 04:09:55 -0000 1.45
@@ -255,6 +255,21 @@ static void aim_locate_adduserinfo(aim_s
cur->info_len = userinfo->info_len;
}
+ if (userinfo->status != NULL) {
+ free(cur->status);
+ free(cur->status_encoding);
+ if (userinfo->status_len > 0) {
+ cur->status = (char *)malloc(userinfo->status_len);
+ memcpy(cur->status, userinfo->status, userinfo->status_len);
+ } else
+ cur->status = NULL;
+ if (userinfo->status_encoding != NULL)
+ cur->status_encoding = strdup(userinfo->status_encoding);
+ else
+ cur->status_encoding = NULL;
+ cur->status_len = userinfo->status_len;
+ }
+
if (userinfo->away != NULL) {
free(cur->away);
free(cur->away_encoding);
@@ -757,7 +772,7 @@ faim_internal int aim_info_extract(aim_s
aim_bstream_advance(bs, length2);
} break;
- case 0x0002: { /* An status/available message */
+ case 0x0002: { /* A status/available message */
free(outinfo->status);
free(outinfo->status_encoding);
if (length2 >= 4) {
Index: oscar.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v
retrieving revision 1.861
retrieving revision 1.862
diff -u -d -p -r1.861 -r1.862
--- oscar.c 20 Jan 2006 20:35:17 -0000 1.861
+++ oscar.c 23 Jan 2006 04:09:56 -0000 1.862
@@ -5178,11 +5178,19 @@ static int gaim_parse_userinfo(aim_sessi
oscar_string_append_info(gc, str, "\n<br>", NULL, userinfo);
- /*
- * TODO: Need to duplicate what oscar_tooltip_text() does here so that
- * we show the available message in the buddy info.
- */
+ /* Available message */
+ // QQQQQQQQQQ
+printf(" userinfo->status=%s\n", userinfo->status);
+ if ((userinfo->status != NULL) && !(userinfo->flags & AIM_FLAG_AWAY))
+ {
+ if (userinfo->status[0] != '\0')
+ tmp = oscar_encoding_to_utf8(userinfo->status_encoding,
+ userinfo->status, userinfo->status_len);
+ oscar_string_append(gc->account, str, "\n<br>", _("Available Message"), tmp);
+ g_free(tmp);
+ }
+ /* Away message */
if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) {
tmp = oscar_encoding_extract(userinfo->away_encoding);
away_utf8 = oscar_encoding_to_utf8(tmp, userinfo->away, userinfo->away_len);
@@ -5193,6 +5201,7 @@ static int gaim_parse_userinfo(aim_sessi
}
}
+ /* Info */
if ((userinfo->info_len > 0) && (userinfo->info != NULL) && (userinfo->info_encoding != NULL)) {
tmp = oscar_encoding_extract(userinfo->info_encoding);
info_utf8 = oscar_encoding_to_utf8(tmp, userinfo->info, userinfo->info_len);
@@ -7957,31 +7966,22 @@ oscar_status_types(GaimAccount *account)
g_return_val_if_fail(account != NULL, NULL);
+ /* Used to flag some statuses as "user settable" or not */
is_icq = aim_sn_is_icq(gaim_account_get_username(account));
- /* Oscar-common status types */
- if (is_icq)
- {
- type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE,
- OSCAR_STATUS_ID_AVAILABLE,
- NULL, TRUE, TRUE, FALSE);
- status_types = g_list_append(status_types, type);
-
- type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE,
- OSCAR_STATUS_ID_FREE4CHAT,
- _("Free For Chat"), TRUE, TRUE, FALSE);
- status_types = g_list_append(status_types, type);
- }
- else
- {
- type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE,
- OSCAR_STATUS_ID_AVAILABLE,
- NULL, TRUE, TRUE, FALSE,
- "message", _("Message"),
- gaim_value_new(GAIM_TYPE_STRING), NULL);
- status_types = g_list_append(status_types, type);
- }
+ /* Common status types */
+ /* Really the available message should only be settable for AIM accounts */
+ type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE,
+ OSCAR_STATUS_ID_AVAILABLE,
+ NULL, TRUE, TRUE, FALSE,
+ "message", _("Message"),
+ gaim_value_new(GAIM_TYPE_STRING), NULL);
+ status_types = g_list_append(status_types, type);
+ type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE,
+ OSCAR_STATUS_ID_FREE4CHAT,
+ _("Free For Chat"), TRUE, is_icq, FALSE);
+ status_types = g_list_append(status_types, type);
type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY,
OSCAR_STATUS_ID_AWAY,
@@ -7996,23 +7996,20 @@ oscar_status_types(GaimAccount *account)
status_types = g_list_append(status_types, type);
/* ICQ-specific status types */
- if (is_icq)
- {
- type = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE,
- OSCAR_STATUS_ID_OCCUPIED,
- _("Occupied"), TRUE, TRUE, FALSE);
- status_types = g_list_append(status_types, type);
+ type = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE,
+ OSCAR_STATUS_ID_OCCUPIED,
+ _("Occupied"), TRUE, is_icq, FALSE);
+ status_types = g_list_append(status_types, type);
- type = gaim_status_type_new_full(GAIM_STATUS_EXTENDED_AWAY,
- OSCAR_STATUS_ID_DND,
- _("Do Not Disturb"), TRUE, TRUE, FALSE);
- status_types = g_list_append(status_types, type);
+ type = gaim_status_type_new_full(GAIM_STATUS_EXTENDED_AWAY,
+ OSCAR_STATUS_ID_DND,
+ _("Do Not Disturb"), TRUE, is_icq, FALSE);
+ status_types = g_list_append(status_types, type);
- type = gaim_status_type_new_full(GAIM_STATUS_EXTENDED_AWAY,
- OSCAR_STATUS_ID_NA,
- _("Not Available"), TRUE, TRUE, FALSE);
- status_types = g_list_append(status_types, type);
- }
+ type = gaim_status_type_new_full(GAIM_STATUS_EXTENDED_AWAY,
+ OSCAR_STATUS_ID_NA,
+ _("Not Available"), TRUE, is_icq, FALSE);
+ status_types = g_list_append(status_types, type);
type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE,
OSCAR_STATUS_ID_OFFLINE,
|