From 754f0e6c526eae407785f76c57e62b55295bfcad Mon Sep 17 00:00:00 2001 From: John Bailey Date: Thu, 13 Nov 2008 17:04:53 +0000 Subject: This patch comes from the combined work of contributors minstrel, NightFox, bob007, salieff, and nops (these are their trac usernames). I have made some minor tweaks to the patch, but these shouldn't be a problem. This patch needs some TLC before we can merge it anywhere else; it adds API so it must hit im.pidgin.pidgin.next.minor before hitting im.pidgin.pidgin. Refs #4508. --- libpurple/protocols/oscar/family_buddy.c | 4 + libpurple/protocols/oscar/family_icbm.c | 245 ++++++++++++++++++++++++-- libpurple/protocols/oscar/family_locate.c | 284 +++++++++++++++++++++++++++++- libpurple/protocols/oscar/oscar.c | 258 +++++++++++++++++++++++++-- libpurple/protocols/oscar/oscar.h | 24 ++- libpurple/protocols/oscar/tlv.c | 9 +- libpurple/request.c | 45 +++++ libpurple/request.h | 42 +++++ pidgin/gtkrequest.c | 40 ++++- pidgin/pixmaps/Makefile.am | 37 +++- 10 files changed, 950 insertions(+), 38 deletions(-) diff --git a/libpurple/protocols/oscar/family_buddy.c b/libpurple/protocols/oscar/family_buddy.c index b20e0fc7f5..7ea559fb88 100644 --- a/libpurple/protocols/oscar/family_buddy.c +++ b/libpurple/protocols/oscar/family_buddy.c @@ -224,6 +224,10 @@ buddychange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *f if (snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING && userinfo.flags & AIM_FLAG_AWAY) aim_locate_autofetch_away_message(od, userinfo.sn); + if (snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING && + userinfo.capabilities & OSCAR_CAPABILITY_XTRAZ && userinfo.customicon > 0) + icq_im_xstatus_request(od, userinfo.sn); + aim_info_free(&userinfo); return ret; diff --git a/libpurple/protocols/oscar/family_icbm.c b/libpurple/protocols/oscar/family_icbm.c index 3bab80dcbc..54096fdd03 100644 --- a/libpurple/protocols/oscar/family_icbm.c +++ b/libpurple/protocols/oscar/family_icbm.c @@ -2533,6 +2533,15 @@ static int clientautoresp(OscarData *od, FlapConnection *conn, aim_module_t *mod char *sn; guchar *cookie; guint8 snlen; + char *xml = NULL; + int hdrlen; + int curpos; + int num1,num2; + char *desc, *title, *temp; + PurpleAccount *account; + PurpleBuddy *buddy; + PurplePresence *presence; + PurpleStatus *status; cookie = byte_stream_getraw(bs, 8); channel = byte_stream_get16(bs); @@ -2540,16 +2549,56 @@ static int clientautoresp(OscarData *od, FlapConnection *conn, aim_module_t *mod sn = byte_stream_getstr(bs, snlen); reason = byte_stream_get16(bs); - if (channel == 0x0002) - { - if (reason == 0x0003) /* channel-specific */ - /* parse status note text */ - parse_status_note_text(od, cookie, sn, bs); - - byte_stream_get16(bs); /* Unknown */ - byte_stream_get16(bs); /* Unknown */ - if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) - ret = userfunc(od, conn, frame, channel, sn, reason, cookie); + if (channel == 0x0002) { + + hdrlen = byte_stream_getle16(bs); + if ( ((hdrlen == 27 ) && (bs->len > (27 + 51)))) { + byte_stream_advance(bs, 51); + num1 = byte_stream_getle16(bs); + num2 = byte_stream_getle16(bs); + purple_debug_misc("oscar", "X-Status: Num1 %i, num2 %i\n",num1, num2); + + if(((num1 == 0x4f00)&&(num2 == 0x3b00))) { + byte_stream_advance(bs, 86); + curpos = byte_stream_curpos(bs); + xml = byte_stream_getstr(bs, bs->len - curpos); + purple_debug_misc("oscar", "X-Status: Received XML reply\n"); + if(xml) { + /* purple_debug_misc("oscar", "X-Status: XML reply: %s\n", (const char*) xml); */ + if ((desc=strstr(xml,"<desc>")) != NULL) { + temp=strstr(xml,"</desc>"); + temp[0]=0; + desc=desc+12; + } + if ((title=strstr(xml,"<title>")) != NULL) { + temp=strstr(xml,"</title>"); + temp[0]=0; + title=title+13; + } else { + title=""; + } + strcpy(xml,title); + if (desc) { + strcat(xml, " - "); + strcat(xml, desc); + } + purple_debug_misc("oscar", "X-Status reply: %s\n", (const char*)xml); + account = purple_connection_get_account(od->gc); + buddy = purple_find_buddy(account, sn); + presence = purple_buddy_get_presence(buddy); + status = purple_presence_get_active_status(presence); + purple_prpl_got_user_status(account, sn, + purple_status_get_id(status), "message", xml, NULL); + } else { + purple_debug_misc("oscar", "X-Status: Can't get XML reply string\n"); + } + } else { + purple_debug_misc("oscar", "X-Status: 0x0004, 0x000b not an xstatus reply\n" ); + /* if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) + ret = userfunc(od, conn, frame, channel, sn, reason); */ + } + + } } else if (channel == 0x0004) { /* ICQ message */ switch (reason) { @@ -2608,6 +2657,7 @@ static int clientautoresp(OscarData *od, FlapConnection *conn, aim_module_t *mod g_free(cookie); g_free(sn); + if (xml) g_free(xml); return ret; } @@ -2720,6 +2770,181 @@ int aim_im_sendmtn(OscarData *od, guint16 type1, const char *sn, guint16 type2) return 0; } +/* + * Subtype 0x0006 - Send eXtra Status request + */ +int icq_im_xstatus_request(OscarData *od, const char *sn) +{ + FlapConnection *conn; + aim_snacid_t snacid; + guchar cookie[8]; + GSList *outer_tlvlist = NULL, *inner_tlvlist = NULL; + ByteStream bs, header, plugindata; + PurpleAccount *account; + const char *fmt; + char *statxml; + int xmllen; + + static const guint8 pluginid[] = + { + 0x09, 0x46, 0x13, 0x49, 0x4C, 0x7F, 0x11, 0xD1, + 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 + }; + + static const guint8 c_plugindata[] = + { + 0x1B, 0x00, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xD1, 0x0E, 0x00, 0xF9, 0xD1, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x00, 0x4F, 0x00, 0x3B, 0x60, 0xB3, 0xEF, 0xD8, 0x2A, 0x6C, 0x45, 0xA4, 0xE0, 0x9C, + 0x5A, 0x5E, 0x67, 0xE8, 0x65, 0x08, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x53, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x20, 0x50, 0x6C, 0x75, 0x67, 0x2D, 0x69, 0x6E, 0x3A, 0x20, 0x52, 0x65, 0x6D, 0x6F, 0x74, + 0x65, 0x20, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x41, + 0x72, 0x72, 0x69, 0x76, 0x65, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00 + }; + + if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + return -EINVAL; + + if (!sn) + return -EINVAL; + + fmt = "<Q><PluginID>srvMng</PluginID></Q><srv><id>cAwaySrv</id><req><id>AwayStat</id><trans>2</trans><senderId>%s</senderId></req></srv>\r\n"; + + account = purple_connection_get_account(od->gc); + xmllen = strlen(fmt) - 2 + strlen(account->username); + + statxml = (char*) g_malloc(xmllen); + snprintf(statxml, xmllen, fmt, account->username); + + aim_icbm_makecookie(cookie); + + byte_stream_new(&bs, 10 + 8 + 2 + 1 + strlen(sn) + 2 + + 2 + 2 + 8 + 16 + 2 + 2 + 2 + 2 + 2 + + 2 + 2 + sizeof(c_plugindata) + xmllen + + 2 + 2); + + snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + aim_im_puticbm(&bs, cookie, 0x0002, sn); + + byte_stream_new(&header, (7*2) + 16 + 8 + 2 + sizeof(c_plugindata) + xmllen); /* TLV 0x0005 Stream + Size */ + byte_stream_new(&plugindata, (sizeof(c_plugindata) + xmllen)); + + byte_stream_put16(&header, 0x0000); /* Message Type: Request */ + byte_stream_putraw(&header, cookie, sizeof(cookie)); /* Message ID */ + byte_stream_putraw(&header, pluginid, sizeof(pluginid)); /* Plugin ID */ + + aim_tlvlist_add_16(&inner_tlvlist, 0x000a, 0x0001); + aim_tlvlist_add_noval(&inner_tlvlist, 0x000f); + + /* Add Plugin Specific Data */ + byte_stream_putraw(&plugindata, c_plugindata, sizeof(c_plugindata)); /* Content of TLV 0x2711 */ + byte_stream_putstr(&plugindata, statxml); + + aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, (sizeof(c_plugindata) + xmllen), plugindata.data); + + aim_tlvlist_write(&header, &inner_tlvlist); + + + aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&header), header.data); + aim_tlvlist_add_noval(&outer_tlvlist, 0x0003); /* Empty TLV 0x0003 */ + + aim_tlvlist_write(&bs, &outer_tlvlist); + + purple_debug_misc("oscar", "X-Status Request\n"); + flap_connection_send_snac_with_priority(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs, TRUE); + + aim_tlvlist_free(inner_tlvlist); + aim_tlvlist_free(outer_tlvlist); + byte_stream_destroy(&header); + byte_stream_destroy(&plugindata); + byte_stream_destroy(&bs); + g_free(statxml); + + return 0; +} + +int icq_relay_xstatus(OscarData *od, const char *sn, const guchar *cookie) +{ + FlapConnection *conn; + ByteStream bs; + aim_snacid_t snacid; + PurpleAccount *account; + PurpleStatus *status; + const char *fmt; + const char *formatted_msg; + char *msg; + char *statxml; + const char *title; + int len; + + static const guint8 plugindata[] = { + 0x1B, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xD1, 0x0E, 0x00, 0xF9, 0xD1, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x4F, + 0x00, 0x3B, 0x60, 0xB3, 0xEF, 0xD8, 0x2A, 0x6C, 0x45, 0xA4, 0xE0, + 0x9C, 0x5A, 0x5E, 0x67, 0xE8, 0x65, 0x08, 0x00, 0x2A, 0x00, 0x00, + 0x00, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x50, 0x6C, 0x75, + 0x67, 0x2D, 0x69, 0x6E, 0x3A, 0x20, 0x52, 0x65, 0x6D, 0x6F, 0x74, + 0x65, 0x20, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6F, 0x6E, 0x20, 0x41, 0x72, 0x72, 0x69, 0x76, 0x65, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xF3, 0x01, 0x00, 0x00, 0xEF, 0x01, 0x00, 0x00 + }; + + fmt = "<ret event='OnRemoteNotification'><srv><id>cAwaySrv</id><val srv_id='cAwaySrv'><Root><CASXtraSetAwayMessage></CASXtraSetAwayMessage>&l t;uin>%s</uin><index>1</index><title>%s</title><desc>%s</desc></Root></val></srv><srv><id>cRandomizerSrv</id><val srv_id='cRandomizerSrv'>undefined</val></srv></ret>\r\n"; + + + if (!od || !(conn = flap_connection_findbygroup(od, 0x0002))) + return -EINVAL; + + if (!sn) + return -EINVAL; + + account = purple_connection_get_account(od->gc); + if(!account) return -EINVAL; + +/* if (!strcmp(account->username, sn)) + icq_im_xstatus_request(od, sn); */ + + status = purple_presence_get_active_status(account->presence); + if (!status) return -EINVAL; + title = purple_status_get_name(status); + if (!title) return -EINVAL; + formatted_msg = purple_status_get_attr_string(status, "message"); + if (!formatted_msg) return -EINVAL; + msg = purple_markup_strip_html(formatted_msg); + if (!msg) return -EINVAL; + len = strlen(fmt)-6+strlen(account->username)+strlen(title)+strlen(msg); + statxml = (char*) g_malloc(len); + + snprintf(statxml, len, fmt, + account->username, title, msg); + + purple_debug_misc("oscar", "X-Status AutoReply: %s, %s\n", formatted_msg, msg); + + byte_stream_new(&bs, 10 + 8 + 2 + 1 + strlen(sn) + 2 + sizeof(plugindata) + strlen(statxml)); /* 16 extra */ + + snacid = aim_cachesnac(od, 0x0004, 0x000b, 0x0000, NULL, 0); + aim_im_puticbm(&bs, cookie, 0x0002, sn); + byte_stream_put16(&bs, 0x0003); + byte_stream_putraw(&bs, plugindata, sizeof(plugindata)); + byte_stream_putraw(&bs, (const guint8*)statxml, strlen(statxml)); + + flap_connection_send_snac_with_priority(od, conn, 0x0004, 0x000b, 0x0000, snacid, &bs, TRUE); + + g_free(statxml); + g_free(msg); + byte_stream_destroy(&bs); + + return 0; +} + /* * Subtype 0x0014 - Receive a mini typing notification (mtn) packet. * diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index ae5408ff3d..61c2315e84 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -166,6 +166,16 @@ static const struct { {0x09, 0x46, 0x13, 0x4a, 0x4c, 0x7f, 0x11, 0xd1, 0x22, 0x82, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, + /* New format of caps (xtraz icons) */ + {OSCAR_CAPABILITY_NEWCAPS, + {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1, + 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, + + /* Support xtraz statuses */ + {OSCAR_CAPABILITY_XTRAZ, + {0x1a, 0x09, 0x3c, 0x6c, 0xd7, 0xFD, 0x4e, 0xc5, + 0x9d, 0x51, 0xa6, 0x47, 0x4e, 0x34, 0xf5, 0xa0}}, + {OSCAR_CAPABILITY_SENDBUDDYLIST, {0x09, 0x46, 0x13, 0x4b, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, @@ -242,6 +252,155 @@ static const struct { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, }; +#define AIM_CUSTOM_ICONS_COUNT 35 + +static const struct { + char *filename; + char *descriptivename; + guint8 data[16]; +} aim_custom_icons[AIM_CUSTOM_ICONS_COUNT] = { + /* empty X-Status for the case when customicon == 0 */ + {NULL, NULL, + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + + {"xstatus_thinking", "Thinking", + {0x3f, 0xb0, 0xbd, 0x36, 0xaf, 0x3b, 0x4a, 0x60, + 0x9e, 0xef, 0xcf, 0x19, 0x0f, 0x6a, 0x5a, 0x7f}}, + + {"xstatus_busy", "Busy", + {0x48, 0x8e, 0x14, 0x89, 0x8a, 0xca, 0x4a, 0x08, + 0x82, 0xaa, 0x77, 0xce, 0x7a, 0x16, 0x52, 0x08}}, + + {"xstatus_shopping", "Shopping", + {0x63, 0x62, 0x73, 0x37, 0xa0, 0x3f, 0x49, 0xff, + 0x80, 0xe5, 0xf7, 0x09, 0xcd, 0xe0, 0xa4, 0xee}}, + + {"xstatus_typing", "Typing", + {0x63, 0x4f, 0x6b, 0xd8 ,0xad, 0xd2, 0x4a, 0xa1, + 0xaa, 0xb9, 0x11, 0x5b, 0xc2, 0x6d, 0x05, 0xa1}}, + + {"xstatus_question", "Question Mark", + {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, + 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64}}, + + {"xstatus_angry", "Angry", + {0x01, 0xd8, 0xd7, 0xee, 0xac, 0x3b, 0x49, 0x2a, + 0xa5, 0x8d, 0xd3, 0xd8, 0x77, 0xe6, 0x6b, 0x92}}, + + {"xstatus_eating", "Eating", + {0xf8, 0xe8, 0xd7, 0xb2, 0x82, 0xc4, 0x41, 0x42, + 0x90, 0xf8, 0x10, 0xc6, 0xce, 0x0a, 0x89, 0xa6}}, + + {"xstatus_cinema", "Cinema", + {0x10, 0x7a, 0x9a, 0x18, 0x12, 0x32, 0x4d, 0xa4, + 0xb6, 0xcd, 0x08, 0x79, 0xdb, 0x78, 0x0f, 0x09}}, + + {"xstatus_sick", "Sick", + {0x1f, 0x7a, 0x40, 0x71, 0xbf, 0x3b, 0x4e, 0x60, + 0xbc, 0x32, 0x4c, 0x57, 0x87, 0xb0, 0x4c, 0xf1}}, + + {"xstatus_crap", "Unknown 1", + {0x2c, 0xe0, 0xe4, 0xe5, 0x7c, 0x64, 0x43, 0x70, + 0x9c, 0x3a, 0x7a, 0x1c, 0xe8, 0x78, 0xa7, 0xdc}}, + + {"xstatus_iron", "Unknown 2", + {0xb7, 0x08, 0x67, 0xf5, 0x38, 0x25, 0x43, 0x27, + 0xa1, 0xff, 0xcf, 0x4c, 0xc1, 0x93, 0x97, 0x97}}, + + {"xstatus_bathing", "Bathing", + {0x5a, 0x58, 0x1e, 0xa1, 0xe5, 0x80, 0x43, 0x0c, + 0xa0, 0x6f, 0x61, 0x22, 0x98, 0xb7, 0xe4, 0xc7}}, + + {"xstatus_tv", "Watching TV", + {0x80, 0x53, 0x7d, 0xe2, 0xa4, 0x67, 0x4a, 0x76, + 0xb3, 0x54, 0x6d, 0xfd, 0x07, 0x5f, 0x5e, 0xc6}}, + + {"xstatus_fun", "Having fun", + {0x6f, 0x49, 0x30, 0x98, 0x4f, 0x7c, 0x4a, 0xff, + 0xa2, 0x76, 0x34, 0xa0, 0x3b, 0xce, 0xae, 0xa7}}, + + {"xstatus_sleeping", "Sleeping", + {0x78, 0x5e, 0x8c, 0x48, 0x40, 0xd3, 0x4c, 0x65, + 0x88, 0x6f, 0x04, 0xcf, 0x3f, 0x3f, 0x43, 0xdf}}, + + {"xstatus_pda", "PDA device", + {0x10, 0x11, 0x17, 0xc9, 0xa3, 0xb0, 0x40, 0xf9, + 0x81, 0xac, 0x49, 0xe1, 0x59, 0xfb, 0xd5, 0xd4}}, + + {"xstatus_heart", "In love", + {0xdd, 0xcf, 0x0e, 0xa9, 0x71, 0x95, 0x40, 0x48, + 0xa9, 0xc6, 0x41, 0x32, 0x06, 0xd6, 0xf2, 0x80}}, + + {"xstatus_tired", "Tired", + {0x83, 0xc9, 0xb7, 0x8e, 0x77, 0xe7, 0x43, 0x78, + 0xb2, 0xc5, 0xfb, 0x6c, 0xfc, 0xc3, 0x5b, 0xec}}, + + {"xstatus_friends", "Friends", + {0xf1, 0x8a, 0xb5, 0x2e, 0xdc, 0x57, 0x49, 0x1d, + 0x99, 0xdc, 0x64, 0x44, 0x50, 0x24, 0x57, 0xaf}}, + + {"xstatus_phone", "On the phone", + {0x12, 0x92, 0xe5, 0x50, 0x1b, 0x64, 0x4f, 0x66, + 0xb2, 0x06, 0xb2, 0x9a, 0xf3, 0x78, 0xe4, 0x8d}}, + + {"xstatus_surfing", "Surfing", + {0xa6, 0xed, 0x55, 0x7e, 0x6b, 0xf7, 0x44, 0xd4, + 0xa5, 0xd4, 0xd2, 0xe7, 0xd9, 0x5c, 0xe8, 0x1f}}, + + {"xstatus_mobile", "Cell phone", + {0x16, 0x0c, 0x60, 0xbb, 0xdd, 0x44, 0x43, 0xf3, + 0x91, 0x40, 0x05, 0x0f, 0x00, 0xe6, 0xc0, 0x09}}, + + {"xstatus_google", "Googling", + {0xd4, 0xe2, 0xb0, 0xba, 0x33, 0x4e, 0x4f, 0xa5, + 0x98, 0xd0, 0x11, 0x7d, 0xbf, 0x4d, 0x3c, 0xc8}}, + + {"xstatus_party", "Party", + {0xe6, 0x01, 0xe4, 0x1c, 0x33, 0x73, 0x4b, 0xd1, + 0xbc, 0x06, 0x81, 0x1d, 0x6c, 0x32, 0x3d, 0x81}}, + + {"xstatus_coffee", "Coffee", + {0x1b, 0x78, 0xae, 0x31, 0xfa, 0x0b, 0x4d, 0x38, + 0x93, 0xd1, 0x99, 0x7e, 0xee, 0xaf, 0xb2, 0x18}}, + + {"xstatus_gaming", "Playing", + {0xd4, 0xa6, 0x11, 0xd0, 0x8f, 0x01, 0x4e, 0xc0, + 0x92, 0x23, 0xc5, 0xb6, 0xbe, 0xc6, 0xcc, 0xf0}}, + + {"xstatus_internet", "Internet", + {0x12, 0xd0, 0x7e, 0x3e, 0xf8, 0x85, 0x48, 0x9e, + 0x8e, 0x97, 0xa7, 0x2a, 0x65, 0x51, 0xe5, 0x8d}}, + + {"xstatus_zzz", "Snoozing", + {0x64, 0x43, 0xc6, 0xaf, 0x22, 0x60, 0x45, 0x17, + 0xb5, 0x8c, 0xd7, 0xdf, 0x8e, 0x29, 0x03, 0x52}}, + + {"xstatus_writing", "Writing", + {0x00, 0x72, 0xd9, 0x08, 0x4a, 0xd1, 0x43, 0xdd, + 0x91, 0x99, 0x6f, 0x02, 0x69, 0x66, 0x02, 0x6f}}, + + {"xstatus_beer", "Drinking", + {0x8c, 0x50, 0xdb, 0xae, 0x81, 0xed, 0x47, 0x86, + 0xac, 0xca, 0x16, 0xcc, 0x32, 0x13, 0xc7, 0xb7}}, + + {"xstatus_music", "Music", + {0x61, 0xbe, 0xe0, 0xdd, 0x8b, 0xdd, 0x47, 0x5d, + 0x8d, 0xee, 0x5f, 0x4b, 0xaa, 0xcf, 0x19, 0xa7}}, + + {"xstatus_studying", "Studying", + {0x60, 0x9d, 0x52, 0xf8, 0xa2, 0x9a, 0x49, 0xa6, + 0xb2, 0xa0, 0x25, 0x24, 0xc5, 0xe9, 0xd2, 0x60}}, + + {"xstatus_engineering", "Engineering", + {0xba, 0x74, 0xdb, 0x3e, 0x9e, 0x24, 0x43, 0x4b, + 0x87, 0xb6, 0x2f, 0x6b, 0x8d, 0xfe, 0xe5, 0x0f}}, + + {"xstatus_crapping", "In the restroom", + {0x16, 0xf5, 0xb7, 0x6f, 0xa9, 0xd2, 0x40, 0x35, + 0x8c, 0xc5, 0xc0, 0x84, 0x70, 0x3c, 0x98, 0xfa}} +}; + /* * Add the userinfo to our linked list. If we already have userinfo * for this buddy, then just overwrite parts of the old data. @@ -278,6 +437,9 @@ aim_locate_adduserinfo(OscarData *od, aim_userinfo_t *userinfo) cur->sessionlen = userinfo->sessionlen; if (userinfo->capabilities != 0) cur->capabilities = userinfo->capabilities; + if (userinfo->customicon != 0) + cur->customicon = userinfo->customicon; + cur->present |= userinfo->present; if (userinfo->iconcsumlen > 0) { @@ -469,13 +631,38 @@ aim_locate_getcaps(OscarData *od, ByteStream *bs, int len) cap[8], cap[9], cap[10], cap[11], cap[12], cap[13], cap[14], cap[15]); - g_free(cap); } return flags; } +gint32 +aim_get_custom_icon(OscarData *od, ByteStream *bs, int len) +{ + int offset; + gint32 result = -1; + + for (offset = 0; byte_stream_empty(bs) && (offset < len); offset += 0x10) { + /* check wheather this capability is a custom user icon */ + guint8 *cap; + int i; + + cap = byte_stream_getraw(bs, 0x10); + + for (i = 1; i < AIM_CUSTOM_ICONS_COUNT; i++) { + if (memcmp(&aim_custom_icons[i].data, cap, 0x10) == 0) { + purple_debug_misc("oscar", "Custom user icon: %s\n", aim_custom_icons[i].descriptivename); + result = i; + break; /* should only match once... */ + } + } + g_free(cap); + } + + return result; +} + guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len) { @@ -566,6 +753,37 @@ aim_info_free(aim_userinfo_t *info) g_free(info->away_encoding); } +#define ICQMOODS_COUNT 23 + +static const struct { + char *mood; + gint32 icon_num; +} icqmoods[ICQMOODS_COUNT] = { + {"icqmood1", 12}, + {"icqmood2", 18}, + {"icqmood3", 24}, + {"icqmood4", 30}, + {"icqmood5", 1}, + {"icqmood6", 7}, + {"icqmood7", 13}, + {"icqmood8", 19}, + {"icqmood9", 25}, + {"icqmood10", 31}, + {"icqmood11", 11}, + {"icqmood12", 8}, + {"icqmood13", 14}, + {"icqmood14", 20}, + {"icqmood15", 26}, + {"icqmood16", 32}, + {"icqmood17", 9}, + {"icqmood18", 15}, + {"icqmood19", 21}, + {"icqmood20", 27}, + {"icqmood21", 33}, + {"icqmood22", 10}, + {"icqmood23", 6}, +}; + /* * AIM is fairly regular about providing user info. This is a generic * routine to extract it in its standard form. @@ -606,11 +824,12 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) for (curtlv = 0; curtlv < tlvcnt; curtlv++) { guint16 type, length; int endpos; + int curpos; type = byte_stream_get16(bs); length = byte_stream_get16(bs); - - endpos = byte_stream_curpos(bs) + MIN(length, byte_stream_empty(bs)); + curpos = byte_stream_curpos(bs); + endpos = curpos + MIN(length, byte_stream_empty(bs)); if (type == 0x0001) { /* @@ -725,6 +944,8 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) */ outinfo->capabilities |= aim_locate_getcaps(od, bs, length); outinfo->present |= AIM_USERINFO_PRESENT_CAPABILITIES; + byte_stream_setpos(bs, curpos); + outinfo->customicon = aim_get_custom_icon(od, bs, length); } else if (type == 0x000e) { /* @@ -853,6 +1074,27 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) outinfo->itmsurl_encoding = NULL; } } break; + + case 0x000e: { /* ICQ mood */ + char *mood; + gint32 i; + gint32 icon_num = -1; + + mood = byte_stream_getstr(bs, length2); + + for (i = 0; i < ICQMOODS_COUNT; i++) + if (!strcmp(mood, icqmoods[i].mood)) { + icon_num = icqmoods[i].icon_num; + break; /* should only match once... */ + } + + if (icon_num >= 0) + outinfo->customicon = icon_num; + else + purple_debug_warning("oscar", "Unknown icqmood: %s", mood); + + g_free(mood); + } break; } /* Save ourselves. */ @@ -933,7 +1175,7 @@ aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info) #endif if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES) - aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities); + aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities, info->customicon); if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN) aim_tlvlist_add_32(&tlvlist, (guint16)((info->flags & AIM_FLAG_AOL) ? 0x0010 : 0x000f), info->sessionlen); @@ -1140,7 +1382,7 @@ aim_locate_setcaps(OscarData *od, guint32 caps) if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE))) return -EINVAL; - aim_tlvlist_add_caps(&tlvlist, 0x0005, caps); + aim_tlvlist_add_caps(&tlvlist, 0x0005, caps, purple_account_get_int(purple_connection_get_account(od->gc), "customicon", -1)); byte_stream_new(&bs, aim_tlvlist_size(tlvlist)); @@ -1226,6 +1468,8 @@ userinfo(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *fram ByteStream cbs; byte_stream_init(&cbs, tlv->value, tlv->length); userinfo->capabilities = aim_locate_getcaps(od, &cbs, tlv->length); + byte_stream_rewind(&cbs); + userinfo->customicon = aim_get_custom_icon(od, &cbs, tlv->length); userinfo->present = AIM_USERINFO_PRESENT_CAPABILITIES; } aim_tlvlist_free(tlvlist); @@ -1453,3 +1697,33 @@ locate_modfirst(OscarData *od, aim_module_t *mod) return 0; } + +guint32 +aim_get_custom_icons_count() +{ + return AIM_CUSTOM_ICONS_COUNT; +} + +char* +aim_get_custom_icon_filename(gint32 no) +{ + if (no >= AIM_CUSTOM_ICONS_COUNT || no < 1) + return NULL; + return aim_custom_icons[no].filename; +} + +char* +aim_get_custom_icon_descriptivename(gint32 no) +{ + if (no >= AIM_CUSTOM_ICONS_COUNT || no < 1) + return NULL; + return aim_custom_icons[no].descriptivename; +} + +guint8* +aim_get_custom_icon_data(gint32 no) +{ + if (no >= AIM_CUSTOM_ICONS_COUNT || no < 1) + return NULL; + return (guint8 *)aim_custom_icons[no].data; +} diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 27ebbcf919..2e35fd7d28 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -59,6 +59,11 @@ #define OSCAR_STATUS_ID_NA "na" #define OSCAR_STATUS_ID_OCCUPIED "occupied" #define OSCAR_STATUS_ID_FREE4CHAT "free4chat" +#define OSCAR_STATUS_ID_EVIL "evil" +#define OSCAR_STATUS_ID_DEPRESSION "depression" +#define OSCAR_STATUS_ID_ATHOME "athome" +#define OSCAR_STATUS_ID_ATWORK "atwork" +#define OSCAR_STATUS_ID_LUNCH "lunch" #define OSCAR_STATUS_ID_CUSTOM "custom" #define OSCAR_STATUS_ID_MOBILE "mobile" @@ -68,7 +73,7 @@ static OscarCapability purple_caps = (OSCAR_CAPABILITY_CHAT | OSCAR_CAPABILITY_BUDDYICON | OSCAR_CAPABILITY_DIRECTIM | OSCAR_CAPABILITY_SENDFILE | OSCAR_CAPABILITY_UNICODE | OSCAR_CAPABILITY_INTEROPERATE | - OSCAR_CAPABILITY_SHORTCAPS); + OSCAR_CAPABILITY_SHORTCAPS | OSCAR_CAPABILITY_ICQSERVERRELAY | OSCAR_CAPABILITY_NEWCAPS | OSCAR_CAPABILITY_XTRAZ); static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02}; static guint8 features_icq[] = {0x01, 0x06}; @@ -670,6 +675,9 @@ static gchar *oscar_caps_to_string(OscarCapability caps) case OSCAR_CAPABILITY_GAMES: case OSCAR_CAPABILITY_GAMES2: tmp = _("Games"); + case OSCAR_CAPABILITY_XTRAZ: + case OSCAR_CAPABILITY_NEWCAPS: + tmp = _("ICQ Xtraz"); break; case OSCAR_CAPABILITY_ADDINS: tmp = _("Add-Ins"); @@ -750,9 +758,17 @@ static char *oscar_icqstatus(int state) { return g_strdup_printf(_("Away")); else if (state & AIM_ICQ_STATE_WEBAWARE) return g_strdup_printf(_("Web Aware")); - else if (state & AIM_ICQ_STATE_INVISIBLE) - return g_strdup_printf(_("Invisible")); - else + else if (state & AIM_ICQ_STATE_EVIL) + return g_strdup_printf(_("Evil")); + else if (state & AIM_ICQ_STATE_DEPRESSION) + return g_strdup_printf(_("Depression")); + else if (state & AIM_ICQ_STATE_ATHOME) + return g_strdup_printf(_("At home")); + else if (state & AIM_ICQ_STATE_ATWORK) + return g_strdup_printf(_("At work")); + else if (state & AIM_ICQ_STATE_LUNCH) + return g_strdup_printf(_("At lunch")); + else return g_strdup_printf(_("Online")); } @@ -1992,6 +2008,16 @@ static int purple_parse_oncoming(OscarData *od, FlapConnection *conn, FlapFrame status_id = OSCAR_STATUS_ID_AWAY; else if (type & AIM_ICQ_STATE_INVISIBLE) status_id = OSCAR_STATUS_ID_INVISIBLE; + else if (type & AIM_ICQ_STATE_EVIL) + status_id = OSCAR_STATUS_ID_EVIL; + else if (type & AIM_ICQ_STATE_DEPRESSION) + status_id = OSCAR_STATUS_ID_DEPRESSION; + else if (type & AIM_ICQ_STATE_ATHOME) + status_id = OSCAR_STATUS_ID_ATHOME; + else if (type & AIM_ICQ_STATE_ATWORK) + status_id = OSCAR_STATUS_ID_ATWORK; + else if (type & AIM_ICQ_STATE_LUNCH) + status_id = OSCAR_STATUS_ID_LUNCH; else status_id = OSCAR_STATUS_ID_AVAILABLE; } else { @@ -2308,7 +2334,9 @@ incomingim_chan2(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, { PurpleConnection *gc; PurpleAccount *account; + PurpleMessageFlags flags = 0; char *message = NULL; + char *rtfmsg = NULL; g_return_val_if_fail(od != NULL, 0); g_return_val_if_fail(od->gc != NULL, 0); @@ -2338,6 +2366,21 @@ incomingim_chan2(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, } } + + if (args->info.rtfmsg.rtfmsg != NULL) + { + if (args->encoding != NULL) + { + char *encoding = NULL; + encoding = oscar_encoding_extract(args->encoding); + rtfmsg = oscar_encoding_to_utf8(account, encoding, args->info.rtfmsg.rtfmsg, + strlen(args->info.rtfmsg.rtfmsg)); + g_free(encoding); + } else { + if (g_utf8_validate(args->info.rtfmsg.rtfmsg, strlen(args->info.rtfmsg.rtfmsg), NULL)) + rtfmsg = g_strdup(args->info.rtfmsg.rtfmsg); + } + } if (args->type & OSCAR_CAPABILITY_CHAT) { char *encoding, *utf8name, *tmp; @@ -2425,6 +2468,21 @@ incomingim_chan2(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, { purple_debug_error("oscar", "Got an ICQ Server Relay message of " "type %d\n", args->info.rtfmsg.msgtype); + purple_debug_error("oscar", "Sending X-Status Reply\n"); + + if(args->info.rtfmsg.msgtype == 26) + icq_relay_xstatus(od, userinfo->sn, args->cookie); + + if(args->info.rtfmsg.msgtype == 1) + { + if(rtfmsg) + serv_got_im(gc, userinfo->sn, rtfmsg, flags, + time(NULL)); + else + serv_got_im(gc, userinfo->sn, args->info.rtfmsg.rtfmsg, flags, + time(NULL)); + + } } else @@ -2828,7 +2886,6 @@ static int purple_parse_incoming_im(OscarData *od, FlapConnection *conn, FlapFra args = va_arg(ap, struct aim_incomingim_ch4_args *); ret = incomingim_chan4(od, conn, userinfo, args, 0); } break; - default: { purple_debug_warning("oscar", "ICBM received on unsupported channel (channel " @@ -2976,6 +3033,28 @@ static int purple_parse_clientauto_ch4(OscarData *od, char *who, guint16 reason, } break; + case 0x0006: { /* Reply from an ICQ status message request */ + char *statusmsg, **splitmsg; + PurpleNotifyUserInfo *user_info; + + /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ + statusmsg = oscar_icqstatus(state); + splitmsg = g_strsplit(msg, "\r\n", 0); + + user_info = purple_notify_user_info_new(); + + purple_notify_user_info_add_pair(user_info, _("UIN"), who); + purple_notify_user_info_add_pair(user_info, _("Status"), statusmsg); + purple_notify_user_info_add_section_break(user_info); + purple_notify_user_info_add_pair(user_info, NULL, g_strjoinv("
", splitmsg)); + + g_free(statusmsg); + g_strfreev(splitmsg); + + purple_notify_userinfo(gc, who, user_info, NULL, NULL); + purple_notify_user_info_destroy(user_info); + + } break; default: { purple_debug_warning("oscar", "Received an unknown client auto-response from %s. " @@ -4629,10 +4708,22 @@ oscar_set_extendedstatus(PurpleConnection *gc) data |= AIM_ICQ_STATE_CHAT; else if (!strcmp(status_id, OSCAR_STATUS_ID_INVISIBLE)) data |= AIM_ICQ_STATE_INVISIBLE; + else if (!strcmp(status_id, OSCAR_STATUS_ID_EVIL)) + data |= AIM_ICQ_STATE_EVIL; + else if (!strcmp(status_id, OSCAR_STATUS_ID_DEPRESSION)) + data |= AIM_ICQ_STATE_DEPRESSION; + else if (!strcmp(status_id, OSCAR_STATUS_ID_ATWORK)) + data |= AIM_ICQ_STATE_ATWORK; + else if (!strcmp(status_id, OSCAR_STATUS_ID_ATHOME)) + data |= AIM_ICQ_STATE_ATHOME; + else if (!strcmp(status_id, OSCAR_STATUS_ID_LUNCH)) + data |= AIM_ICQ_STATE_LUNCH; else if (!strcmp(status_id, OSCAR_STATUS_ID_CUSTOM)) data |= AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY; + aim_srv_setextrainfo(od, TRUE, data, FALSE, NULL, NULL); + } static void @@ -5777,6 +5868,7 @@ const char *oscar_list_emblem(PurpleBuddy *b) return "secure"; if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) return "birthday"; + return aim_get_custom_icon_filename(userinfo->customicon); } return NULL; } @@ -5998,9 +6090,53 @@ oscar_status_types(PurpleAccount *account) purple_value_new(PURPLE_TYPE_STRING), NULL); status_types = g_list_prepend(status_types, type); - type = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, OSCAR_STATUS_ID_FREE4CHAT, - _("Free For Chat"), TRUE, is_icq, FALSE); + _("Free For Chat"), TRUE, is_icq, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + + status_types = g_list_prepend(status_types, type); + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, + OSCAR_STATUS_ID_EVIL, + _("Evil"), TRUE, is_icq, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + status_types = g_list_prepend(status_types, type); + + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, + OSCAR_STATUS_ID_DEPRESSION, + _("Depression"), TRUE, is_icq, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + status_types = g_list_prepend(status_types, type); + + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, + OSCAR_STATUS_ID_ATHOME, + _("At home"), TRUE, is_icq, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + status_types = g_list_prepend(status_types, type); + + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, + OSCAR_STATUS_ID_ATWORK, + _("At work"), TRUE, is_icq, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + + status_types = g_list_prepend(status_types, type); + + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, + OSCAR_STATUS_ID_LUNCH, + _("Lunch"), TRUE, is_icq, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + status_types = g_list_prepend(status_types, type); type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, @@ -6010,9 +6146,12 @@ oscar_status_types(PurpleAccount *account) purple_value_new(PURPLE_TYPE_STRING), NULL); status_types = g_list_prepend(status_types, type); - type = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, + type = purple_status_type_new_with_attrs(PURPLE_STATUS_INVISIBLE, OSCAR_STATUS_ID_INVISIBLE, - NULL, TRUE, TRUE, FALSE); + NULL, TRUE, TRUE, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); + status_types = g_list_prepend(status_types, type); type = purple_status_type_new_full(PURPLE_STATUS_MOBILE, OSCAR_STATUS_ID_MOBILE, NULL, FALSE, FALSE, TRUE); @@ -6180,6 +6319,23 @@ oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore) aim_locate_getinfoshort(gc->proto_data, purple_buddy_get_name(buddy), 0x00000003); } +static void oscar_get_icqxstatusmsg (PurpleBlistNode *node, gpointer ignore) +{ + PurpleBuddy *buddy; + PurpleConnection *gc; + PurpleAccount *account; + + + g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); + + buddy = (PurpleBuddy *)node; + gc = purple_account_get_connection(buddy->account); + account = purple_connection_get_account(gc); + purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", purple_buddy_get_name(buddy), account->username); + + icq_im_xstatus_request(gc->proto_data, purple_buddy_get_name(buddy)); +} + static GList * oscar_buddy_menu(PurpleBuddy *buddy) { @@ -6207,15 +6363,14 @@ oscar_buddy_menu(PurpleBuddy *buddy) { NULL, NULL); menu = g_list_prepend(menu, act); -#if 0 if (od->icq) { - act = purple_menu_action_new(_("Get Status Msg"), - PURPLE_CALLBACK(oscar_get_icqstatusmsg), + act = purple_menu_action_new(_("Get X-Status Msg"), + PURPLE_CALLBACK(oscar_get_icqxstatusmsg), NULL, NULL); menu = g_list_prepend(menu, act); } -#endif + if (userinfo && aim_sncmp(purple_account_get_username(buddy->account), buddy->name) && @@ -6599,6 +6754,79 @@ oscar_send_file(PurpleConnection *gc, const char *who, const char *file) purple_xfer_request(xfer); } +static void +oscar_show_icq_custom_icons_cb(PurpleConnection *gc, PurpleRequestFields *fields) { + OscarData *od = gc->proto_data; + PurpleAccount *account = purple_connection_get_account(gc); + PurpleRequestField *f; + GList *l; + + f = purple_request_fields_get_field(fields, "customicon"); + l = purple_request_field_list_get_selected(f); + + if (l) { + gpointer d = purple_request_field_list_get_data(f, l->data); + purple_account_set_int(account, "customicon", GPOINTER_TO_INT(d)); + } + + aim_locate_setcaps(od, purple_caps); +} + +static void +oscar_show_icq_custom_icons(PurplePluginAction *action) +{ + guint32 i; + gint32 customicon; + PurpleConnection *gc = (PurpleConnection *) action->context; + PurpleAccount *account = purple_connection_get_account(gc); + PurpleRequestFields *fields; + PurpleRequestFieldGroup *g; + PurpleRequestField *f; + char* na_fn; + + customicon = purple_account_get_int(account, "customicon", 0); + + fields = purple_request_fields_new(); + + g = purple_request_field_group_new(NULL); + + f = purple_request_field_list_new("customicon", _("XStatus")); + + purple_request_field_list_set_pixbuf(f, TRUE); + + na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); + + purple_request_field_list_add_icon(f, _("None"), na_fn, GINT_TO_POINTER(-1)); + if (customicon == 0) + purple_request_field_list_add_selected(f, _("None")); + + g_free(na_fn); + + for (i = 1; i < aim_get_custom_icons_count(); i++) { + char* icon_path = g_strdup_printf("%s.png", aim_get_custom_icon_filename(i)); + char* filename = g_build_filename("pixmaps", "pidgin", "emblems", "16", icon_path, NULL); + + purple_request_field_list_add_icon(f, _(aim_get_custom_icon_descriptivename(i)), filename, GINT_TO_POINTER(i)); + + if (customicon == i) + purple_request_field_list_add_selected(f, _(aim_get_custom_icon_descriptivename(i))); + + g_free(filename); + g_free(icon_path); + } + purple_request_field_group_add_field(g, f); + + purple_request_fields_add_group(fields, g); + + purple_request_fields(gc, _("Set Custom Icon"), _("Set Custom Icon"), + NULL, fields, + _("OK"), G_CALLBACK(oscar_show_icq_custom_icons_cb), + _("Cancel"), NULL, + purple_connection_get_account(gc), NULL, NULL, + gc); +} + + GList * oscar_actions(PurplePlugin *plugin, gpointer context) { @@ -6641,6 +6869,10 @@ oscar_actions(PurplePlugin *plugin, gpointer context) act = purple_plugin_action_new(_("Set Privacy Options..."), oscar_show_icq_privacy_opts); menu = g_list_prepend(menu, act); + + act = purple_plugin_action_new(_("Set Custom Icon..."), + oscar_show_icq_custom_icons); + menu = g_list_prepend(menu, act); } else { diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h index 8077b87635..3b15a72bec 100644 --- a/libpurple/protocols/oscar/oscar.h +++ b/libpurple/protocols/oscar/oscar.h @@ -362,8 +362,10 @@ typedef enum OSCAR_CAPABILITY_LIVEVIDEO = 0x02000000, OSCAR_CAPABILITY_CAMERA = 0x04000000, OSCAR_CAPABILITY_ICHAT_SCREENSHARE = 0x08000000, - OSCAR_CAPABILITY_GENERICUNKNOWN = 0x10000000, - OSCAR_CAPABILITY_LAST = 0x20000000 + OSCAR_CAPABILITY_NEWCAPS = 0x10000000, + OSCAR_CAPABILITY_XTRAZ = 0x20000000, + OSCAR_CAPABILITY_GENERICUNKNOWN = 0x40000000, + OSCAR_CAPABILITY_LAST = 0x80000000 } OscarCapability; /* @@ -557,6 +559,12 @@ struct _OscarData #define AIM_ICQ_STATE_OUT 0x00000004 #define AIM_ICQ_STATE_BUSY 0x00000010 #define AIM_ICQ_STATE_CHAT 0x00000020 +#define AIM_ICQ_STATE_EVIL 0x00003000 +#define AIM_ICQ_STATE_DEPRESSION 0x00004000 +#define AIM_ICQ_STATE_ATHOME 0x00005000 +#define AIM_ICQ_STATE_ATWORK 0x00006000 +#define AIM_ICQ_STATE_LUNCH 0x00002001 +#define AIM_ICQ_STATE_EVIL 0x00003000 #define AIM_ICQ_STATE_INVISIBLE 0x00000100 #define AIM_ICQ_STATE_WEBAWARE 0x00010000 #define AIM_ICQ_STATE_HIDEIP 0x00020000 @@ -966,6 +974,7 @@ struct aim_incomingim_ch4_args /* 0x000b */ int aim_im_denytransfer(OscarData *od, const char *sn, const guchar *cookie, guint16 code); /* 0x0010 */ int aim_im_reqofflinemsgs(OscarData *od); /* 0x0014 */ int aim_im_sendmtn(OscarData *od, guint16 type1, const char *sn, guint16 type2); +/* 0x000b */ int icq_relay_xstatus (OscarData *od, const char *sn, const guchar* cookie); void aim_icbm_makecookie(guchar* cookie); gchar *oscar_encoding_extract(const char *encoding); gchar *oscar_encoding_to_utf8(PurpleAccount *account, const char *encoding, const char *text, int textlen); @@ -1019,6 +1028,7 @@ typedef struct aim_userinfo_s guint32 onlinesince; /* time_t */ guint32 sessionlen; /* in seconds */ guint32 capabilities; + gint32 customicon; struct { guint32 status; guint32 ipaddr; @@ -1097,8 +1107,12 @@ guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len); void aim_info_free(aim_userinfo_t *); int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *); int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info); - - +gint32 aim_get_custom_icon(OscarData *od, ByteStream *bs, int len); +guint32 aim_get_custom_icons_count(void); +char* aim_get_custom_icon_filename(gint32 no); +char* aim_get_custom_icon_descriptivename(gint32 no); +guint8* aim_get_custom_icon_data(gint32 no); +int icq_im_xstatus_request(OscarData *od, const char *sn); /* 0x0003 - family_buddy.c */ /* 0x0002 */ void aim_buddylist_reqrights(OscarData *, FlapConnection *); @@ -1428,7 +1442,7 @@ int aim_tlvlist_add_8(GSList **list, const guint16 type, const guint8 value); int aim_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value); int aim_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value); int aim_tlvlist_add_str(GSList **list, const guint16 type, const char *value); -int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps); +int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, gint32 customicon); int aim_tlvlist_add_userinfo(GSList **list, guint16 type, aim_userinfo_t *userinfo); int aim_tlvlist_add_chatroom(GSList **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance); int aim_tlvlist_add_frozentlvlist(GSList **list, guint16 type, GSList **tl); diff --git a/libpurple/protocols/oscar/tlv.c b/libpurple/protocols/oscar/tlv.c index e139c06522..aeaf4cca7b 100644 --- a/libpurple/protocols/oscar/tlv.c +++ b/libpurple/protocols/oscar/tlv.c @@ -407,10 +407,11 @@ int aim_tlvlist_add_str(GSList **list, const guint16 type, const char *value) * @param caps Bitfield of capability flags to send * @return The size of the value added. */ -int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps) +int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, const gint32 customicon) { guint8 buf[256]; /* TODO: Don't use a fixed length buffer */ ByteStream bs; + guint8 *data; if (caps == 0) return 0; /* nothing there anyway */ @@ -418,6 +419,12 @@ int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps) byte_stream_init(&bs, buf, sizeof(buf)); byte_stream_putcaps(&bs, caps); + + /* adding of custom icon GUID */ + data = aim_get_custom_icon_data(customicon); + if (data != NULL) { + byte_stream_putraw(&bs, data, 16); + } return aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), buf); } diff --git a/libpurple/request.c b/libpurple/request.c index e7fb73f7fc..816d846b30 100644 --- a/libpurple/request.c +++ b/libpurple/request.c @@ -789,6 +789,25 @@ purple_request_field_list_new(const char *id, const char *text) return field; } +void +purple_request_field_list_set_pixbuf(PurpleRequestField *field, + gboolean pixbuf) +{ + g_return_if_fail(field != NULL); + g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST); + + field->u.list.pixbuf = pixbuf; +} + +gboolean +purple_request_field_list_get_pixbuf(const PurpleRequestField *field) +{ + g_return_val_if_fail(field != NULL, FALSE); + g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST, FALSE); + + return field->u.list.pixbuf; +} + void purple_request_field_list_set_multi_select(PurpleRequestField *field, gboolean multi_select) @@ -833,6 +852,22 @@ purple_request_field_list_add(PurpleRequestField *field, const char *item, g_hash_table_insert(field->u.list.item_data, g_strdup(item), data); } +void +purple_request_field_list_add_icon(PurpleRequestField *field, const char *item, const char* icon_path, + void *data) +{ + g_return_if_fail(field != NULL); + g_return_if_fail(item != NULL); + g_return_if_fail(data != NULL); + g_return_if_fail(icon_path != NULL); + g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST); + + field->u.list.items = g_list_append(field->u.list.items, g_strdup(item)); + field->u.list.icons = g_list_append(field->u.list.icons, g_strdup(icon_path)); + + g_hash_table_insert(field->u.list.item_data, g_strdup(item), data); +} + void purple_request_field_list_add_selected(PurpleRequestField *field, const char *item) { @@ -935,6 +970,16 @@ purple_request_field_list_get_items(const PurpleRequestField *field) return field->u.list.items; } +GList * +purple_request_field_list_get_icons(const PurpleRequestField *field) +{ + g_return_val_if_fail(field != NULL, NULL); + g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST, NULL); + g_return_val_if_fail(field->u.list.pixbuf == TRUE, NULL); + + return field->u.list.icons; +} + PurpleRequestField * purple_request_field_label_new(const char *id, const char *text) { diff --git a/libpurple/request.h b/libpurple/request.h index 2d66522123..7dc494a2e7 100644 --- a/libpurple/request.h +++ b/libpurple/request.h @@ -147,10 +147,12 @@ typedef struct { GList *items; GHashTable *item_data; + GList *icons; GList *selected; GHashTable *selected_table; gboolean multiple_selection; + gboolean pixbuf; } list; @@ -876,6 +878,26 @@ GList *purple_request_field_choice_get_labels(const PurpleRequestField *field); */ PurpleRequestField *purple_request_field_list_new(const char *id, const char *text); +/** + * Sets whether or not a list field allows icons. + * + * @param field The list field. + * @param multi_select TRUE if icons are enabled, + * or FALSE otherwise. + */ +void purple_request_field_list_set_pixbuf(PurpleRequestField *field, + gboolean pixbuf); + +/** + * Returns whether or not a list field allows icons. + * + * @param field The list field. + * + * @return TRUE if icons are enabled, or FALSE otherwise. + */ +gboolean purple_request_field_list_get_pixbuf( + const PurpleRequestField *field); + /** * Sets whether or not a list field allows multiple selection. * @@ -917,6 +939,17 @@ void *purple_request_field_list_get_data(const PurpleRequestField *field, void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data); +/** + * Adds an item with icon to a list field. + * + * @param field The list field. + * @param item The list item. + * @param icon_path The path to icon file. + * @param data The associated data. + */ +void purple_request_field_list_add_icon(PurpleRequestField *field, + const char *item, const char* icon_path, void* data); + /** * Adds a selected item to the list field. * @@ -975,6 +1008,15 @@ GList *purple_request_field_list_get_selected( */ GList *purple_request_field_list_get_items(const PurpleRequestField *field); +/** + * Returns a list of icons in a list field. + * + * @param field The field. + * + * @constreturn The list of icons. + */ +GList *purple_request_field_list_get_icons(const PurpleRequestField *field); + /*@}*/ /**************************************************************************/ diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index 42d8c60b16..c5c8bb1673 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -995,7 +995,9 @@ create_list_field(PurpleRequestField *field) GtkTreeSelection *sel; GtkTreeViewColumn *column; GtkTreeIter iter; - GList *l; + GList *l, *ic = NULL; + GdkPixbuf* pixbuf; + gboolean icon = purple_request_field_list_get_pixbuf(field); /* Create the scrolled window */ sw = gtk_scrolled_window_new(NULL, NULL); @@ -1007,7 +1009,10 @@ create_list_field(PurpleRequestField *field) gtk_widget_show(sw); /* Create the list store */ - store = gtk_list_store_new(2, G_TYPE_POINTER, G_TYPE_STRING); + if (icon) + store = gtk_list_store_new(3, G_TYPE_POINTER, G_TYPE_STRING, GDK_TYPE_PIXBUF); + else + store = gtk_list_store_new(2, G_TYPE_POINTER, G_TYPE_STRING); /* Create the tree view */ treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); @@ -1026,13 +1031,42 @@ create_list_field(PurpleRequestField *field) gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", 1); + if(icon == TRUE) + { + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, renderer, TRUE); + gtk_tree_view_column_add_attribute(column, renderer, "pixbuf", 2); + + gtk_widget_set_size_request(treeview, 200, 400); + } + + if(icon == TRUE) + ic = purple_request_field_list_get_icons(field); + for (l = purple_request_field_list_get_items(field); l != NULL; l = l->next) { const char *text = (const char *)l->data; gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, + if(icon == TRUE) + { + const char *icon_path = (const char *)ic->data; + char* filename = g_build_filename(DATADIR, icon_path, NULL); + + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + + g_free(filename); + + gtk_list_store_set(store, &iter, + 0, purple_request_field_list_get_data(field, text), + 1, text, + 2, pixbuf, + -1); + ic = ic->next; + } + else + gtk_list_store_set(store, &iter, 0, purple_request_field_list_get_data(field, text), 1, text, -1); diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index ff2e2080c7..139042fb88 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -126,7 +126,42 @@ EMBLEMS_16 = \ emblems/16/secure.png \ emblems/16/unavailable.png \ emblems/16/video.png \ - emblems/16/voice.png + emblems/16/voice.png \ + emblems/16/xstatus_angry.png \ + emblems/16/xstatus_bathing.png \ + emblems/16/xstatus_beer.png \ + emblems/16/xstatus_busy.png \ + emblems/16/xstatus_cinema.png \ + emblems/16/xstatus_coffee.png \ + emblems/16/xstatus_crap.png \ + emblems/16/xstatus_crapping.png \ + emblems/16/xstatus_eating.png \ + emblems/16/xstatus_engineering.png \ + emblems/16/xstatus_friends.png \ + emblems/16/xstatus_fun.png \ + emblems/16/xstatus_gaming.png \ + emblems/16/xstatus_google.png \ + emblems/16/xstatus_heart.png \ + emblems/16/xstatus_internet.png \ + emblems/16/xstatus_iron.png \ + emblems/16/xstatus_mobile.png \ + emblems/16/xstatus_music.png \ + emblems/16/xstatus_party.png \ + emblems/16/xstatus_pda.png \ + emblems/16/xstatus_phone.png \ + emblems/16/xstatus_question.png \ + emblems/16/xstatus_shopping.png \ + emblems/16/xstatus_sick.png \ + emblems/16/xstatus_sleeping.png \ + emblems/16/xstatus_studying.png \ + emblems/16/xstatus_surfing.png \ + emblems/16/xstatus_thinking.png \ + emblems/16/xstatus_tired.png \ + emblems/16/xstatus_tv.png \ + emblems/16/xstatus_typing.png \ + emblems/16/xstatus_writing.png \ + emblems/16/xstatus_zzz.png + EMOTES_DEFAULT_24_SCALABLE = \ emotes/default/24/scalable/airplane.svg \ -- cgit v1.2.1 From 732a8160be5a295b269aa67da3b8c311cc986159 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 08:16:17 +0000 Subject: Revert the unnecessary addition of the pixbuf boolean to PurpleRequestField.list --- libpurple/protocols/oscar/oscar.c | 2 -- libpurple/request.c | 20 -------------------- libpurple/request.h | 21 --------------------- pidgin/gtkrequest.c | 19 +++++++++---------- 4 files changed, 9 insertions(+), 53 deletions(-) diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index a0d5ad344b..1ea15cef30 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -6784,8 +6784,6 @@ oscar_show_icq_custom_icons(PurplePluginAction *action) f = purple_request_field_list_new("customicon", _("XStatus")); - purple_request_field_list_set_pixbuf(f, TRUE); - na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); purple_request_field_list_add_icon(f, _("None"), na_fn, GINT_TO_POINTER(-1)); diff --git a/libpurple/request.c b/libpurple/request.c index 816d846b30..c611658b7d 100644 --- a/libpurple/request.c +++ b/libpurple/request.c @@ -789,25 +789,6 @@ purple_request_field_list_new(const char *id, const char *text) return field; } -void -purple_request_field_list_set_pixbuf(PurpleRequestField *field, - gboolean pixbuf) -{ - g_return_if_fail(field != NULL); - g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST); - - field->u.list.pixbuf = pixbuf; -} - -gboolean -purple_request_field_list_get_pixbuf(const PurpleRequestField *field) -{ - g_return_val_if_fail(field != NULL, FALSE); - g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST, FALSE); - - return field->u.list.pixbuf; -} - void purple_request_field_list_set_multi_select(PurpleRequestField *field, gboolean multi_select) @@ -975,7 +956,6 @@ purple_request_field_list_get_icons(const PurpleRequestField *field) { g_return_val_if_fail(field != NULL, NULL); g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST, NULL); - g_return_val_if_fail(field->u.list.pixbuf == TRUE, NULL); return field->u.list.icons; } diff --git a/libpurple/request.h b/libpurple/request.h index 7dc494a2e7..c643275b32 100644 --- a/libpurple/request.h +++ b/libpurple/request.h @@ -152,7 +152,6 @@ typedef struct GHashTable *selected_table; gboolean multiple_selection; - gboolean pixbuf; } list; @@ -878,26 +877,6 @@ GList *purple_request_field_choice_get_labels(const PurpleRequestField *field); */ PurpleRequestField *purple_request_field_list_new(const char *id, const char *text); -/** - * Sets whether or not a list field allows icons. - * - * @param field The list field. - * @param multi_select TRUE if icons are enabled, - * or FALSE otherwise. - */ -void purple_request_field_list_set_pixbuf(PurpleRequestField *field, - gboolean pixbuf); - -/** - * Returns whether or not a list field allows icons. - * - * @param field The list field. - * - * @return TRUE if icons are enabled, or FALSE otherwise. - */ -gboolean purple_request_field_list_get_pixbuf( - const PurpleRequestField *field); - /** * Sets whether or not a list field allows multiple selection. * diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index c5c8bb1673..d18ade3b4d 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -995,9 +995,11 @@ create_list_field(PurpleRequestField *field) GtkTreeSelection *sel; GtkTreeViewColumn *column; GtkTreeIter iter; - GList *l, *ic = NULL; + GList *l; + GList *icons = NULL; GdkPixbuf* pixbuf; - gboolean icon = purple_request_field_list_get_pixbuf(field); + + icons = purple_request_field_list_get_icons(field); /* Create the scrolled window */ sw = gtk_scrolled_window_new(NULL, NULL); @@ -1009,7 +1011,7 @@ create_list_field(PurpleRequestField *field) gtk_widget_show(sw); /* Create the list store */ - if (icon) + if (icons) store = gtk_list_store_new(3, G_TYPE_POINTER, G_TYPE_STRING, GDK_TYPE_PIXBUF); else store = gtk_list_store_new(2, G_TYPE_POINTER, G_TYPE_STRING); @@ -1031,7 +1033,7 @@ create_list_field(PurpleRequestField *field) gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", 1); - if(icon == TRUE) + if (icons) { renderer = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); @@ -1040,18 +1042,15 @@ create_list_field(PurpleRequestField *field) gtk_widget_set_size_request(treeview, 200, 400); } - if(icon == TRUE) - ic = purple_request_field_list_get_icons(field); - for (l = purple_request_field_list_get_items(field); l != NULL; l = l->next) { const char *text = (const char *)l->data; gtk_list_store_append(store, &iter); - if(icon == TRUE) + if (icons) { - const char *icon_path = (const char *)ic->data; + const char *icon_path = (const char *)icons->data; char* filename = g_build_filename(DATADIR, icon_path, NULL); pixbuf = gdk_pixbuf_new_from_file(filename, NULL); @@ -1063,7 +1062,7 @@ create_list_field(PurpleRequestField *field) 1, text, 2, pixbuf, -1); - ic = ic->next; + icons = icons->next; } else gtk_list_store_set(store, &iter, -- cgit v1.2.1 From 2b8cb43db36f9b3e5307ce874994cfee220c9c2d Mon Sep 17 00:00:00 2001 From: Tom?? Kebert Date: Sun, 16 Nov 2008 08:22:46 +0000 Subject: Adding more ICQ X-Status icons from N3fr0n. Again, these are under the GPLv2 or later. Refs #4508 committer: Richard Laager --- pidgin/pixmaps/emblems/16/xstatus_bathing.png | Bin 0 -> 816 bytes pidgin/pixmaps/emblems/16/xstatus_internet.png | Bin 0 -> 999 bytes pidgin/pixmaps/emblems/16/xstatus_restroom.png | Bin 0 -> 716 bytes pidgin/pixmaps/emblems/16/xstatus_shopping.png | Bin 0 -> 645 bytes pidgin/pixmaps/emblems/16/xstatus_studying.png | Bin 0 -> 718 bytes pidgin/pixmaps/emblems/16/xstatus_suit.png | Bin 0 -> 804 bytes pidgin/pixmaps/emblems/16/xstatus_surfing.png | Bin 0 -> 919 bytes pidgin/pixmaps/emblems/16/xstatus_typing.png | Bin 0 -> 725 bytes pidgin/pixmaps/emblems/16/xstatus_working.png | Bin 0 -> 924 bytes pidgin/pixmaps/emblems/16/xstatus_writing.png | Bin 0 -> 714 bytes 10 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pidgin/pixmaps/emblems/16/xstatus_bathing.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_internet.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_restroom.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_shopping.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_studying.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_suit.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_surfing.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_typing.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_working.png create mode 100644 pidgin/pixmaps/emblems/16/xstatus_writing.png diff --git a/pidgin/pixmaps/emblems/16/xstatus_bathing.png b/pidgin/pixmaps/emblems/16/xstatus_bathing.png new file mode 100644 index 0000000000..662eb2ac97 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_bathing.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_internet.png b/pidgin/pixmaps/emblems/16/xstatus_internet.png new file mode 100644 index 0000000000..9281221f98 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_internet.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_restroom.png b/pidgin/pixmaps/emblems/16/xstatus_restroom.png new file mode 100644 index 0000000000..a642e7d53c Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_restroom.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_shopping.png b/pidgin/pixmaps/emblems/16/xstatus_shopping.png new file mode 100644 index 0000000000..291107ae64 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_shopping.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_studying.png b/pidgin/pixmaps/emblems/16/xstatus_studying.png new file mode 100644 index 0000000000..0a6053f86c Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_studying.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_suit.png b/pidgin/pixmaps/emblems/16/xstatus_suit.png new file mode 100644 index 0000000000..3c0080f0dd Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_suit.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_surfing.png b/pidgin/pixmaps/emblems/16/xstatus_surfing.png new file mode 100644 index 0000000000..727b352f72 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_surfing.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_typing.png b/pidgin/pixmaps/emblems/16/xstatus_typing.png new file mode 100644 index 0000000000..7f60b0a25e Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_typing.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_working.png b/pidgin/pixmaps/emblems/16/xstatus_working.png new file mode 100644 index 0000000000..cc90d637df Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_working.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_writing.png b/pidgin/pixmaps/emblems/16/xstatus_writing.png new file mode 100644 index 0000000000..e8b5d0d53e Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_writing.png differ -- cgit v1.2.1 From 9641589e2ba4413fc1f1a1f791ee0a075e7c4ccb Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 08:39:34 +0000 Subject: Fix up the X-Status code in many ways: * Clean up the descriptions to be consistently of the form, "I am _____." * Properly mark the descriptions for translation. * Utilize the files from small smiley theme as much as possible. Through a Makefile rule, they will be copied from emotes/small/16/ to emblems/16 at build time and then installed as usual. This is slightly hackish, but ensures that our icons are consistent and saves manual copying work and duplication of source files in the repository. + As part of this, mobile.png was moved to emotes/small/16, as it is needed in both places. * Call these things "Custom Status Icon"s (adding "Status") in the UI. * Add icqmood0 = shopping, based on testing with ICQ6. Thanks John!!! * Change the xstatus_crap icon to xstatus_typing to match ICQ 6. The other typing icon was left alone, except that the name was set to NULL so we wouldn't get duplicates in the list. * Change the xstatus_iron (Pro7 TV icon) to xstatus_suit, using the 'person wearing a suit' icon from N3fr0n to match ICQ6. I named this icon, somewhat arbitrarily, "At the office". * The PDA icon is now the same as the hiptop, but hopefully that won't cause any confusion. Also, the custom icon is now higher priority than the hiptop icon. * The music icon is the ("tune") emblem, not the emoticon. This seems more consistent, given that we're talking about buddy list emblems. * The "Googling" icon has been renamed to "Searching the web" to avoid the trademark. * The "zzz" icon is now an icon for smoking, which seems to fit with the official client's icon as posted in #4508. Other clients may show a marijuana leaf. Oh well. --- .mtn-ignore | 22 +++++ libpurple/protocols/oscar/family_locate.c | 121 +++++++++++++++----------- libpurple/protocols/oscar/oscar.c | 64 +++++++++----- pidgin/pixmaps/Makefile.am | 76 ++++++++++------ pidgin/pixmaps/emblems/16/mobile.png | Bin 535 -> 0 bytes pidgin/pixmaps/emotes/small/16/Makefile.am | 1 + pidgin/pixmaps/emotes/small/16/mobile.png | Bin 0 -> 535 bytes pidgin/pixmaps/emotes/small/16/small.theme.in | 1 + po/POTFILES.in | 1 + 9 files changed, 182 insertions(+), 104 deletions(-) delete mode 100644 pidgin/pixmaps/emblems/16/mobile.png create mode 100644 pidgin/pixmaps/emotes/small/16/mobile.png diff --git a/.mtn-ignore b/.mtn-ignore index 3f6c88ab7b..6865d1d5e9 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -37,6 +37,28 @@ pidgin-.*.tar.gz pidgin-.*.tar.bz2 pidgin-*.*.*-win32bin$ pidgin/pidgin$ +pidgin/pixmaps/emblems/16/angry.png +pidgin/pixmaps/emblems/16/beer.png +pidgin/pixmaps/emblems/16/busy.png +pidgin/pixmaps/emblems/16/camera.png +pidgin/pixmaps/emblems/16/cigarette.png +pidgin/pixmaps/emblems/16/coffee.png +pidgin/pixmaps/emblems/16/console.png +pidgin/pixmaps/emblems/16/love.png +pidgin/pixmaps/emblems/16/meeting.png +pidgin/pixmaps/emblems/16/mobile.png +pidgin/pixmaps/emblems/16/musical-note.png +pidgin/pixmaps/emblems/16/party.png +pidgin/pixmaps/emblems/16/phone.png +pidgin/pixmaps/emblems/16/plate.png +pidgin/pixmaps/emblems/16/question.png +pidgin/pixmaps/emblems/16/search.png +pidgin/pixmaps/emblems/16/sick.png +pidgin/pixmaps/emblems/16/sleepy.png +pidgin/pixmaps/emblems/16/smile-big.png +pidgin/pixmaps/emblems/16/thinking.png +pidgin/pixmaps/emblems/16/tv.png +pidgin/pixmaps/emblems/16/yawn.png pidgin/pixmaps/emotes/default/24/theme pidgin/pixmaps/emotes/none/theme pidgin/pixmaps/emotes/small/16/theme diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index 61c2315e84..ab89fd4e03 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -264,139 +264,146 @@ static const struct { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {"xstatus_thinking", "Thinking", + {"thinking", N_("Thinking"), {0x3f, 0xb0, 0xbd, 0x36, 0xaf, 0x3b, 0x4a, 0x60, 0x9e, 0xef, 0xcf, 0x19, 0x0f, 0x6a, 0x5a, 0x7f}}, - {"xstatus_busy", "Busy", + {"busy", N_("Busy"), {0x48, 0x8e, 0x14, 0x89, 0x8a, 0xca, 0x4a, 0x08, 0x82, 0xaa, 0x77, 0xce, 0x7a, 0x16, 0x52, 0x08}}, - {"xstatus_shopping", "Shopping", + {"xstatus_shopping", N_("Shopping"), {0x63, 0x62, 0x73, 0x37, 0xa0, 0x3f, 0x49, 0xff, 0x80, 0xe5, 0xf7, 0x09, 0xcd, 0xe0, 0xa4, 0xee}}, - {"xstatus_typing", "Typing", + /* This was in the original patch, but isn't what the official client + * (ICQ 6) sets when you choose its typewriter icon. */ + {"xstatus_typing", NULL, {0x63, 0x4f, 0x6b, 0xd8 ,0xad, 0xd2, 0x4a, 0xa1, 0xaa, 0xb9, 0x11, 0x5b, 0xc2, 0x6d, 0x05, 0xa1}}, - {"xstatus_question", "Question Mark", + {"question", N_("Questioning"), {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64}}, - {"xstatus_angry", "Angry", + {"angry", N_("Angry"), {0x01, 0xd8, 0xd7, 0xee, 0xac, 0x3b, 0x49, 0x2a, 0xa5, 0x8d, 0xd3, 0xd8, 0x77, 0xe6, 0x6b, 0x92}}, - {"xstatus_eating", "Eating", + {"plate", N_("Eating"), {0xf8, 0xe8, 0xd7, 0xb2, 0x82, 0xc4, 0x41, 0x42, 0x90, 0xf8, 0x10, 0xc6, 0xce, 0x0a, 0x89, 0xa6}}, - - {"xstatus_cinema", "Cinema", + + /* Shooting Film (or Pictures) */ + {"camera", N_("Shooting"), {0x10, 0x7a, 0x9a, 0x18, 0x12, 0x32, 0x4d, 0xa4, 0xb6, 0xcd, 0x08, 0x79, 0xdb, 0x78, 0x0f, 0x09}}, - - {"xstatus_sick", "Sick", + + {"sick", N_("Sick"), {0x1f, 0x7a, 0x40, 0x71, 0xbf, 0x3b, 0x4e, 0x60, 0xbc, 0x32, 0x4c, 0x57, 0x87, 0xb0, 0x4c, 0xf1}}, - - {"xstatus_crap", "Unknown 1", + + {"xstatus_typing", N_("Typing"), {0x2c, 0xe0, 0xe4, 0xe5, 0x7c, 0x64, 0x43, 0x70, 0x9c, 0x3a, 0x7a, 0x1c, 0xe8, 0x78, 0xa7, 0xdc}}, - - {"xstatus_iron", "Unknown 2", + + {"xstatus_suit", N_("At the office"), {0xb7, 0x08, 0x67, 0xf5, 0x38, 0x25, 0x43, 0x27, 0xa1, 0xff, 0xcf, 0x4c, 0xc1, 0x93, 0x97, 0x97}}, - - {"xstatus_bathing", "Bathing", + + {"xstatus_bathing", N_("Taking a bath"), {0x5a, 0x58, 0x1e, 0xa1, 0xe5, 0x80, 0x43, 0x0c, 0xa0, 0x6f, 0x61, 0x22, 0x98, 0xb7, 0xe4, 0xc7}}, - - {"xstatus_tv", "Watching TV", + + {"tv", N_("Watching TV"), {0x80, 0x53, 0x7d, 0xe2, 0xa4, 0x67, 0x4a, 0x76, 0xb3, 0x54, 0x6d, 0xfd, 0x07, 0x5f, 0x5e, 0xc6}}, - - {"xstatus_fun", "Having fun", + + {"smile-big", N_("Having fun"), {0x6f, 0x49, 0x30, 0x98, 0x4f, 0x7c, 0x4a, 0xff, 0xa2, 0x76, 0x34, 0xa0, 0x3b, 0xce, 0xae, 0xa7}}, - {"xstatus_sleeping", "Sleeping", + {"sleepy", N_("Sleeping"), {0x78, 0x5e, 0x8c, 0x48, 0x40, 0xd3, 0x4c, 0x65, 0x88, 0x6f, 0x04, 0xcf, 0x3f, 0x3f, 0x43, 0xdf}}, - - {"xstatus_pda", "PDA device", + + {"hiptop", N_("Using a PDA"), {0x10, 0x11, 0x17, 0xc9, 0xa3, 0xb0, 0x40, 0xf9, 0x81, 0xac, 0x49, 0xe1, 0x59, 0xfb, 0xd5, 0xd4}}, - {"xstatus_heart", "In love", + {"love", N_("In love"), {0xdd, 0xcf, 0x0e, 0xa9, 0x71, 0x95, 0x40, 0x48, 0xa9, 0xc6, 0x41, 0x32, 0x06, 0xd6, 0xf2, 0x80}}, - {"xstatus_tired", "Tired", + /* Sleepy / Tired */ + {"yawn", N_("Sleepy"), {0x83, 0xc9, 0xb7, 0x8e, 0x77, 0xe7, 0x43, 0x78, 0xb2, 0xc5, 0xfb, 0x6c, 0xfc, 0xc3, 0x5b, 0xec}}, - {"xstatus_friends", "Friends", + {"meeting", N_("Meeting friends"), {0xf1, 0x8a, 0xb5, 0x2e, 0xdc, 0x57, 0x49, 0x1d, 0x99, 0xdc, 0x64, 0x44, 0x50, 0x24, 0x57, 0xaf}}, - {"xstatus_phone", "On the phone", + {"phone", N_("On the phone"), {0x12, 0x92, 0xe5, 0x50, 0x1b, 0x64, 0x4f, 0x66, 0xb2, 0x06, 0xb2, 0x9a, 0xf3, 0x78, 0xe4, 0x8d}}, - {"xstatus_surfing", "Surfing", + {"xstatus_surfing", N_("Surfing"), {0xa6, 0xed, 0x55, 0x7e, 0x6b, 0xf7, 0x44, 0xd4, 0xa5, 0xd4, 0xd2, 0xe7, 0xd9, 0x5c, 0xe8, 0x1f}}, - {"xstatus_mobile", "Cell phone", + /* "I am mobile." / "John is mobile." */ + {"mobile", N_("Mobile"), {0x16, 0x0c, 0x60, 0xbb, 0xdd, 0x44, 0x43, 0xf3, 0x91, 0x40, 0x05, 0x0f, 0x00, 0xe6, 0xc0, 0x09}}, - {"xstatus_google", "Googling", + {"search", N_("Searching the web"), {0xd4, 0xe2, 0xb0, 0xba, 0x33, 0x4e, 0x4f, 0xa5, 0x98, 0xd0, 0x11, 0x7d, 0xbf, 0x4d, 0x3c, 0xc8}}, - {"xstatus_party", "Party", + {"party", N_("At a party"), {0xe6, 0x01, 0xe4, 0x1c, 0x33, 0x73, 0x4b, 0xd1, 0xbc, 0x06, 0x81, 0x1d, 0x6c, 0x32, 0x3d, 0x81}}, - {"xstatus_coffee", "Coffee", + {"coffee", N_("Having Coffee"), {0x1b, 0x78, 0xae, 0x31, 0xfa, 0x0b, 0x4d, 0x38, 0x93, 0xd1, 0x99, 0x7e, 0xee, 0xaf, 0xb2, 0x18}}, - {"xstatus_gaming", "Playing", + /* Playing video games */ + {"console", N_("Gaming"), {0xd4, 0xa6, 0x11, 0xd0, 0x8f, 0x01, 0x4e, 0xc0, 0x92, 0x23, 0xc5, 0xb6, 0xbe, 0xc6, 0xcc, 0xf0}}, - - {"xstatus_internet", "Internet", + + {"xstatus_internet", N_("Browsing the web"), {0x12, 0xd0, 0x7e, 0x3e, 0xf8, 0x85, 0x48, 0x9e, 0x8e, 0x97, 0xa7, 0x2a, 0x65, 0x51, 0xe5, 0x8d}}, - - {"xstatus_zzz", "Snoozing", + + {"cigarette", N_("Smoking"), {0x64, 0x43, 0xc6, 0xaf, 0x22, 0x60, 0x45, 0x17, 0xb5, 0x8c, 0xd7, 0xdf, 0x8e, 0x29, 0x03, 0x52}}, - - {"xstatus_writing", "Writing", + + {"xstatus_writing", N_("Writing"), {0x00, 0x72, 0xd9, 0x08, 0x4a, 0xd1, 0x43, 0xdd, 0x91, 0x99, 0x6f, 0x02, 0x69, 0x66, 0x02, 0x6f}}, - - {"xstatus_beer", "Drinking", + + /* Drinking [Alcohol] */ + {"beer", N_("Drinking"), {0x8c, 0x50, 0xdb, 0xae, 0x81, 0xed, 0x47, 0x86, 0xac, 0xca, 0x16, 0xcc, 0x32, 0x13, 0xc7, 0xb7}}, - - {"xstatus_music", "Music", + + {"music", N_("Listening to music"), {0x61, 0xbe, 0xe0, 0xdd, 0x8b, 0xdd, 0x47, 0x5d, 0x8d, 0xee, 0x5f, 0x4b, 0xaa, 0xcf, 0x19, 0xa7}}, - - {"xstatus_studying", "Studying", + + {"xstatus_studying", N_("Studying"), {0x60, 0x9d, 0x52, 0xf8, 0xa2, 0x9a, 0x49, 0xa6, 0xb2, 0xa0, 0x25, 0x24, 0xc5, 0xe9, 0xd2, 0x60}}, - - {"xstatus_engineering", "Engineering", + + {"xstatus_working", N_("Working"), {0xba, 0x74, 0xdb, 0x3e, 0x9e, 0x24, 0x43, 0x4b, 0x87, 0xb6, 0x2f, 0x6b, 0x8d, 0xfe, 0xe5, 0x0f}}, - - {"xstatus_crapping", "In the restroom", + + {"xstatus_restroom", N_("In the restroom"), {0x16, 0xf5, 0xb7, 0x6f, 0xa9, 0xd2, 0x40, 0x35, 0x8c, 0xc5, 0xc0, 0x84, 0x70, 0x3c, 0x98, 0xfa}} }; @@ -652,7 +659,7 @@ aim_get_custom_icon(OscarData *od, ByteStream *bs, int len) for (i = 1; i < AIM_CUSTOM_ICONS_COUNT; i++) { if (memcmp(&aim_custom_icons[i].data, cap, 0x10) == 0) { - purple_debug_misc("oscar", "Custom user icon: %s\n", aim_custom_icons[i].descriptivename); + purple_debug_misc("oscar", "Custom status icon: %s\n", aim_custom_icons[i].descriptivename); result = i; break; /* should only match once... */ } @@ -759,6 +766,7 @@ static const struct { char *mood; gint32 icon_num; } icqmoods[ICQMOODS_COUNT] = { + {"icqmood0", 3}, {"icqmood1", 12}, {"icqmood2", 18}, {"icqmood3", 24}, @@ -1082,6 +1090,15 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) mood = byte_stream_getstr(bs, length2); + /* The official clients allow + * you to set your custom icon + * to the "default" icon, to + * allow setting a status + * message. We'll ignore it. + */ + if (!*mood) + break; + for (i = 0; i < ICQMOODS_COUNT; i++) if (!strcmp(mood, icqmoods[i].mood)) { icon_num = icqmoods[i].icon_num; @@ -1091,7 +1108,7 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) if (icon_num >= 0) outinfo->customicon = icon_num; else - purple_debug_warning("oscar", "Unknown icqmood: %s", mood); + purple_debug_warning("oscar", "Unknown icqmood: %s\n", mood); g_free(mood); } break; diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 1ea15cef30..920ef64a25 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -2458,25 +2458,28 @@ incomingim_chan2(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, else if (args->type & OSCAR_CAPABILITY_ICQSERVERRELAY) { - purple_debug_error("oscar", "Got an ICQ Server Relay message of " + purple_debug_info("oscar", "Got an ICQ Server Relay message of " "type %d\n", args->info.rtfmsg.msgtype); - purple_debug_error("oscar", "Sending X-Status Reply\n"); + purple_debug_info("oscar", "Sending X-Status Reply\n"); if(args->info.rtfmsg.msgtype == 26) icq_relay_xstatus(od, userinfo->sn, args->cookie); if(args->info.rtfmsg.msgtype == 1) { - if(rtfmsg) - serv_got_im(gc, userinfo->sn, rtfmsg, flags, - time(NULL)); - else - serv_got_im(gc, userinfo->sn, args->info.rtfmsg.rtfmsg, flags, - time(NULL)); - + if(rtfmsg) + { + serv_got_im(gc, userinfo->sn, rtfmsg, flags, + time(NULL)); + } + else + { + serv_got_im(gc, userinfo->sn, + args->info.rtfmsg.rtfmsg, flags, + time(NULL)); + } } } - else { purple_debug_error("oscar", "Unknown request class %hu\n", @@ -5850,17 +5853,19 @@ const char *oscar_list_emblem(PurpleBuddy *b) } if (userinfo != NULL ) { + const char *icon; if (userinfo->flags & AIM_FLAG_ADMINISTRATOR) return "admin"; if (userinfo->flags & AIM_FLAG_ACTIVEBUDDY) return "bot"; - if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) - return "hiptop"; if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) return "secure"; if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) return "birthday"; - return aim_get_custom_icon_filename(userinfo->customicon); + if ((icon = aim_get_custom_icon_filename(userinfo->customicon))) + return icon; + if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) + return "hiptop"; } return NULL; } @@ -6782,33 +6787,44 @@ oscar_show_icq_custom_icons(PurplePluginAction *action) g = purple_request_field_group_new(NULL); - f = purple_request_field_list_new("customicon", _("XStatus")); + f = purple_request_field_list_new("customicon", _("Choose a custom status icon")); na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); purple_request_field_list_add_icon(f, _("None"), na_fn, GINT_TO_POINTER(-1)); if (customicon == 0) purple_request_field_list_add_selected(f, _("None")); - + g_free(na_fn); - + + /* TODO: rlaager wants this sorted. */ for (i = 1; i < aim_get_custom_icons_count(); i++) { - char* icon_path = g_strdup_printf("%s.png", aim_get_custom_icon_filename(i)); - char* filename = g_build_filename("pixmaps", "pidgin", "emblems", "16", icon_path, NULL); + const char *icon_filename = aim_get_custom_icon_filename(i); + const char *icon_desc = aim_get_custom_icon_descriptivename(i); + char *icon_path; + char *filename; - purple_request_field_list_add_icon(f, _(aim_get_custom_icon_descriptivename(i)), filename, GINT_TO_POINTER(i)); + if (icon_filename == NULL || icon_desc == NULL) + continue; - if (customicon == i) - purple_request_field_list_add_selected(f, _(aim_get_custom_icon_descriptivename(i))); + icon_path = g_strdup_printf("%s.png", icon_filename); + filename = g_build_filename("pixmaps", "pidgin", + "emblems", "16", + icon_path, NULL); + g_free(icon_path); + purple_request_field_list_add_icon(f, _(icon_desc), + filename, GINT_TO_POINTER(i)); g_free(filename); - g_free(icon_path); + + if (customicon == i) + purple_request_field_list_add_selected(f, _(icon_desc)); } purple_request_field_group_add_field(g, f); purple_request_fields_add_group(fields, g); - purple_request_fields(gc, _("Set Custom Icon"), _("Set Custom Icon"), + purple_request_fields(gc, _("Custom Status Icon"), _("Custom Status Icon"), NULL, fields, _("OK"), G_CALLBACK(oscar_show_icq_custom_icons_cb), _("Cancel"), NULL, @@ -6860,7 +6876,7 @@ oscar_actions(PurplePlugin *plugin, gpointer context) oscar_show_icq_privacy_opts); menu = g_list_prepend(menu, act); - act = purple_plugin_action_new(_("Set Custom Icon..."), + act = purple_plugin_action_new(_("Set Custom Status Icon..."), oscar_show_icq_custom_icons); menu = g_list_prepend(menu, act); } diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index d80ddc6e5e..ca14b7c1d5 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -106,7 +106,51 @@ EMBLEMS_16_SCALABLE = \ emblems/16/scalable/video.svg \ emblems/16/scalable/voice.svg + +# Magic to copy files from emotes/small/16 to emblems/16. +# This is necessary because UIs expect emblems in one place and +# smiley themes in another, but we don't want to duplicate these +# images in the source. +emblems/16/%.png: emotes/small/16/%.png + rm -f $@ + cp -f $< $@ + +emblems/16/busy.png: status/16/busy.png + rm -f $@ + cp -f $< $@ + +# The copied emblems. +# Ensure these are in .mtn-ignore. +EMBLEMS_16_COPIED = \ + emblems/16/angry.png \ + emblems/16/busy.png \ + emblems/16/beer.png \ + emblems/16/camera.png \ + emblems/16/cigarette.png \ + emblems/16/coffee.png \ + emblems/16/console.png \ + emblems/16/love.png \ + emblems/16/meeting.png \ + emblems/16/mobile.png \ + emblems/16/musical-note.png \ + emblems/16/party.png \ + emblems/16/phone.png \ + emblems/16/plate.png \ + emblems/16/question.png \ + emblems/16/search.png \ + emblems/16/sick.png \ + emblems/16/sleepy.png \ + emblems/16/smile-big.png \ + emblems/16/thinking.png \ + emblems/16/tv.png \ + emblems/16/yawn.png + + +# Non-copied emblems. +# Ensure these filenames don't clash with files in emotes/small/16 or +# bad things will happen! EMBLEMS_16 = \ + $(EMBLEMS_16_COPIED) \ emblems/16/aol-client.png \ emblems/16/birthday.png \ emblems/16/blocked.png \ @@ -128,40 +172,16 @@ EMBLEMS_16 = \ emblems/16/unavailable.png \ emblems/16/video.png \ emblems/16/voice.png \ - emblems/16/xstatus_angry.png \ emblems/16/xstatus_bathing.png \ - emblems/16/xstatus_beer.png \ - emblems/16/xstatus_busy.png \ - emblems/16/xstatus_cinema.png \ - emblems/16/xstatus_coffee.png \ - emblems/16/xstatus_crap.png \ - emblems/16/xstatus_crapping.png \ - emblems/16/xstatus_eating.png \ - emblems/16/xstatus_engineering.png \ - emblems/16/xstatus_friends.png \ - emblems/16/xstatus_fun.png \ - emblems/16/xstatus_gaming.png \ - emblems/16/xstatus_google.png \ - emblems/16/xstatus_heart.png \ emblems/16/xstatus_internet.png \ - emblems/16/xstatus_iron.png \ - emblems/16/xstatus_mobile.png \ - emblems/16/xstatus_music.png \ - emblems/16/xstatus_party.png \ - emblems/16/xstatus_pda.png \ - emblems/16/xstatus_phone.png \ - emblems/16/xstatus_question.png \ + emblems/16/xstatus_restroom.png \ emblems/16/xstatus_shopping.png \ - emblems/16/xstatus_sick.png \ - emblems/16/xstatus_sleeping.png \ emblems/16/xstatus_studying.png \ + emblems/16/xstatus_suit.png \ emblems/16/xstatus_surfing.png \ - emblems/16/xstatus_thinking.png \ - emblems/16/xstatus_tired.png \ - emblems/16/xstatus_tv.png \ emblems/16/xstatus_typing.png \ - emblems/16/xstatus_writing.png \ - emblems/16/xstatus_zzz.png + emblems/16/xstatus_working.png \ + emblems/16/xstatus_writing.png EMOTES_DEFAULT_24_SCALABLE = \ diff --git a/pidgin/pixmaps/emblems/16/mobile.png b/pidgin/pixmaps/emblems/16/mobile.png deleted file mode 100644 index d368e64715..0000000000 Binary files a/pidgin/pixmaps/emblems/16/mobile.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index 1980513a37..94df2170c7 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -18,6 +18,7 @@ SMILEYS = \ kiss.png \ love.png \ meeting.png \ + mobile.png \ musical-note.png \ nerdy.png \ neutral.png \ diff --git a/pidgin/pixmaps/emotes/small/16/mobile.png b/pidgin/pixmaps/emotes/small/16/mobile.png new file mode 100644 index 0000000000..d368e64715 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/mobile.png differ diff --git a/pidgin/pixmaps/emotes/small/16/small.theme.in b/pidgin/pixmaps/emotes/small/16/small.theme.in index 09949fa9d7..e2aa7e3977 100644 --- a/pidgin/pixmaps/emotes/small/16/small.theme.in +++ b/pidgin/pixmaps/emotes/small/16/small.theme.in @@ -57,6 +57,7 @@ hug-right.png (}) beer.png (B) (b) sick.png +o( plate.png (pl) +mobile.png (mp) dont-know.png :^) thinking.png *-) party.png <:o) diff --git a/po/POTFILES.in b/po/POTFILES.in index e751a35eb6..a81226ac4d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -124,6 +124,7 @@ libpurple/protocols/myspace/zap.c libpurple/protocols/novell/nmuser.c libpurple/protocols/novell/novell.c libpurple/protocols/oscar/family_chatnav.c +libpurple/protocols/oscar/family_locate.c libpurple/protocols/oscar/flap_connection.c libpurple/protocols/oscar/libaim.c libpurple/protocols/oscar/libicq.c -- cgit v1.2.1 From ccb434bdc587cd5319d1720427c4b27d64263142 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 08:44:14 +0000 Subject: Use a movie camera icon from N3fr0n instead of the photo camera emoticon to more closely match ICQ6. Also, change the description of this icon to "Watching a movie." --- .mtn-ignore | 1 - libpurple/protocols/oscar/family_locate.c | 3 +-- pidgin/pixmaps/Makefile.am | 2 +- pidgin/pixmaps/emblems/16/xstatus_cinema.png | Bin 0 -> 659 bytes 4 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 pidgin/pixmaps/emblems/16/xstatus_cinema.png diff --git a/.mtn-ignore b/.mtn-ignore index 6865d1d5e9..db959e14ca 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -40,7 +40,6 @@ pidgin/pidgin$ pidgin/pixmaps/emblems/16/angry.png pidgin/pixmaps/emblems/16/beer.png pidgin/pixmaps/emblems/16/busy.png -pidgin/pixmaps/emblems/16/camera.png pidgin/pixmaps/emblems/16/cigarette.png pidgin/pixmaps/emblems/16/coffee.png pidgin/pixmaps/emblems/16/console.png diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index ab89fd4e03..e9bd254d23 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -294,8 +294,7 @@ static const struct { {0xf8, 0xe8, 0xd7, 0xb2, 0x82, 0xc4, 0x41, 0x42, 0x90, 0xf8, 0x10, 0xc6, 0xce, 0x0a, 0x89, 0xa6}}, - /* Shooting Film (or Pictures) */ - {"camera", N_("Shooting"), + {"xstatus_cinema", N_("Watching a movie"), {0x10, 0x7a, 0x9a, 0x18, 0x12, 0x32, 0x4d, 0xa4, 0xb6, 0xcd, 0x08, 0x79, 0xdb, 0x78, 0x0f, 0x09}}, diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index ca14b7c1d5..cc3797f395 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -125,7 +125,6 @@ EMBLEMS_16_COPIED = \ emblems/16/angry.png \ emblems/16/busy.png \ emblems/16/beer.png \ - emblems/16/camera.png \ emblems/16/cigarette.png \ emblems/16/coffee.png \ emblems/16/console.png \ @@ -173,6 +172,7 @@ EMBLEMS_16 = \ emblems/16/video.png \ emblems/16/voice.png \ emblems/16/xstatus_bathing.png \ + emblems/16/xstatus_cinema.png \ emblems/16/xstatus_internet.png \ emblems/16/xstatus_restroom.png \ emblems/16/xstatus_shopping.png \ diff --git a/pidgin/pixmaps/emblems/16/xstatus_cinema.png b/pidgin/pixmaps/emblems/16/xstatus_cinema.png new file mode 100644 index 0000000000..e561cb0791 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/xstatus_cinema.png differ -- cgit v1.2.1 From 10aa46183ccf8053540fb644cc20f1a72e3231b5 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 10:06:26 +0000 Subject: Avoid trying to build a filename and pixbuf if there's no image filename. --- pidgin/gtkrequest.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index d18ade3b4d..3e05eab739 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -997,7 +997,6 @@ create_list_field(PurpleRequestField *field) GtkTreeIter iter; GList *l; GList *icons = NULL; - GdkPixbuf* pixbuf; icons = purple_request_field_list_get_icons(field); @@ -1051,11 +1050,15 @@ create_list_field(PurpleRequestField *field) if (icons) { const char *icon_path = (const char *)icons->data; - char* filename = g_build_filename(DATADIR, icon_path, NULL); + char* filename; + GdkPixbuf* pixbuf = NULL; - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - - g_free(filename); + if (icon_path) + { + filename = g_build_filename(DATADIR, icon_path, NULL); + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + } gtk_list_store_set(store, &iter, 0, purple_request_field_list_get_data(field, text), -- cgit v1.2.1 From 65f1d41ae0bb9d5fd81cc9ad325280b8b5691eea Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 10:10:17 +0000 Subject: Deprecate purple_request_field_list_add() in favor of the new purple_request_field_list_add_icon() which now works whether or not icons are being provided. --- libpurple/request.c | 33 ++++++++++++++++++++++----------- libpurple/request.h | 9 +++++++-- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/libpurple/request.c b/libpurple/request.c index c611658b7d..7f478b28b7 100644 --- a/libpurple/request.c +++ b/libpurple/request.c @@ -823,14 +823,7 @@ void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data) { - g_return_if_fail(field != NULL); - g_return_if_fail(item != NULL); - g_return_if_fail(data != NULL); - g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST); - - field->u.list.items = g_list_append(field->u.list.items, g_strdup(item)); - - g_hash_table_insert(field->u.list.item_data, g_strdup(item), data); + purple_request_field_list_add_icon(field, item, NULL, data); } void @@ -840,12 +833,30 @@ purple_request_field_list_add_icon(PurpleRequestField *field, const char *item, g_return_if_fail(field != NULL); g_return_if_fail(item != NULL); g_return_if_fail(data != NULL); - g_return_if_fail(icon_path != NULL); g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST); - field->u.list.items = g_list_append(field->u.list.items, g_strdup(item)); - field->u.list.icons = g_list_append(field->u.list.icons, g_strdup(icon_path)); + if (icon_path) + { + if (field->u.list.icons == NULL) + { + GList *l; + for (l = field->u.list.items ; l != NULL ; l = l->next) + { + /* Order doesn't matter, because we're just + * filing in blank items. So, we use + * g_list_prepend() because it's faster. */ + field->u.list.icons = g_list_prepend(field->u.list.icons, NULL); + } + } + field->u.list.icons = g_list_append(field->u.list.icons, g_strdup(icon_path)); + } + else if (field->u.list.icons) + { + /* Keep this even with the items list. */ + field->u.list.icons = g_list_append(field->u.list.icons, NULL); + } + field->u.list.items = g_list_append(field->u.list.items, g_strdup(item)); g_hash_table_insert(field->u.list.item_data, g_strdup(item), data); } diff --git a/libpurple/request.h b/libpurple/request.h index c643275b32..2e3b357c3a 100644 --- a/libpurple/request.h +++ b/libpurple/request.h @@ -146,8 +146,8 @@ typedef struct struct { GList *items; - GHashTable *item_data; GList *icons; + GHashTable *item_data; GList *selected; GHashTable *selected_table; @@ -914,6 +914,8 @@ void *purple_request_field_list_get_data(const PurpleRequestField *field, * @param field The list field. * @param item The list item. * @param data The associated data. + * + * @deprecated Use purple_request_field_list_add_icon() instead. */ void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data); @@ -990,9 +992,12 @@ GList *purple_request_field_list_get_items(const PurpleRequestField *field); /** * Returns a list of icons in a list field. * + * The icons will correspond with the items, in order. + * * @param field The field. * - * @constreturn The list of icons. + * @constreturn The list of icons or @c NULL (i.e. the empty GList) if no + * items have icons. */ GList *purple_request_field_list_get_icons(const PurpleRequestField *field); -- cgit v1.2.1 From a68fe7f6d9dad0f52c69bcce97d28db4b9013be9 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 10:33:36 +0000 Subject: Deprecate purple_request_field_list_add() --- finch/gntplugin.c | 2 +- finch/gntprefs.c | 2 +- finch/plugins/gnthistory.c | 2 +- libpurple/plugins/perl/common/Request.xs | 7 +++++++ libpurple/protocols/gg/gg.c | 15 ++++++--------- libpurple/protocols/gg/gg.h | 1 - libpurple/protocols/jabber/xdata.c | 2 +- libpurple/protocols/sametime/sametime.c | 8 ++++---- libpurple/protocols/silc/buddy.c | 2 +- libpurple/protocols/silc/chat.c | 2 +- libpurple/protocols/silc10/buddy.c | 2 +- libpurple/protocols/silc10/chat.c | 2 +- libpurple/request.c | 2 ++ libpurple/request.h | 6 ++++-- 14 files changed, 31 insertions(+), 24 deletions(-) diff --git a/finch/gntplugin.c b/finch/gntplugin.c index 4c1127cbc2..565373d240 100644 --- a/finch/gntplugin.c +++ b/finch/gntplugin.c @@ -496,7 +496,7 @@ process_pref_frame(PurplePluginPrefFrame *frame) break; } stringlist = g_list_prepend(stringlist, value); - purple_request_field_list_add(field, label, value); + purple_request_field_list_add_icon(field, label, NULL, value); if (strcmp(value, current_value) == 0) purple_request_field_list_add_selected(field, label); list = list->next->next; diff --git a/finch/gntprefs.c b/finch/gntprefs.c index 3b20960a7c..4118c388a1 100644 --- a/finch/gntprefs.c +++ b/finch/gntprefs.c @@ -170,7 +170,7 @@ get_pref_field(Prefs *prefs) default: break; } - purple_request_field_list_add(field, data, iter->data); + purple_request_field_list_add_icon(field, data, NULL, iter->data); if (select) purple_request_field_list_add_selected(field, data); } diff --git a/finch/plugins/gnthistory.c b/finch/plugins/gnthistory.c index 60128d491e..73d4aec1f6 100644 --- a/finch/plugins/gnthistory.c +++ b/finch/plugins/gnthistory.c @@ -154,7 +154,7 @@ history_prefs_check(PurplePlugin *plugin) while (list) { const char *label = _(list->data); list = g_list_delete_link(list, list); - purple_request_field_list_add(field, label, list->data); + purple_request_field_list_add_icon(field, label, NULL, list->data); if (system && strcmp(system, list->data) == 0) purple_request_field_list_add_selected(field, label); list = g_list_delete_link(list, list); diff --git a/libpurple/plugins/perl/common/Request.xs b/libpurple/plugins/perl/common/Request.xs index 03ef5bfae6..16e558f76f 100644 --- a/libpurple/plugins/perl/common/Request.xs +++ b/libpurple/plugins/perl/common/Request.xs @@ -373,6 +373,13 @@ purple_request_field_list_add(field, item, data) const char *item void * data +void +purple_request_field_list_add_icon(field, item, icon_path, data) + Purple::Request::Field field + const char *item + const char *icon_path + void * data + void purple_request_field_list_add_selected(field, item) Purple::Request::Field field diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c index e334838caf..5522ce04b8 100644 --- a/libpurple/protocols/gg/gg.c +++ b/libpurple/protocols/gg/gg.c @@ -831,16 +831,16 @@ static void ggp_change_passwd(PurplePluginAction *action) /* static void ggp_callback_add_to_chat_ok(PurpleConnection *gc, PurpleRequestFields *fields) {{{ */ static void ggp_callback_add_to_chat_ok(PurpleConnection *gc, PurpleRequestFields *fields) { - GGPInfo *info = gc->proto_data; PurpleRequestField *field; - /* TODO: sel may be null. */ GList *sel; field = purple_request_fields_get_field(fields, "name"); sel = purple_request_field_list_get_selected(field); + if (sel == NULL || sel->data == NULL) + return; - ggp_confer_participants_add_uin(gc, sel->data, info->tmp_buddy); - info->tmp_buddy = 0; + ggp_confer_participants_add_uin(gc, sel->data, + GPOINTER_TO_INT(purple_request_field_list_get_data(field, sel->data))); } /* }}} */ @@ -864,9 +864,6 @@ static void ggp_bmenu_add_to_chat(PurpleBlistNode *node, gpointer ignored) gc = purple_account_get_connection(purple_buddy_get_account(buddy)); info = gc->proto_data; - /* TODO: It tmp_buddy != 0 then stop! */ - info->tmp_buddy = ggp_str_to_uin(purple_buddy_get_name(buddy)); - fields = purple_request_fields_new(); group = purple_request_field_group_new(NULL); purple_request_fields_add_group(fields, group); @@ -874,8 +871,8 @@ static void ggp_bmenu_add_to_chat(PurpleBlistNode *node, gpointer ignored) field = purple_request_field_list_new("name", "Chat name"); for (l = info->chats; l != NULL; l = l->next) { GGPChat *chat = l->data; - purple_request_field_list_add(field, g_strdup(chat->name), - g_strdup(chat->name)); + purple_request_field_list_add_icon(field, chat->name, NULL, + GINT_TO_POINTER(ggp_str_to_uin(purple_buddy_get_name(buddy)))); } purple_request_field_group_add_field(group, field); diff --git a/libpurple/protocols/gg/gg.h b/libpurple/protocols/gg/gg.h index de40b240f6..73994c0417 100644 --- a/libpurple/protocols/gg/gg.h +++ b/libpurple/protocols/gg/gg.h @@ -62,7 +62,6 @@ typedef struct { GList *chats; GGPSearches *searches; - uin_t tmp_buddy; int chats_count; } GGPInfo; diff --git a/libpurple/protocols/jabber/xdata.c b/libpurple/protocols/jabber/xdata.c index 9eff9a84f9..0d45129243 100644 --- a/libpurple/protocols/jabber/xdata.c +++ b/libpurple/protocols/jabber/xdata.c @@ -302,7 +302,7 @@ void *jabber_x_data_request_with_actions(JabberStream *js, xmlnode *packet, GLis data->values = g_slist_prepend(data->values, value); - purple_request_field_list_add(field, lbl, value); + purple_request_field_list_add_icon(field, lbl, NULL, value); if(g_list_find_custom(selected, value, (GCompareFunc)strcmp)) purple_request_field_list_add_selected(field, lbl); } diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c index 061b64053a..ee2cad8606 100644 --- a/libpurple/protocols/sametime/sametime.c +++ b/libpurple/protocols/sametime/sametime.c @@ -3505,10 +3505,10 @@ static void blist_menu_conf_list(PurpleBuddy *buddy, purple_request_field_list_set_multi_select(f, FALSE); for(; confs; confs = confs->next) { struct mwConference *c = confs->data; - purple_request_field_list_add(f, mwConference_getTitle(c), c); + purple_request_field_list_add_icon(f, mwConference_getTitle(c), NULL, c); } - purple_request_field_list_add(f, _("Create New Conference..."), - GINT_TO_POINTER(0x01)); + purple_request_field_list_add_icon(f, _("Create New Conference..."), + NULL, GINT_TO_POINTER(0x01)); purple_request_field_group_add_field(g, f); f = purple_request_field_string_new(CHAT_KEY_INVITE, "Message", NULL, FALSE); @@ -5434,7 +5434,7 @@ static void remote_group_multi(struct mwResolveResult *result, res->id = g_strdup(match->id); res->name = g_strdup(match->name); - purple_request_field_list_add(f, res->name, res); + purple_request_field_list_add_icon(f, res->name, NULL, res); } purple_request_field_group_add_field(g, f); diff --git a/libpurple/protocols/silc/buddy.c b/libpurple/protocols/silc/buddy.c index 112d796ddd..789b2b7501 100644 --- a/libpurple/protocols/silc/buddy.c +++ b/libpurple/protocols/silc/buddy.c @@ -1178,7 +1178,7 @@ silcpurple_add_buddy_select(SilcPurpleBuddyRes r, SilcDList clients) client_entry->username, *client_entry->hostname ? client_entry->hostname : "", fingerprint ? tmp2 : ""); - purple_request_field_list_add(f, tmp, client_entry); + purple_request_field_list_add_icon(f, tmp, NULL, client_entry); silc_free(fingerprint); } diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c index 320cfbd31a..f4a5ad4dab 100644 --- a/libpurple/protocols/silc/chat.c +++ b/libpurple/protocols/silc/chat.c @@ -472,7 +472,7 @@ void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel, g_snprintf(tmp2, sizeof(tmp2), "%s\n %s\n %s", ident->realname ? ident->realname : ident->username ? ident->username : "", fingerprint, babbleprint); - purple_request_field_list_add(f, tmp2, public_key); + purple_request_field_list_add_icon(f, tmp2, NULL, public_key); silc_free(fingerprint); silc_free(babbleprint); diff --git a/libpurple/protocols/silc10/buddy.c b/libpurple/protocols/silc10/buddy.c index 67e53f630f..c8e4823fec 100644 --- a/libpurple/protocols/silc10/buddy.c +++ b/libpurple/protocols/silc10/buddy.c @@ -1176,7 +1176,7 @@ silcpurple_add_buddy_select(SilcPurpleBuddyRes r, clients[i]->username, clients[i]->hostname ? clients[i]->hostname : "", fingerprint ? tmp2 : ""); - purple_request_field_list_add(f, tmp, clients[i]); + purple_request_field_list_add_icon(f, tmp, NULL, clients[i]); silc_free(fingerprint); } diff --git a/libpurple/protocols/silc10/chat.c b/libpurple/protocols/silc10/chat.c index 0331fffeb4..b9c903ef51 100644 --- a/libpurple/protocols/silc10/chat.c +++ b/libpurple/protocols/silc10/chat.c @@ -449,7 +449,7 @@ void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel, g_snprintf(tmp2, sizeof(tmp2), "%s\n %s\n %s", ident->realname ? ident->realname : ident->username ? ident->username : "", fingerprint, babbleprint); - purple_request_field_list_add(f, tmp2, pubkey); + purple_request_field_list_add_icon(f, tmp2, NULL, pubkey); silc_free(fingerprint); silc_free(babbleprint); diff --git a/libpurple/request.c b/libpurple/request.c index 7f478b28b7..c63fe179ab 100644 --- a/libpurple/request.c +++ b/libpurple/request.c @@ -23,6 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#define _PURPLE_REQUEST_C_ + #include "internal.h" #include "notify.h" diff --git a/libpurple/request.h b/libpurple/request.h index 2e3b357c3a..3063485002 100644 --- a/libpurple/request.h +++ b/libpurple/request.h @@ -908,6 +908,7 @@ gboolean purple_request_field_list_get_multi_select( void *purple_request_field_list_get_data(const PurpleRequestField *field, const char *text); +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_) /** * Adds an item to a list field. * @@ -919,13 +920,14 @@ void *purple_request_field_list_get_data(const PurpleRequestField *field, */ void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data); +#endif /** - * Adds an item with icon to a list field. + * Adds an item to a list field. * * @param field The list field. * @param item The list item. - * @param icon_path The path to icon file. + * @param icon_path The path to icon file, or @c NULL for no icon. * @param data The associated data. */ void purple_request_field_list_add_icon(PurpleRequestField *field, -- cgit v1.2.1 From 692732bc1ce79f9c01e7f18769a566b81b17499d Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 18:24:04 +0000 Subject: Drop xstatus_ from the icon names. --- libpurple/protocols/oscar/family_locate.c | 24 ++++++++++++------------ pidgin/pixmaps/emblems/16/bathing.png | Bin 0 -> 816 bytes pidgin/pixmaps/emblems/16/cinema.png | Bin 0 -> 659 bytes pidgin/pixmaps/emblems/16/internet.png | Bin 0 -> 999 bytes pidgin/pixmaps/emblems/16/restroom.png | Bin 0 -> 716 bytes pidgin/pixmaps/emblems/16/shopping.png | Bin 0 -> 645 bytes pidgin/pixmaps/emblems/16/studying.png | Bin 0 -> 718 bytes pidgin/pixmaps/emblems/16/suit.png | Bin 0 -> 804 bytes pidgin/pixmaps/emblems/16/surfing.png | Bin 0 -> 919 bytes pidgin/pixmaps/emblems/16/typing.png | Bin 0 -> 725 bytes pidgin/pixmaps/emblems/16/working.png | Bin 0 -> 924 bytes pidgin/pixmaps/emblems/16/writing.png | Bin 0 -> 714 bytes pidgin/pixmaps/emblems/16/xstatus_bathing.png | Bin 816 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_cinema.png | Bin 659 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_internet.png | Bin 999 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_restroom.png | Bin 716 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_shopping.png | Bin 645 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_studying.png | Bin 718 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_suit.png | Bin 804 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_surfing.png | Bin 919 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_typing.png | Bin 725 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_working.png | Bin 924 -> 0 bytes pidgin/pixmaps/emblems/16/xstatus_writing.png | Bin 714 -> 0 bytes 23 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 pidgin/pixmaps/emblems/16/bathing.png create mode 100644 pidgin/pixmaps/emblems/16/cinema.png create mode 100644 pidgin/pixmaps/emblems/16/internet.png create mode 100644 pidgin/pixmaps/emblems/16/restroom.png create mode 100644 pidgin/pixmaps/emblems/16/shopping.png create mode 100644 pidgin/pixmaps/emblems/16/studying.png create mode 100644 pidgin/pixmaps/emblems/16/suit.png create mode 100644 pidgin/pixmaps/emblems/16/surfing.png create mode 100644 pidgin/pixmaps/emblems/16/typing.png create mode 100644 pidgin/pixmaps/emblems/16/working.png create mode 100644 pidgin/pixmaps/emblems/16/writing.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_bathing.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_cinema.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_internet.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_restroom.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_shopping.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_studying.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_suit.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_surfing.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_typing.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_working.png delete mode 100644 pidgin/pixmaps/emblems/16/xstatus_writing.png diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index e9bd254d23..3f7c3b2a9a 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -272,13 +272,13 @@ static const struct { {0x48, 0x8e, 0x14, 0x89, 0x8a, 0xca, 0x4a, 0x08, 0x82, 0xaa, 0x77, 0xce, 0x7a, 0x16, 0x52, 0x08}}, - {"xstatus_shopping", N_("Shopping"), + {"shopping", N_("Shopping"), {0x63, 0x62, 0x73, 0x37, 0xa0, 0x3f, 0x49, 0xff, 0x80, 0xe5, 0xf7, 0x09, 0xcd, 0xe0, 0xa4, 0xee}}, /* This was in the original patch, but isn't what the official client * (ICQ 6) sets when you choose its typewriter icon. */ - {"xstatus_typing", NULL, + {"typing", NULL, {0x63, 0x4f, 0x6b, 0xd8 ,0xad, 0xd2, 0x4a, 0xa1, 0xaa, 0xb9, 0x11, 0x5b, 0xc2, 0x6d, 0x05, 0xa1}}, @@ -294,7 +294,7 @@ static const struct { {0xf8, 0xe8, 0xd7, 0xb2, 0x82, 0xc4, 0x41, 0x42, 0x90, 0xf8, 0x10, 0xc6, 0xce, 0x0a, 0x89, 0xa6}}, - {"xstatus_cinema", N_("Watching a movie"), + {"cinema", N_("Watching a movie"), {0x10, 0x7a, 0x9a, 0x18, 0x12, 0x32, 0x4d, 0xa4, 0xb6, 0xcd, 0x08, 0x79, 0xdb, 0x78, 0x0f, 0x09}}, @@ -302,15 +302,15 @@ static const struct { {0x1f, 0x7a, 0x40, 0x71, 0xbf, 0x3b, 0x4e, 0x60, 0xbc, 0x32, 0x4c, 0x57, 0x87, 0xb0, 0x4c, 0xf1}}, - {"xstatus_typing", N_("Typing"), + {"typing", N_("Typing"), {0x2c, 0xe0, 0xe4, 0xe5, 0x7c, 0x64, 0x43, 0x70, 0x9c, 0x3a, 0x7a, 0x1c, 0xe8, 0x78, 0xa7, 0xdc}}, - {"xstatus_suit", N_("At the office"), + {"suit", N_("At the office"), {0xb7, 0x08, 0x67, 0xf5, 0x38, 0x25, 0x43, 0x27, 0xa1, 0xff, 0xcf, 0x4c, 0xc1, 0x93, 0x97, 0x97}}, - {"xstatus_bathing", N_("Taking a bath"), + {"bathing", N_("Taking a bath"), {0x5a, 0x58, 0x1e, 0xa1, 0xe5, 0x80, 0x43, 0x0c, 0xa0, 0x6f, 0x61, 0x22, 0x98, 0xb7, 0xe4, 0xc7}}, @@ -347,7 +347,7 @@ static const struct { {0x12, 0x92, 0xe5, 0x50, 0x1b, 0x64, 0x4f, 0x66, 0xb2, 0x06, 0xb2, 0x9a, 0xf3, 0x78, 0xe4, 0x8d}}, - {"xstatus_surfing", N_("Surfing"), + {"surfing", N_("Surfing"), {0xa6, 0xed, 0x55, 0x7e, 0x6b, 0xf7, 0x44, 0xd4, 0xa5, 0xd4, 0xd2, 0xe7, 0xd9, 0x5c, 0xe8, 0x1f}}, @@ -373,7 +373,7 @@ static const struct { {0xd4, 0xa6, 0x11, 0xd0, 0x8f, 0x01, 0x4e, 0xc0, 0x92, 0x23, 0xc5, 0xb6, 0xbe, 0xc6, 0xcc, 0xf0}}, - {"xstatus_internet", N_("Browsing the web"), + {"internet", N_("Browsing the web"), {0x12, 0xd0, 0x7e, 0x3e, 0xf8, 0x85, 0x48, 0x9e, 0x8e, 0x97, 0xa7, 0x2a, 0x65, 0x51, 0xe5, 0x8d}}, @@ -381,7 +381,7 @@ static const struct { {0x64, 0x43, 0xc6, 0xaf, 0x22, 0x60, 0x45, 0x17, 0xb5, 0x8c, 0xd7, 0xdf, 0x8e, 0x29, 0x03, 0x52}}, - {"xstatus_writing", N_("Writing"), + {"writing", N_("Writing"), {0x00, 0x72, 0xd9, 0x08, 0x4a, 0xd1, 0x43, 0xdd, 0x91, 0x99, 0x6f, 0x02, 0x69, 0x66, 0x02, 0x6f}}, @@ -394,15 +394,15 @@ static const struct { {0x61, 0xbe, 0xe0, 0xdd, 0x8b, 0xdd, 0x47, 0x5d, 0x8d, 0xee, 0x5f, 0x4b, 0xaa, 0xcf, 0x19, 0xa7}}, - {"xstatus_studying", N_("Studying"), + {"studying", N_("Studying"), {0x60, 0x9d, 0x52, 0xf8, 0xa2, 0x9a, 0x49, 0xa6, 0xb2, 0xa0, 0x25, 0x24, 0xc5, 0xe9, 0xd2, 0x60}}, - {"xstatus_working", N_("Working"), + {"working", N_("Working"), {0xba, 0x74, 0xdb, 0x3e, 0x9e, 0x24, 0x43, 0x4b, 0x87, 0xb6, 0x2f, 0x6b, 0x8d, 0xfe, 0xe5, 0x0f}}, - {"xstatus_restroom", N_("In the restroom"), + {"restroom", N_("In the restroom"), {0x16, 0xf5, 0xb7, 0x6f, 0xa9, 0xd2, 0x40, 0x35, 0x8c, 0xc5, 0xc0, 0x84, 0x70, 0x3c, 0x98, 0xfa}} }; diff --git a/pidgin/pixmaps/emblems/16/bathing.png b/pidgin/pixmaps/emblems/16/bathing.png new file mode 100644 index 0000000000..662eb2ac97 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/bathing.png differ diff --git a/pidgin/pixmaps/emblems/16/cinema.png b/pidgin/pixmaps/emblems/16/cinema.png new file mode 100644 index 0000000000..e561cb0791 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/cinema.png differ diff --git a/pidgin/pixmaps/emblems/16/internet.png b/pidgin/pixmaps/emblems/16/internet.png new file mode 100644 index 0000000000..9281221f98 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/internet.png differ diff --git a/pidgin/pixmaps/emblems/16/restroom.png b/pidgin/pixmaps/emblems/16/restroom.png new file mode 100644 index 0000000000..a642e7d53c Binary files /dev/null and b/pidgin/pixmaps/emblems/16/restroom.png differ diff --git a/pidgin/pixmaps/emblems/16/shopping.png b/pidgin/pixmaps/emblems/16/shopping.png new file mode 100644 index 0000000000..291107ae64 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/shopping.png differ diff --git a/pidgin/pixmaps/emblems/16/studying.png b/pidgin/pixmaps/emblems/16/studying.png new file mode 100644 index 0000000000..0a6053f86c Binary files /dev/null and b/pidgin/pixmaps/emblems/16/studying.png differ diff --git a/pidgin/pixmaps/emblems/16/suit.png b/pidgin/pixmaps/emblems/16/suit.png new file mode 100644 index 0000000000..3c0080f0dd Binary files /dev/null and b/pidgin/pixmaps/emblems/16/suit.png differ diff --git a/pidgin/pixmaps/emblems/16/surfing.png b/pidgin/pixmaps/emblems/16/surfing.png new file mode 100644 index 0000000000..727b352f72 Binary files /dev/null and b/pidgin/pixmaps/emblems/16/surfing.png differ diff --git a/pidgin/pixmaps/emblems/16/typing.png b/pidgin/pixmaps/emblems/16/typing.png new file mode 100644 index 0000000000..7f60b0a25e Binary files /dev/null and b/pidgin/pixmaps/emblems/16/typing.png differ diff --git a/pidgin/pixmaps/emblems/16/working.png b/pidgin/pixmaps/emblems/16/working.png new file mode 100644 index 0000000000..cc90d637df Binary files /dev/null and b/pidgin/pixmaps/emblems/16/working.png differ diff --git a/pidgin/pixmaps/emblems/16/writing.png b/pidgin/pixmaps/emblems/16/writing.png new file mode 100644 index 0000000000..e8b5d0d53e Binary files /dev/null and b/pidgin/pixmaps/emblems/16/writing.png differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_bathing.png b/pidgin/pixmaps/emblems/16/xstatus_bathing.png deleted file mode 100644 index 662eb2ac97..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_bathing.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_cinema.png b/pidgin/pixmaps/emblems/16/xstatus_cinema.png deleted file mode 100644 index e561cb0791..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_cinema.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_internet.png b/pidgin/pixmaps/emblems/16/xstatus_internet.png deleted file mode 100644 index 9281221f98..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_internet.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_restroom.png b/pidgin/pixmaps/emblems/16/xstatus_restroom.png deleted file mode 100644 index a642e7d53c..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_restroom.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_shopping.png b/pidgin/pixmaps/emblems/16/xstatus_shopping.png deleted file mode 100644 index 291107ae64..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_shopping.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_studying.png b/pidgin/pixmaps/emblems/16/xstatus_studying.png deleted file mode 100644 index 0a6053f86c..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_studying.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_suit.png b/pidgin/pixmaps/emblems/16/xstatus_suit.png deleted file mode 100644 index 3c0080f0dd..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_suit.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_surfing.png b/pidgin/pixmaps/emblems/16/xstatus_surfing.png deleted file mode 100644 index 727b352f72..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_surfing.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_typing.png b/pidgin/pixmaps/emblems/16/xstatus_typing.png deleted file mode 100644 index 7f60b0a25e..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_typing.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_working.png b/pidgin/pixmaps/emblems/16/xstatus_working.png deleted file mode 100644 index cc90d637df..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_working.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/xstatus_writing.png b/pidgin/pixmaps/emblems/16/xstatus_writing.png deleted file mode 100644 index e8b5d0d53e..0000000000 Binary files a/pidgin/pixmaps/emblems/16/xstatus_writing.png and /dev/null differ -- cgit v1.2.1 From d6fc6601f2e646bd0298d5a66c15a70bd3a80e3a Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 18:53:25 +0000 Subject: Added the additional moods defined in XEP-0107 version 1.2 (2008-10-29): http://xmpp.org/extensions/xep-0107.html --- libpurple/protocols/jabber/usermood.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libpurple/protocols/jabber/usermood.c b/libpurple/protocols/jabber/usermood.c index 3ff09d0402..dfd38cf15a 100644 --- a/libpurple/protocols/jabber/usermood.c +++ b/libpurple/protocols/jabber/usermood.c @@ -31,6 +31,7 @@ static const char * const moodstrings[] = { "afraid", "amazed", + "amorous", "angry", "annoyed", "anxious", @@ -39,22 +40,33 @@ static const char * const moodstrings[] = { "bored", "brave", "calm", + "cautious", "cold", + "confident", "confused", + "contemplative", "contented", "cranky", + "crazy", + "creative", "curious", + "dejected", "depressed", "disappointed", "disgusted", + "dismayed", "distracted", "embarrassed", + "envious", "excited", "flirtatious", "frustrated", + "grateful", + "grieving", "grumpy", "guilty", "happy", + "hopeful", "hot", "humbled", "humiliated", @@ -69,26 +81,37 @@ static const char * const moodstrings[] = { "invincible", "jealous", "lonely", + "lost", + "lucky", "mean", "moody", "nervous", "neutral", "offended", + "outraged", "playful", "proud", + "relaxed", "relieved", "remorseful", "restless", "sad", "sarcastic", + "satisfied", "serious", "shocked", "shy", "sick", "sleepy", + "spontaneous", "stressed", + "strong", "surprised", + "thankful", "thirsty", + "tired", + "undefined", + "weak", "worried", NULL }; -- cgit v1.2.1 From 8c2c46204ceec6a5219ff3346209897035a9213a Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 18:56:16 +0000 Subject: Do not show "Mood: mood ()" when there is no text. --- libpurple/protocols/jabber/jabber.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 49fa5299a6..7ad64da016 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -1572,7 +1572,7 @@ void jabber_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboole if(mood != NULL) { const char *moodtext; moodtext = purple_status_get_attr_string(status, "moodtext"); - if(moodtext != NULL) { + if(moodtext && *moodtext) { char *moodplustext = g_strdup_printf("%s (%s)", mood, moodtext); purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext); -- cgit v1.2.1 From 337aba73a4f9ce7a115aaecae0a0b060cb64fd8c Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 19:10:57 +0000 Subject: Drop xstatus_ from the icon names. --- pidgin/pixmaps/Makefile.am | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index cc3797f395..6bf7fb7219 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -171,17 +171,17 @@ EMBLEMS_16 = \ emblems/16/unavailable.png \ emblems/16/video.png \ emblems/16/voice.png \ - emblems/16/xstatus_bathing.png \ - emblems/16/xstatus_cinema.png \ - emblems/16/xstatus_internet.png \ - emblems/16/xstatus_restroom.png \ - emblems/16/xstatus_shopping.png \ - emblems/16/xstatus_studying.png \ - emblems/16/xstatus_suit.png \ - emblems/16/xstatus_surfing.png \ - emblems/16/xstatus_typing.png \ - emblems/16/xstatus_working.png \ - emblems/16/xstatus_writing.png + emblems/16/bathing.png \ + emblems/16/cinema.png \ + emblems/16/internet.png \ + emblems/16/restroom.png \ + emblems/16/shopping.png \ + emblems/16/studying.png \ + emblems/16/suit.png \ + emblems/16/surfing.png \ + emblems/16/typing.png \ + emblems/16/working.png \ + emblems/16/writing.png EMOTES_DEFAULT_24_SCALABLE = \ -- cgit v1.2.1 From fc1a33377f6ea8257d2f3bf5aa2f13ec8046a00b Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 19:17:07 +0000 Subject: Check that mood is not the empty string, just to be safe. --- libpurple/protocols/jabber/jabber.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 7ad64da016..70071bcfb5 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -1569,7 +1569,7 @@ void jabber_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboole status = purple_presence_get_active_status(presence); mood = purple_status_get_attr_string(status, "mood"); - if(mood != NULL) { + if(mood && *mood) { const char *moodtext; moodtext = purple_status_get_attr_string(status, "moodtext"); if(moodtext && *moodtext) { -- cgit v1.2.1 From 15b1dff8f2c098a5845495eb084e9777ff8e1bc9 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sun, 16 Nov 2008 19:17:27 +0000 Subject: Look at the mood status attribute on a buddy when picking the emblem. --- pidgin/gtkblist.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index b197b3544c..0dcf260c93 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -3658,8 +3658,12 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) if (prpl_info && prpl_info->list_emblem) name = prpl_info->list_emblem(buddy); - if (name == NULL) - return NULL; + if (name == NULL) { + PurpleStatus *status = purple_presence_get_active_status(p); + name = purple_status_get_attr_string(status, "mood"); + if(!(name && *name)) + return NULL; + } filename = g_strdup_printf("%s.png", name); -- cgit v1.2.1 From e8dad92dbc7ed4f5e6b02645612c3a9c3a039e19 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 00:43:59 +0000 Subject: Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it. --- ChangeLog.API | 5 + libpurple/protocols/jabber/jabber.c | 18 +-- libpurple/protocols/oscar/family_buddy.c | 12 +- libpurple/protocols/oscar/family_locate.c | 200 ++++++++++++++++++------------ libpurple/protocols/oscar/oscar.c | 87 ++++++++----- libpurple/protocols/oscar/oscar.h | 16 +-- libpurple/protocols/oscar/tlv.c | 7 +- libpurple/status.c | 20 +-- libpurple/status.h | 7 +- pidgin/gtkblist.c | 28 +++-- pidgin/gtksavedstatuses.c | 9 +- 11 files changed, 254 insertions(+), 155 deletions(-) diff --git a/ChangeLog.API b/ChangeLog.API index fb73a46024..29868cbe04 100644 --- a/ChangeLog.API +++ b/ChangeLog.API @@ -1,5 +1,10 @@ Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul +version 2.6.0 (??/??/????): + libpurple: + Added: + * PURPLE_STATUS_MOOD as a new PurpleStatusPrimitive + version 2.5.0 (08/18/2008): libpurple: Added: diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 70071bcfb5..80ec33729d 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -1658,7 +1658,7 @@ GList *jabber_status_types(PurpleAccount *account) "nick", _("Nickname"), purple_value_new(PURPLE_TYPE_STRING), "buzz", _("Allow Buzz"), purple_value_new(PURPLE_TYPE_BOOLEAN), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); priority_value = purple_value_new(PURPLE_TYPE_INT); purple_value_set_int(priority_value, 1); @@ -1672,7 +1672,7 @@ GList *jabber_status_types(PurpleAccount *account) "nick", _("Nickname"), purple_value_new(PURPLE_TYPE_STRING), "buzz", _("Allow Buzz"), purple_value_new(PURPLE_TYPE_BOOLEAN), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); priority_value = purple_value_new(PURPLE_TYPE_INT); purple_value_set_int(priority_value, 0); @@ -1686,7 +1686,7 @@ GList *jabber_status_types(PurpleAccount *account) "nick", _("Nickname"), purple_value_new(PURPLE_TYPE_STRING), "buzz", _("Allow Buzz"), purple_value_new(PURPLE_TYPE_BOOLEAN), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); priority_value = purple_value_new(PURPLE_TYPE_INT); purple_value_set_int(priority_value, 0); @@ -1700,7 +1700,7 @@ GList *jabber_status_types(PurpleAccount *account) "nick", _("Nickname"), purple_value_new(PURPLE_TYPE_STRING), "buzz", _("Allow Buzz"), purple_value_new(PURPLE_TYPE_BOOLEAN), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); priority_value = purple_value_new(PURPLE_TYPE_INT); purple_value_set_int(priority_value, 0); @@ -1714,11 +1714,11 @@ GList *jabber_status_types(PurpleAccount *account) "nick", _("Nickname"), purple_value_new(PURPLE_TYPE_STRING), "buzz", _("Allow Buzz"), purple_value_new(PURPLE_TYPE_BOOLEAN), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); /* if(js->protocol_version == JABBER_PROTO_0_9) - m = g_list_append(m, _("Invisible")); + "Invisible" */ type = purple_status_type_new_with_attrs(PURPLE_STATUS_OFFLINE, @@ -1726,7 +1726,7 @@ GList *jabber_status_types(PurpleAccount *account) NULL, FALSE, TRUE, FALSE, "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); type = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE, "tune", NULL, TRUE, TRUE, TRUE, @@ -1740,9 +1740,9 @@ GList *jabber_status_types(PurpleAccount *account) PURPLE_TUNE_YEAR, _("Tune Year"), purple_value_new(PURPLE_TYPE_INT), PURPLE_TUNE_URL, _("Tune URL"), purple_value_new(PURPLE_TYPE_STRING), NULL); - types = g_list_append(types, type); + types = g_list_prepend(types, type); - return types; + return g_list_reverse(types); } static void diff --git a/libpurple/protocols/oscar/family_buddy.c b/libpurple/protocols/oscar/family_buddy.c index 7ea559fb88..5907d7a023 100644 --- a/libpurple/protocols/oscar/family_buddy.c +++ b/libpurple/protocols/oscar/family_buddy.c @@ -225,9 +225,17 @@ buddychange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *f aim_locate_autofetch_away_message(od, userinfo.sn); if (snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING && - userinfo.capabilities & OSCAR_CAPABILITY_XTRAZ && userinfo.customicon > 0) - icq_im_xstatus_request(od, userinfo.sn); + userinfo.capabilities & OSCAR_CAPABILITY_XTRAZ) { + PurpleAccount *account = purple_connection_get_account(od->gc); + PurpleBuddy *buddy = purple_find_buddy(account, userinfo.sn); + if (buddy) { + PurplePresence *presence = purple_buddy_get_presence(buddy); + + if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) + icq_im_xstatus_request(od, userinfo.sn); + } + } aim_info_free(&userinfo); return ret; diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index 3f7c3b2a9a..31e784fb44 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -252,13 +252,11 @@ static const struct { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, }; -#define AIM_CUSTOM_ICONS_COUNT 35 - static const struct { - char *filename; + char *mood; char *descriptivename; guint8 data[16]; -} aim_custom_icons[AIM_CUSTOM_ICONS_COUNT] = { +} aim_custom_icons[] = { /* empty X-Status for the case when customicon == 0 */ {NULL, NULL, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -443,8 +441,6 @@ aim_locate_adduserinfo(OscarData *od, aim_userinfo_t *userinfo) cur->sessionlen = userinfo->sessionlen; if (userinfo->capabilities != 0) cur->capabilities = userinfo->capabilities; - if (userinfo->customicon != 0) - cur->customicon = userinfo->customicon; cur->present |= userinfo->present; @@ -643,11 +639,11 @@ aim_locate_getcaps(OscarData *od, ByteStream *bs, int len) return flags; } -gint32 -aim_get_custom_icon(OscarData *od, ByteStream *bs, int len) +static const char * +aim_receive_custom_icon(OscarData *od, ByteStream *bs, int len) { int offset; - gint32 result = -1; + const char *result = NULL; for (offset = 0; byte_stream_empty(bs) && (offset < len); offset += 0x10) { /* check wheather this capability is a custom user icon */ @@ -656,10 +652,10 @@ aim_get_custom_icon(OscarData *od, ByteStream *bs, int len) cap = byte_stream_getraw(bs, 0x10); - for (i = 1; i < AIM_CUSTOM_ICONS_COUNT; i++) { + for (i = 1; i < G_N_ELEMENTS(aim_custom_icons); i++) { if (memcmp(&aim_custom_icons[i].data, cap, 0x10) == 0) { purple_debug_misc("oscar", "Custom status icon: %s\n", aim_custom_icons[i].descriptivename); - result = i; + result = aim_custom_icons[i].mood; break; /* should only match once... */ } } @@ -759,36 +755,36 @@ aim_info_free(aim_userinfo_t *info) g_free(info->away_encoding); } -#define ICQMOODS_COUNT 23 - static const struct { - char *mood; - gint32 icon_num; -} icqmoods[ICQMOODS_COUNT] = { - {"icqmood0", 3}, - {"icqmood1", 12}, - {"icqmood2", 18}, - {"icqmood3", 24}, - {"icqmood4", 30}, - {"icqmood5", 1}, - {"icqmood6", 7}, - {"icqmood7", 13}, - {"icqmood8", 19}, - {"icqmood9", 25}, - {"icqmood10", 31}, - {"icqmood11", 11}, - {"icqmood12", 8}, - {"icqmood13", 14}, - {"icqmood14", 20}, - {"icqmood15", 26}, - {"icqmood16", 32}, - {"icqmood17", 9}, - {"icqmood18", 15}, - {"icqmood19", 21}, - {"icqmood20", 27}, - {"icqmood21", 33}, - {"icqmood22", 10}, - {"icqmood23", 6}, + char *icqmood; + const char *mood; +} icqmoods[] = { + {"icqmood0", "shopping"}, + {"icqmood1", "bathing"}, + {"icqmood2", "yawn"}, + {"icqmood3", "party"}, + {"icqmood4", "beer"}, + {"icqmood5", "thinking"}, + {"icqmood6", "plate"}, + {"icqmood7", "tv"}, + {"icqmood8", "meeting"}, + {"icqmood9", "coffee"}, + {"icqmood10", "music"}, + {"icqmood11", "suit"}, + {"icqmood12", "cinema"}, + {"icqmood13", "smile-big"}, + {"icqmood14", "phone"}, + {"icqmood15", "console"}, + {"icqmood16", "studying"}, + {"icqmood17", "sick"}, + {"icqmood18", "sleepy"}, + {"icqmood19", "surfing"}, + {"icqmood20", "internet"}, + {"icqmood21", "working"}, + {"icqmood22", "typing"}, + {"icqmood23", "angry"}, + {NULL, 0} + }; /* @@ -946,13 +942,23 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) outinfo->present |= AIM_USERINFO_PRESENT_ICQDATA; } else if (type == 0x000d) { + PurpleAccount *account = purple_connection_get_account(od->gc); + const char *mood; + /* * OSCAR Capability information */ outinfo->capabilities |= aim_locate_getcaps(od, bs, length); outinfo->present |= AIM_USERINFO_PRESENT_CAPABILITIES; byte_stream_setpos(bs, curpos); - outinfo->customicon = aim_get_custom_icon(od, bs, length); + + mood = aim_receive_custom_icon(od, bs, length); + if (mood) + purple_prpl_got_user_status(account, outinfo->sn, "mood", + PURPLE_MOOD_NAME, mood, + NULL); + else + purple_prpl_got_user_status_deactive(account, outinfo->sn, "mood"); } else if (type == 0x000e) { /* @@ -1083,33 +1089,34 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) } break; case 0x000e: { /* ICQ mood */ - char *mood; + PurpleAccount *account = purple_connection_get_account(od->gc); + char *icqmood; gint32 i; - gint32 icon_num = -1; - - mood = byte_stream_getstr(bs, length2); - - /* The official clients allow - * you to set your custom icon - * to the "default" icon, to - * allow setting a status - * message. We'll ignore it. - */ - if (!*mood) - break; - - for (i = 0; i < ICQMOODS_COUNT; i++) - if (!strcmp(mood, icqmoods[i].mood)) { - icon_num = icqmoods[i].icon_num; - break; /* should only match once... */ + const char *mood = NULL; + + icqmood = byte_stream_getstr(bs, length2); + + /* icqmood = "" means X-Status + * with no mood icon. */ + if (*icqmood) { + for (i = 0; icqmoods[i].icqmood; i++) { + if (!strcmp(icqmood, icqmoods[i].icqmood)) { + mood = icqmoods[i].mood; + break; /* should only match once... */ + } } - if (icon_num >= 0) - outinfo->customicon = icon_num; - else - purple_debug_warning("oscar", "Unknown icqmood: %s\n", mood); + if (!mood) + purple_debug_warning("oscar", "Unknown icqmood: %s\n", icqmood); + } + g_free(icqmood); - g_free(mood); + if (mood) + purple_prpl_got_user_status(account, outinfo->sn, "mood", + PURPLE_MOOD_NAME, mood, + NULL); + else + purple_prpl_got_user_status_deactive(account, outinfo->sn, "mood"); } break; } @@ -1155,6 +1162,10 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) return 0; } +/* Apparently, this is never called. + * If you activate it, figure out a way to know what mood to pass to + * aim_tlvlist_add_caps() below. --rlaager */ +#if 0 /* * Inverse of aim_info_extract() */ @@ -1190,8 +1201,9 @@ aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info) } #endif - if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES) - aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities, info->customicon); + if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES) { + aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities, NULL); + } if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN) aim_tlvlist_add_32(&tlvlist, (guint16)((info->flags & AIM_FLAG_AOL) ? 0x0010 : 0x000f), info->sessionlen); @@ -1202,6 +1214,7 @@ aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info) return 0; } +#endif /* * Subtype 0x0001 @@ -1391,6 +1404,10 @@ int aim_locate_setcaps(OscarData *od, guint32 caps) { FlapConnection *conn; + PurpleAccount *account = purple_connection_get_account(od->gc); + PurplePresence *presence = purple_account_get_presence(account); + PurpleStatus *status = purple_presence_get_status(presence, "mood"); + const char *mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); ByteStream bs; aim_snacid_t snacid; GSList *tlvlist = NULL; @@ -1398,7 +1415,7 @@ aim_locate_setcaps(OscarData *od, guint32 caps) if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE))) return -EINVAL; - aim_tlvlist_add_caps(&tlvlist, 0x0005, caps, purple_account_get_int(purple_connection_get_account(od->gc), "customicon", -1)); + aim_tlvlist_add_caps(&tlvlist, 0x0005, caps, mood); byte_stream_new(&bs, aim_tlvlist_size(tlvlist)); @@ -1482,11 +1499,21 @@ userinfo(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *fram /* Caps will be 5 */ if ((tlv = aim_tlv_gettlv(tlvlist, 0x0005, 1))) { ByteStream cbs; + PurpleAccount *account = purple_connection_get_account(od->gc); + const char *mood; + byte_stream_init(&cbs, tlv->value, tlv->length); userinfo->capabilities = aim_locate_getcaps(od, &cbs, tlv->length); byte_stream_rewind(&cbs); - userinfo->customicon = aim_get_custom_icon(od, &cbs, tlv->length); userinfo->present = AIM_USERINFO_PRESENT_CAPABILITIES; + + mood = aim_receive_custom_icon(od, &cbs, tlv->length); + if (mood) + purple_prpl_got_user_status(account, userinfo->sn, "mood", + PURPLE_MOOD_NAME, mood, + NULL); + else + purple_prpl_got_user_status_deactive(account, userinfo->sn, "mood"); } aim_tlvlist_free(tlvlist); @@ -1714,32 +1741,43 @@ locate_modfirst(OscarData *od, aim_module_t *mod) return 0; } -guint32 -aim_get_custom_icons_count() +#if 1 //rlaager +size_t aim_get_custom_icons_count(void) { - return AIM_CUSTOM_ICONS_COUNT; + return G_N_ELEMENTS(aim_custom_icons); } -char* -aim_get_custom_icon_filename(gint32 no) +char* aim_get_custom_icon_mood(gint32 no) { - if (no >= AIM_CUSTOM_ICONS_COUNT || no < 1) + if (no >= G_N_ELEMENTS(aim_custom_icons) || no < 1) return NULL; - return aim_custom_icons[no].filename; + return aim_custom_icons[no].mood; } -char* -aim_get_custom_icon_descriptivename(gint32 no) +char* aim_get_custom_icon_descriptivename(gint32 no) { - if (no >= AIM_CUSTOM_ICONS_COUNT || no < 1) + if (no >= G_N_ELEMENTS(aim_custom_icons) || no < 1) return NULL; return aim_custom_icons[no].descriptivename; } +#endif guint8* -aim_get_custom_icon_data(gint32 no) +aim_get_custom_icon_data(const char *mood) { - if (no >= AIM_CUSTOM_ICONS_COUNT || no < 1) + int i; + + if (!(mood && *mood)) return NULL; - return (guint8 *)aim_custom_icons[no].data; + + for (i = 1; i < G_N_ELEMENTS(aim_custom_icons); i++) { + /* We check that descriptivename is not NULL to exclude + * duplicates, like the typing duplicate. */ + if (aim_custom_icons[i].descriptivename && + aim_custom_icons[i].mood && + !strcmp(mood, aim_custom_icons[i].mood)) { + return (guint8 *)aim_custom_icons[i].data; + } + } + return NULL; } diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 920ef64a25..3e2844741d 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -4865,6 +4865,10 @@ oscar_set_status(PurpleAccount *account, PurpleStatus *status) if (!purple_account_is_connected(account)) return; + /* There's no need to do the stuff below for mood updates. */ + if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) + return; + /* Set the AIM-style away message for both AIM and ICQ accounts */ oscar_set_info_and_status(account, FALSE, NULL, TRUE, status); @@ -5853,7 +5857,6 @@ const char *oscar_list_emblem(PurpleBuddy *b) } if (userinfo != NULL ) { - const char *icon; if (userinfo->flags & AIM_FLAG_ADMINISTRATOR) return "admin"; if (userinfo->flags & AIM_FLAG_ACTIVEBUDDY) @@ -5862,8 +5865,11 @@ const char *oscar_list_emblem(PurpleBuddy *b) return "secure"; if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) return "birthday"; - if ((icon = aim_get_custom_icon_filename(userinfo->customicon))) - return icon; + + /* Make the mood icon override anything below this. */ + if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) + return NULL; + if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) return "hiptop"; } @@ -6181,9 +6187,14 @@ oscar_status_types(PurpleAccount *account) NULL, TRUE, TRUE, FALSE); status_types = g_list_prepend(status_types, type); - status_types = g_list_reverse(status_types); + type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD, + "mood", NULL, TRUE, is_icq, TRUE, + PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(PURPLE_TYPE_STRING), + PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(PURPLE_TYPE_STRING), + NULL); + status_types = g_list_prepend(status_types, type); - return status_types; + return g_list_reverse(status_types); } static void oscar_ssi_editcomment(struct name_data *data, const char *text) { @@ -6751,87 +6762,98 @@ oscar_send_file(PurpleConnection *gc, const char *who, const char *file) purple_xfer_request(xfer); } +/* XXX: rlaager wants UI in the UI. */ +#if 1 static void -oscar_show_icq_custom_icons_cb(PurpleConnection *gc, PurpleRequestFields *fields) { +oscar_show_icq_moods_cb(PurpleConnection *gc, PurpleRequestFields *fields) { OscarData *od = gc->proto_data; - PurpleAccount *account = purple_connection_get_account(gc); PurpleRequestField *f; GList *l; - f = purple_request_fields_get_field(fields, "customicon"); + f = purple_request_fields_get_field(fields, "mood"); l = purple_request_field_list_get_selected(f); if (l) { - gpointer d = purple_request_field_list_get_data(f, l->data); - purple_account_set_int(account, "customicon", GPOINTER_TO_INT(d)); + const char *mood = purple_request_field_list_get_data(f, l->data); + PurpleAccount *account = purple_connection_get_account(gc); + + if (mood != NULL) { + purple_account_set_status(account, "mood", TRUE, + PURPLE_MOOD_NAME, mood, + NULL); + } else { + purple_account_set_status(account, "mood", FALSE, NULL); + } } - + aim_locate_setcaps(od, purple_caps); } static void -oscar_show_icq_custom_icons(PurplePluginAction *action) +oscar_show_icq_moods(PurplePluginAction *action) { - guint32 i; - gint32 customicon; PurpleConnection *gc = (PurpleConnection *) action->context; PurpleAccount *account = purple_connection_get_account(gc); + PurplePresence *presence = purple_account_get_presence(account); + PurpleStatus *status = purple_presence_get_status(presence, "mood"); + const char *current_mood; PurpleRequestFields *fields; PurpleRequestFieldGroup *g; PurpleRequestField *f; + guint32 i; char* na_fn; - customicon = purple_account_get_int(account, "customicon", 0); - + current_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); + fields = purple_request_fields_new(); g = purple_request_field_group_new(NULL); - - f = purple_request_field_list_new("customicon", _("Choose a custom status icon")); + + f = purple_request_field_list_new("mood", _("Please select your mood from the list.")); na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); - purple_request_field_list_add_icon(f, _("None"), na_fn, GINT_TO_POINTER(-1)); - if (customicon == 0) + purple_request_field_list_add_icon(f, _("None"), na_fn, NULL); + if (current_mood == NULL) purple_request_field_list_add_selected(f, _("None")); g_free(na_fn); /* TODO: rlaager wants this sorted. */ for (i = 1; i < aim_get_custom_icons_count(); i++) { - const char *icon_filename = aim_get_custom_icon_filename(i); + const char *mood = aim_get_custom_icon_mood(i); const char *icon_desc = aim_get_custom_icon_descriptivename(i); char *icon_path; char *filename; - if (icon_filename == NULL || icon_desc == NULL) + if (mood == NULL || icon_desc == NULL) continue; - icon_path = g_strdup_printf("%s.png", icon_filename); + icon_path = g_strdup_printf("%s.png", mood); filename = g_build_filename("pixmaps", "pidgin", "emblems", "16", icon_path, NULL); g_free(icon_path); purple_request_field_list_add_icon(f, _(icon_desc), - filename, GINT_TO_POINTER(i)); + filename, (gpointer)mood); g_free(filename); - if (customicon == i) + if (current_mood && !strcmp(current_mood, mood)) purple_request_field_list_add_selected(f, _(icon_desc)); } purple_request_field_group_add_field(g, f); purple_request_fields_add_group(fields, g); - purple_request_fields(gc, _("Custom Status Icon"), _("Custom Status Icon"), + purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), NULL, fields, - _("OK"), G_CALLBACK(oscar_show_icq_custom_icons_cb), + _("OK"), G_CALLBACK(oscar_show_icq_moods_cb), _("Cancel"), NULL, purple_connection_get_account(gc), NULL, NULL, gc); } - +#endif GList * oscar_actions(PurplePlugin *plugin, gpointer context) @@ -6875,10 +6897,13 @@ oscar_actions(PurplePlugin *plugin, gpointer context) act = purple_plugin_action_new(_("Set Privacy Options..."), oscar_show_icq_privacy_opts); menu = g_list_prepend(menu, act); - - act = purple_plugin_action_new(_("Set Custom Status Icon..."), - oscar_show_icq_custom_icons); + +/* XXX: rlaager wants UI in the UI. */ +#if 1 + act = purple_plugin_action_new(_("Set Mood..."), + oscar_show_icq_moods); menu = g_list_prepend(menu, act); +#endif } else { diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h index 3b15a72bec..a22c7bb025 100644 --- a/libpurple/protocols/oscar/oscar.h +++ b/libpurple/protocols/oscar/oscar.h @@ -1028,7 +1028,6 @@ typedef struct aim_userinfo_s guint32 onlinesince; /* time_t */ guint32 sessionlen; /* in seconds */ guint32 capabilities; - gint32 customicon; struct { guint32 status; guint32 ipaddr; @@ -1106,12 +1105,15 @@ guint32 aim_locate_getcaps(OscarData *od, ByteStream *bs, int len); guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len); void aim_info_free(aim_userinfo_t *); int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *); +#if 0 int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info); -gint32 aim_get_custom_icon(OscarData *od, ByteStream *bs, int len); -guint32 aim_get_custom_icons_count(void); -char* aim_get_custom_icon_filename(gint32 no); -char* aim_get_custom_icon_descriptivename(gint32 no); -guint8* aim_get_custom_icon_data(gint32 no); +#endif +#if 1 +size_t aim_get_custom_icons_count(void); //rlaager +char* aim_get_custom_icon_mood(gint32 no);// rlaager +char* aim_get_custom_icon_descriptivename(gint32 no); // rlaager +#endif +guint8* aim_get_custom_icon_data(const char *mood); int icq_im_xstatus_request(OscarData *od, const char *sn); /* 0x0003 - family_buddy.c */ @@ -1442,7 +1444,7 @@ int aim_tlvlist_add_8(GSList **list, const guint16 type, const guint8 value); int aim_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value); int aim_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value); int aim_tlvlist_add_str(GSList **list, const guint16 type, const char *value); -int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, gint32 customicon); +int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, const char *mood); int aim_tlvlist_add_userinfo(GSList **list, guint16 type, aim_userinfo_t *userinfo); int aim_tlvlist_add_chatroom(GSList **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance); int aim_tlvlist_add_frozentlvlist(GSList **list, guint16 type, GSList **tl); diff --git a/libpurple/protocols/oscar/tlv.c b/libpurple/protocols/oscar/tlv.c index aeaf4cca7b..579449c121 100644 --- a/libpurple/protocols/oscar/tlv.c +++ b/libpurple/protocols/oscar/tlv.c @@ -407,7 +407,7 @@ int aim_tlvlist_add_str(GSList **list, const guint16 type, const char *value) * @param caps Bitfield of capability flags to send * @return The size of the value added. */ -int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, const gint32 customicon) +int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, const char *mood) { guint8 buf[256]; /* TODO: Don't use a fixed length buffer */ ByteStream bs; @@ -421,10 +421,9 @@ int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, byte_stream_putcaps(&bs, caps); /* adding of custom icon GUID */ - data = aim_get_custom_icon_data(customicon); - if (data != NULL) { + data = aim_get_custom_icon_data(mood); + if (data != NULL) byte_stream_putraw(&bs, data, 16); - } return aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), buf); } diff --git a/libpurple/status.c b/libpurple/status.c index 9950644b36..a4b997c13b 100644 --- a/libpurple/status.c +++ b/libpurple/status.c @@ -135,6 +135,7 @@ static int primitive_scores[] = -200, /* extended away */ -400, /* mobile */ 0, /* tune */ + 0, /* mood */ -10, /* idle, special case. */ -5, /* idle time, special case. */ 10 /* Offline messageable */ @@ -155,15 +156,16 @@ static struct PurpleStatusPrimitiveMap } const status_primitive_map[] = { - { PURPLE_STATUS_UNSET, "unset", N_("Unset") }, - { PURPLE_STATUS_OFFLINE, "offline", N_("Offline") }, - { PURPLE_STATUS_AVAILABLE, "available", N_("Available") }, - { PURPLE_STATUS_UNAVAILABLE, "unavailable", N_("Do not disturb") }, - { PURPLE_STATUS_INVISIBLE, "invisible", N_("Invisible") }, - { PURPLE_STATUS_AWAY, "away", N_("Away") }, - { PURPLE_STATUS_EXTENDED_AWAY, "extended_away", N_("Extended away") }, - { PURPLE_STATUS_MOBILE, "mobile", N_("Mobile") }, - { PURPLE_STATUS_TUNE, "tune", N_("Listening to music") } + { PURPLE_STATUS_UNSET, "unset", N_("Unset") }, + { PURPLE_STATUS_OFFLINE, "offline", N_("Offline") }, + { PURPLE_STATUS_AVAILABLE, "available", N_("Available") }, + { PURPLE_STATUS_UNAVAILABLE, "unavailable", N_("Do not disturb") }, + { PURPLE_STATUS_INVISIBLE, "invisible", N_("Invisible") }, + { PURPLE_STATUS_AWAY, "away", N_("Away") }, + { PURPLE_STATUS_EXTENDED_AWAY, "extended_away", N_("Extended away") }, + { PURPLE_STATUS_MOBILE, "mobile", N_("Mobile") }, + { PURPLE_STATUS_TUNE, "tune", N_("Listening to music"), }, + { PURPLE_STATUS_MOOD, "mood", N_("Feeling") }, }; const char * diff --git a/libpurple/status.h b/libpurple/status.h index 8cf019b763..21a398aaf4 100644 --- a/libpurple/status.h +++ b/libpurple/status.h @@ -96,8 +96,7 @@ typedef enum */ /* * If you add a value to this enum, make sure you update - * the status_primitive_map array in status.c and the special-cases for idle - * and offline-messagable just below it. + * the status_primitive_map and primitive_scores arrays in status.c. */ typedef enum { @@ -110,6 +109,7 @@ typedef enum PURPLE_STATUS_EXTENDED_AWAY, PURPLE_STATUS_MOBILE, PURPLE_STATUS_TUNE, + PURPLE_STATUS_MOOD, PURPLE_STATUS_NUM_PRIMITIVES } PurpleStatusPrimitive; @@ -129,6 +129,9 @@ typedef enum #define PURPLE_TUNE_URL "tune_url" #define PURPLE_TUNE_FULL "tune_full" +#define PURPLE_MOOD_NAME "mood" +#define PURPLE_MOOD_COMMENT "moodtext" + #ifdef __cplusplus extern "C" { #endif diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index 0dcf260c93..c71f6f8ebc 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -3606,7 +3606,7 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) PurplePluginProtocolInfo *prpl_info; const char *name = NULL; char *filename, *path; - PurplePresence *p; + PurplePresence *presence = NULL; if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { if(!gtknode->contact_expanded) { @@ -3616,8 +3616,8 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { buddy = (PurpleBuddy*)node; gtkbuddynode = node->ui_data; - p = purple_buddy_get_presence(buddy); - if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { + presence = purple_buddy_get_presence(buddy); + if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "mobile.png", NULL); return _pidgin_blist_get_cached_emblem(path); @@ -3639,13 +3639,17 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) return _pidgin_blist_get_cached_emblem(path); } - p = purple_buddy_get_presence(buddy); - if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { + /* If we came through the contact code flow above, we didn't need + * to get the presence until now. */ + if (presence == NULL) + presence = purple_buddy_get_presence(buddy); + + if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "mobile.png", NULL); return _pidgin_blist_get_cached_emblem(path); } - if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) { + if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "music.png", NULL); return _pidgin_blist_get_cached_emblem(path); } @@ -3659,9 +3663,15 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) name = prpl_info->list_emblem(buddy); if (name == NULL) { - PurpleStatus *status = purple_presence_get_active_status(p); - name = purple_status_get_attr_string(status, "mood"); - if(!(name && *name)) + PurpleStatus *status; + + if (!purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) + return NULL; + + status = purple_presence_get_status(presence, "mood"); + name = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); + + if (!(name && *name)) return NULL; } diff --git a/pidgin/gtksavedstatuses.c b/pidgin/gtksavedstatuses.c index 8c4a2afe57..e5955ed582 100644 --- a/pidgin/gtksavedstatuses.c +++ b/pidgin/gtksavedstatuses.c @@ -921,7 +921,14 @@ create_status_type_menu(PurpleStatusPrimitive type) for (i = PURPLE_STATUS_UNSET + 1; i < PURPLE_STATUS_NUM_PRIMITIVES; i++) { - if (i == PURPLE_STATUS_MOBILE || i == PURPLE_STATUS_TUNE) + /* Someone should fix this for 3.0.0. The independent boolean + * should probably be set on the status type, not the status. + * I guess that would prevent third party plugins from creating + * independent statuses? + */ + if (i == PURPLE_STATUS_MOBILE || + i == PURPLE_STATUS_MOOD || + i == PURPLE_STATUS_TUNE) /* * Special-case these. They're intended to be independent * status types, so don't show them in the list. -- cgit v1.2.1 From f9e7ef2ad7d4299a30529c19f6734697b3657f0e Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 02:07:30 +0000 Subject: The first round of renaming icons to match the XEP-0107 names. --- .mtn-ignore | 7 ++-- libpurple/protocols/oscar/family_locate.c | 12 +++---- pidgin/pixmaps/Makefile.am | 9 ++--- pidgin/pixmaps/emotes/default/24/Makefile.am | 8 ++--- pidgin/pixmaps/emotes/default/24/amorous.png | Bin 0 -> 1636 bytes pidgin/pixmaps/emotes/default/24/default.theme.in | 38 +++++++++++----------- pidgin/pixmaps/emotes/default/24/excited.png | Bin 0 -> 1420 bytes pidgin/pixmaps/emotes/default/24/in-love.png | Bin 1636 -> 0 bytes pidgin/pixmaps/emotes/default/24/in_love.png | Bin 0 -> 1339 bytes pidgin/pixmaps/emotes/default/24/love.png | Bin 1339 -> 0 bytes pidgin/pixmaps/emotes/default/24/sleeping.png | Bin 0 -> 1542 bytes pidgin/pixmaps/emotes/default/24/sleepy.png | Bin 1542 -> 1506 bytes pidgin/pixmaps/emotes/default/24/smile-big.png | Bin 1420 -> 0 bytes pidgin/pixmaps/emotes/default/24/yawn.png | Bin 1506 -> 0 bytes pidgin/pixmaps/emotes/small/16/Makefile.am | 9 ++--- pidgin/pixmaps/emotes/small/16/TODO | 3 +- pidgin/pixmaps/emotes/small/16/amorous.png | Bin 0 -> 944 bytes pidgin/pixmaps/emotes/small/16/excited.png | Bin 0 -> 916 bytes pidgin/pixmaps/emotes/small/16/in_love.png | Bin 0 -> 847 bytes pidgin/pixmaps/emotes/small/16/love.png | Bin 847 -> 0 bytes pidgin/pixmaps/emotes/small/16/sleeping.png | Bin 0 -> 912 bytes pidgin/pixmaps/emotes/small/16/sleepy.png | Bin 912 -> 935 bytes pidgin/pixmaps/emotes/small/16/small.theme.in | 34 ++++++++++--------- pidgin/pixmaps/emotes/small/16/smile-big.png | Bin 916 -> 0 bytes pidgin/pixmaps/emotes/small/16/yawn.png | Bin 935 -> 0 bytes 25 files changed, 64 insertions(+), 56 deletions(-) create mode 100644 pidgin/pixmaps/emotes/default/24/amorous.png create mode 100644 pidgin/pixmaps/emotes/default/24/excited.png delete mode 100644 pidgin/pixmaps/emotes/default/24/in-love.png create mode 100644 pidgin/pixmaps/emotes/default/24/in_love.png delete mode 100644 pidgin/pixmaps/emotes/default/24/love.png create mode 100644 pidgin/pixmaps/emotes/default/24/sleeping.png delete mode 100644 pidgin/pixmaps/emotes/default/24/smile-big.png delete mode 100644 pidgin/pixmaps/emotes/default/24/yawn.png create mode 100644 pidgin/pixmaps/emotes/small/16/amorous.png create mode 100644 pidgin/pixmaps/emotes/small/16/excited.png create mode 100644 pidgin/pixmaps/emotes/small/16/in_love.png delete mode 100644 pidgin/pixmaps/emotes/small/16/love.png create mode 100644 pidgin/pixmaps/emotes/small/16/sleeping.png delete mode 100644 pidgin/pixmaps/emotes/small/16/smile-big.png delete mode 100644 pidgin/pixmaps/emotes/small/16/yawn.png diff --git a/.mtn-ignore b/.mtn-ignore index db959e14ca..50c370c87b 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -37,13 +37,15 @@ pidgin-.*.tar.gz pidgin-.*.tar.bz2 pidgin-*.*.*-win32bin$ pidgin/pidgin$ +pidgin/pixmaps/emblems/16/amorous.png pidgin/pixmaps/emblems/16/angry.png pidgin/pixmaps/emblems/16/beer.png pidgin/pixmaps/emblems/16/busy.png pidgin/pixmaps/emblems/16/cigarette.png pidgin/pixmaps/emblems/16/coffee.png pidgin/pixmaps/emblems/16/console.png -pidgin/pixmaps/emblems/16/love.png +pidgin/pixmaps/emblems/16/excited.png +pidgin/pixmaps/emblems/16/in_love.png pidgin/pixmaps/emblems/16/meeting.png pidgin/pixmaps/emblems/16/mobile.png pidgin/pixmaps/emblems/16/musical-note.png @@ -53,11 +55,10 @@ pidgin/pixmaps/emblems/16/plate.png pidgin/pixmaps/emblems/16/question.png pidgin/pixmaps/emblems/16/search.png pidgin/pixmaps/emblems/16/sick.png +pidgin/pixmaps/emblems/16/sleeping.png pidgin/pixmaps/emblems/16/sleepy.png -pidgin/pixmaps/emblems/16/smile-big.png pidgin/pixmaps/emblems/16/thinking.png pidgin/pixmaps/emblems/16/tv.png -pidgin/pixmaps/emblems/16/yawn.png pidgin/pixmaps/emotes/default/24/theme pidgin/pixmaps/emotes/none/theme pidgin/pixmaps/emotes/small/16/theme diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index 31e784fb44..9677e74d67 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -316,11 +316,11 @@ static const struct { {0x80, 0x53, 0x7d, 0xe2, 0xa4, 0x67, 0x4a, 0x76, 0xb3, 0x54, 0x6d, 0xfd, 0x07, 0x5f, 0x5e, 0xc6}}, - {"smile-big", N_("Having fun"), + {"excited", N_("Having fun"), {0x6f, 0x49, 0x30, 0x98, 0x4f, 0x7c, 0x4a, 0xff, 0xa2, 0x76, 0x34, 0xa0, 0x3b, 0xce, 0xae, 0xa7}}, - {"sleepy", N_("Sleeping"), + {"sleeping", N_("Sleeping"), {0x78, 0x5e, 0x8c, 0x48, 0x40, 0xd3, 0x4c, 0x65, 0x88, 0x6f, 0x04, 0xcf, 0x3f, 0x3f, 0x43, 0xdf}}, @@ -328,12 +328,12 @@ static const struct { {0x10, 0x11, 0x17, 0xc9, 0xa3, 0xb0, 0x40, 0xf9, 0x81, 0xac, 0x49, 0xe1, 0x59, 0xfb, 0xd5, 0xd4}}, - {"love", N_("In love"), + {"in_love", N_("In love"), {0xdd, 0xcf, 0x0e, 0xa9, 0x71, 0x95, 0x40, 0x48, 0xa9, 0xc6, 0x41, 0x32, 0x06, 0xd6, 0xf2, 0x80}}, /* Sleepy / Tired */ - {"yawn", N_("Sleepy"), + {"sleepy", N_("Sleepy"), {0x83, 0xc9, 0xb7, 0x8e, 0x77, 0xe7, 0x43, 0x78, 0xb2, 0xc5, 0xfb, 0x6c, 0xfc, 0xc3, 0x5b, 0xec}}, @@ -761,7 +761,7 @@ static const struct { } icqmoods[] = { {"icqmood0", "shopping"}, {"icqmood1", "bathing"}, - {"icqmood2", "yawn"}, + {"icqmood2", "sleepy"}, {"icqmood3", "party"}, {"icqmood4", "beer"}, {"icqmood5", "thinking"}, @@ -777,7 +777,7 @@ static const struct { {"icqmood15", "console"}, {"icqmood16", "studying"}, {"icqmood17", "sick"}, - {"icqmood18", "sleepy"}, + {"icqmood18", "sleeping"}, {"icqmood19", "surfing"}, {"icqmood20", "internet"}, {"icqmood21", "working"}, diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index 6bf7fb7219..60262190dc 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -122,13 +122,15 @@ emblems/16/busy.png: status/16/busy.png # The copied emblems. # Ensure these are in .mtn-ignore. EMBLEMS_16_COPIED = \ + emblems/16/amorous.png \ emblems/16/angry.png \ emblems/16/busy.png \ emblems/16/beer.png \ emblems/16/cigarette.png \ emblems/16/coffee.png \ emblems/16/console.png \ - emblems/16/love.png \ + emblems/16/excited.png \ + emblems/16/in_love.png \ emblems/16/meeting.png \ emblems/16/mobile.png \ emblems/16/musical-note.png \ @@ -138,11 +140,10 @@ EMBLEMS_16_COPIED = \ emblems/16/question.png \ emblems/16/search.png \ emblems/16/sick.png \ + emblems/16/sleeping.png \ emblems/16/sleepy.png \ - emblems/16/smile-big.png \ emblems/16/thinking.png \ - emblems/16/tv.png \ - emblems/16/yawn.png + emblems/16/tv.png # Non-copied emblems. diff --git a/pidgin/pixmaps/emotes/default/24/Makefile.am b/pidgin/pixmaps/emotes/default/24/Makefile.am index 4bf3d69044..8482ff20b4 100644 --- a/pidgin/pixmaps/emotes/default/24/Makefile.am +++ b/pidgin/pixmaps/emotes/default/24/Makefile.am @@ -2,6 +2,7 @@ SMILEYS = \ act-up.png \ airplane.png \ alien.png \ + amorous.png \ angel.png \ angry.png \ arrogant.png \ @@ -58,6 +59,7 @@ SMILEYS = \ drool.png \ eat.png \ embarrassed.png \ + excited.png \ excruciating.png \ eyeroll.png \ female-fighter.png \ @@ -81,7 +83,7 @@ SMILEYS = \ hug-left.png \ hug-right.png \ hypnotized.png \ - in-love.png \ + in_love.png \ island.png \ jump.png \ kissed.png \ @@ -94,7 +96,6 @@ SMILEYS = \ liquor.png \ loser.png \ love-over.png \ - love.png \ lying.png \ mad-tongue.png \ mail.png \ @@ -153,8 +154,8 @@ SMILEYS = \ sinister.png \ skeleton.png \ skywalker.png \ + sleeping.png \ sleepy.png \ - smile-big.png \ smile.png \ smirk.png \ snail.png \ @@ -188,7 +189,6 @@ SMILEYS = \ wilt.png \ wink.png \ worship.png \ - yawn.png \ yin-yang.png diff --git a/pidgin/pixmaps/emotes/default/24/amorous.png b/pidgin/pixmaps/emotes/default/24/amorous.png new file mode 100644 index 0000000000..e752acc976 Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/amorous.png differ diff --git a/pidgin/pixmaps/emotes/default/24/default.theme.in b/pidgin/pixmaps/emotes/default/24/default.theme.in index 066df8fa6b..9920a2e98c 100644 --- a/pidgin/pixmaps/emotes/default/24/default.theme.in +++ b/pidgin/pixmaps/emotes/default/24/default.theme.in @@ -7,7 +7,7 @@ Author=Hylke Bons # Default smileys [default] smile.png :) :-) -smile-big.png :-D :-d :D :d +excited.png :-D :-d :D :d sad.png :-( :( wink.png ;-) ;) tongue.png :P :-P :-p :p @@ -36,7 +36,7 @@ tongue.png :-P :P :-p :p shock.png =-O kiss.png :-* shout.png >:o -smile-big.png :-D :D +excited.png :-D :D moneymouth.png :-$ foot-in-mouth.png :-! embarrassed.png :-[ @@ -52,7 +52,7 @@ glasses-cool.png 8-) # Following Windows Live Messenger 8.1 [MSN] smile.png :) :-) -smile-big.png :D :d :-D :-d +excited.png :D :d :-D :-d wink.png ;) ;-) shock.png :-O :-o :O :o tongue.png :P :p :-P :-p @@ -65,7 +65,7 @@ crying.png :'( neutral.png :| :-| devil.png (6) angel.png (A) (a) -love.png (L) (l) +in_love.png (L) (l) love-over.png (U) (u) msn.png (M) (m) cat.png (@) @@ -125,7 +125,7 @@ thinking.png *-) thunder.png (li) party.png <:o) eyeroll.png 8-) -yawn.png |-) +sleepy.png |-) bunny.png ('.') ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) @@ -147,12 +147,12 @@ party.png /8-) /dy /revel crying.png /:< /ll /cry bashful.png /:$ /hx /bashful shut-mouth.png /:X /bz /shut_mouth -sleepy.png /:Z /shui /sleep +sleeping.png /:Z /shui /sleep weep.png /:'( /dk /weep embarrassed.png /:-| /gg /embarassed pissed-off.png /:@ /fn /pissed_off act-up.png /:P /tp /act_up -smile-big.png /:D /cy /toothy_smile +excited.png /:D /cy /toothy_smile smile.png /:) /wx /small_smile sad.png /:( /ng /sad glasses-cool.png /:+ /kuk /cool @@ -164,7 +164,7 @@ cute.png /;-D /ka /cute disdain.png /;d /by /disdain arrogant.png /;o /am /arrogant starving.png /:g /jie /starving -yawn.png /|-) /kun /sleepy +sleepy.png /|-) /kun /sleepy terror.png /:! /jk /terror sweat.png /:L /sweat smirk.png /:> /hanx /smirk @@ -181,7 +181,7 @@ hammer.png /xx /qiao /hammer bye.png /bye /zj /bye go-away.png /go /shan /go tremble.png /shake /fad /shake -in-love.png /love /aiq /love +amorous.png /love /aiq /love jump.png /jump /tiao /jump search.png /find /zhao /search lashes.png /& /mm /beautiful_eyebrows @@ -205,7 +205,7 @@ pill.png /pill /yw /pill rose.png /rose /mg /rose wilt.png /fade /dx /wilt kiss.png /kiss /wen /kiss -love.png /heart /xin /heart +in_love.png /heart /xin /heart love-over.png /break /xs /broken_heart meeting.png /meeting /hy /meeting present.png /gift /lw /gift @@ -246,7 +246,7 @@ wink.png ;-) ;) tongue.png :-P :P :-p :p music.png [:-} laugh.png *JOKINGLY* -sleepy.png *TIRED* +sleeping.png *TIRED* crying.png :'( :'-( sick.png :-! kissed.png *KISSED* @@ -265,9 +265,9 @@ thinking.png :-\\ :-/ good.png *THUMBS\ UP* shout.png >:o >:O :-@ beer.png *DRINK* -smile-big.png :-D :D +excited.png :-D :D glasses-cool.png 8-) -in-love.png *IN\ LOVE* +amorous.png *IN\ LOVE* ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) @@ -280,11 +280,11 @@ shock.png :-O :O :-o :o devil.png >:) angel.png O:-) o:-) 0:-) sick.png :-& -yawn.png (:| +sleepy.png (:| hypnotized.png @-) on-the-phone.png :)] sad.png :( :-( -in-love.png :x :-x :X :-X +amorous.png :x :-x :X :-X angry.png X-( x-( X( x( crying.png :(( glasses-nerdy.png :-B :-b @@ -301,11 +301,11 @@ arrogant.png [-( thinking.png :-? waiting.png :-w :-W at-wits-end.png ~x( ~X( -smile-big.png :D :-D :d :-d +excited.png :D :-D :d :-d tongue.png :-P :P :-p :p glasses-cool.png B-) b-) neutral.png :| :-| -sleepy.png I-) i-) |-) +sleeping.png I-) i-) |-) clown.png :o) :O) doh.png #-o #-O weep.png :-< @@ -367,14 +367,14 @@ yin-yang.png (%) # Following MySpaceIM Beta 1.0.697.0 [MySpaceIM] -smile-big.png :D :-D +excited.png :D :-D devil.png }:) confused.png :Z glasses-nerdy.png B) bulgy-eyes.png %) freaked-out.png :E smile.png :) :-) -in-love.png :X +amorous.png :X laugh.png :)) mohawk.png -: mad-tongue.png X( diff --git a/pidgin/pixmaps/emotes/default/24/excited.png b/pidgin/pixmaps/emotes/default/24/excited.png new file mode 100644 index 0000000000..ce3f8664bc Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/excited.png differ diff --git a/pidgin/pixmaps/emotes/default/24/in-love.png b/pidgin/pixmaps/emotes/default/24/in-love.png deleted file mode 100644 index e752acc976..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/in-love.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/in_love.png b/pidgin/pixmaps/emotes/default/24/in_love.png new file mode 100644 index 0000000000..31aeea275e Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/in_love.png differ diff --git a/pidgin/pixmaps/emotes/default/24/love.png b/pidgin/pixmaps/emotes/default/24/love.png deleted file mode 100644 index 31aeea275e..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/love.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/sleeping.png b/pidgin/pixmaps/emotes/default/24/sleeping.png new file mode 100644 index 0000000000..e3bfe411b1 Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/sleeping.png differ diff --git a/pidgin/pixmaps/emotes/default/24/sleepy.png b/pidgin/pixmaps/emotes/default/24/sleepy.png index e3bfe411b1..2c3e78fd8d 100644 Binary files a/pidgin/pixmaps/emotes/default/24/sleepy.png and b/pidgin/pixmaps/emotes/default/24/sleepy.png differ diff --git a/pidgin/pixmaps/emotes/default/24/smile-big.png b/pidgin/pixmaps/emotes/default/24/smile-big.png deleted file mode 100644 index ce3f8664bc..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/smile-big.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/yawn.png b/pidgin/pixmaps/emotes/default/24/yawn.png deleted file mode 100644 index 2c3e78fd8d..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/yawn.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index 94df2170c7..ac8e362d51 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -1,4 +1,5 @@ SMILEYS = \ + amorous.png \ angel.png \ angry.png \ beer.png \ @@ -12,11 +13,12 @@ SMILEYS = \ crying.png \ devil.png \ dont-know.png \ + excited.png \ grin.png \ hug-left.png \ hug-right.png \ + in_love.png \ kiss.png \ - love.png \ meeting.png \ mobile.png \ musical-note.png \ @@ -31,15 +33,14 @@ SMILEYS = \ shock.png \ sick.png \ silent.png \ + sleeping.png \ sleepy.png \ - smile-big.png \ smile.png \ thinking.png \ tongue.png \ tv.png \ uhm-yeah.png \ - wink.png \ - yawn.png + wink.png pidginsmileypix_in_files = small.theme.in diff --git a/pidgin/pixmaps/emotes/small/16/TODO b/pidgin/pixmaps/emotes/small/16/TODO index 06046f86d6..94f08a1913 100644 --- a/pidgin/pixmaps/emotes/small/16/TODO +++ b/pidgin/pixmaps/emotes/small/16/TODO @@ -1,4 +1,5 @@ The following icons where just scaled down from the 24x24 and may need work: + amorous.png meeting.png question.png search.png @@ -13,7 +14,7 @@ our default icons: cigarette.png coffee.png console.png - love.png + in_love.png musical-note.png party.png phone.png diff --git a/pidgin/pixmaps/emotes/small/16/amorous.png b/pidgin/pixmaps/emotes/small/16/amorous.png new file mode 100644 index 0000000000..41a520b194 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/amorous.png differ diff --git a/pidgin/pixmaps/emotes/small/16/excited.png b/pidgin/pixmaps/emotes/small/16/excited.png new file mode 100644 index 0000000000..f03bc545ff Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/excited.png differ diff --git a/pidgin/pixmaps/emotes/small/16/in_love.png b/pidgin/pixmaps/emotes/small/16/in_love.png new file mode 100644 index 0000000000..20e596b323 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/in_love.png differ diff --git a/pidgin/pixmaps/emotes/small/16/love.png b/pidgin/pixmaps/emotes/small/16/love.png deleted file mode 100644 index 20e596b323..0000000000 Binary files a/pidgin/pixmaps/emotes/small/16/love.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/sleeping.png b/pidgin/pixmaps/emotes/small/16/sleeping.png new file mode 100644 index 0000000000..5fb313e620 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/sleeping.png differ diff --git a/pidgin/pixmaps/emotes/small/16/sleepy.png b/pidgin/pixmaps/emotes/small/16/sleepy.png index 5fb313e620..9a86537f4f 100644 Binary files a/pidgin/pixmaps/emotes/small/16/sleepy.png and b/pidgin/pixmaps/emotes/small/16/sleepy.png differ diff --git a/pidgin/pixmaps/emotes/small/16/small.theme.in b/pidgin/pixmaps/emotes/small/16/small.theme.in index e2aa7e3977..f126514c9d 100644 --- a/pidgin/pixmaps/emotes/small/16/small.theme.in +++ b/pidgin/pixmaps/emotes/small/16/small.theme.in @@ -7,7 +7,7 @@ Author=Hylke Bons # Default smileys [default] smile.png :) :-) -smile-big.png :-D :-d :D :d +excited.png :-D :-d :D :d sad.png :-( :( wink.png ;-) ;) tongue.png :P :-P :-p :p @@ -26,7 +26,7 @@ sad.png :-( :( tongue.png :-P :P :-p :p shock.png =-O kiss.png :-* -smile-big.png :-D :D +excited.png :-D :D angel.png O:-) thinking.png :-\\ :-/ crying.png :'( @@ -35,7 +35,7 @@ crying.png :'( # Following Windows Live Messenger 8.1 [MSN] smile.png :) :-) -smile-big.png :D :d :-D :-d +excited.png :D :d :-D :-d wink.png ;) ;-) shock.png :-O :-o :O :o tongue.png :P :p :-P :-p @@ -46,7 +46,7 @@ crying.png :'( neutral.png :| :-| devil.png (6) angel.png (A) (a) -love.png (L) (l) +in_love.png (L) (l) musical-note.png (8) kiss.png (K) (k) camera.png (P) (p) @@ -61,7 +61,7 @@ mobile.png (mp) dont-know.png :^) thinking.png *-) party.png <:o) -yawn.png |-) +sleepy.png |-) # Hidden MSN emotes cigarette.png (ci) (CI) @@ -73,19 +73,20 @@ console.png (xx) (XX) shock.png /:O /jy /surprised party.png /8-) /dy /revel crying.png /:< /ll /cry -sleepy.png /:Z /shui /sleep -smile-big.png /:D /cy /toothy_smile +sleeping.png /:Z /shui /sleep +excited.png /:D /cy /toothy_smile smile.png /:) /wx /small_smile sad.png /:( /ng /sad sick.png /:T /tu /vomit -yawn.png /|-) /kun /sleepy +sleepy.png /|-) /kun /sleepy question.png /? /yiw /question +amorous.png /love /aiq /love search.png /find /zhao /search hug-left.png /hug /yb /hug musical-note.png /music /yy /music coffee.png /coffee /kf /coffee kiss.png /kiss /wen /kiss -love.png /heart /xin /heart +in_love.png /heart /xin /heart meeting.png /meeting /hy /meeting phone.png /phone /dh /phone tv.png /TV /ds /TV @@ -100,7 +101,7 @@ sad.png :-( :( shock.png =-O wink.png ;-) ;) tongue.png :-P :P :-p :p -sleepy.png *TIRED* +sleeping.png *TIRED* crying.png :'( :'-( sick.png :-! kiss.png :-{} :-* @@ -108,7 +109,8 @@ devil.png ]:-> angel.png O:-) thinking.png :-\\ :-/ beer.png *DRINK* -smile-big.png :-D :D +excited.png :-D :D +amorous.png *IN\ LOVE* # Following Yahoo! Messenger 8.1 @@ -119,16 +121,17 @@ shock.png :-O :O :-o :o devil.png >:) angel.png O:-) o:-) 0:-) sick.png :-& -yawn.png (:| +sleepy.png (:| sad.png :( :-( +amorous.png :x :-x :X :-X angry.png X-( x-( X( x( crying.png :(( wink.png ;) ;-) thinking.png :-? -smile-big.png :D :-D :d :-d +excited.png :D :-D :d :-d tongue.png :-P :P :-p :p neutral.png :| :-| -sleepy.png I-) i-) |-) +sleeping.png I-) i-) |-) kiss.png :-* :* confused.png :-S :-s hug-left.png >:D< >:d< @@ -145,10 +148,11 @@ musical-note.png :-" # Following MySpaceIM Beta 1.0.697.0 [MySpaceIM] -smile-big.png :D :-D +excited.png :D :-D devil.png }:) confused.png :Z smile.png :) :-) +amorous.png :X shock.png :O neutral.png :| tongue.png :P :p diff --git a/pidgin/pixmaps/emotes/small/16/smile-big.png b/pidgin/pixmaps/emotes/small/16/smile-big.png deleted file mode 100644 index f03bc545ff..0000000000 Binary files a/pidgin/pixmaps/emotes/small/16/smile-big.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/yawn.png b/pidgin/pixmaps/emotes/small/16/yawn.png deleted file mode 100644 index 9a86537f4f..0000000000 Binary files a/pidgin/pixmaps/emotes/small/16/yawn.png and /dev/null differ -- cgit v1.2.1 From 5096a6ae96b4ed8a43015b5a1f444b710ee75984 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 02:30:42 +0000 Subject: Round two: Scale down more icons to use as emblems. --- .mtn-ignore | 7 +++++++ pidgin/pixmaps/Makefile.am | 7 +++++++ pidgin/pixmaps/emotes/small/16/TODO | 4 ++++ pidgin/pixmaps/emotes/small/16/disappointed.png | Bin 0 -> 906 bytes pidgin/pixmaps/emotes/small/16/embarrassed.png | Bin 0 -> 917 bytes pidgin/pixmaps/emotes/small/16/mean.png | Bin 0 -> 921 bytes pidgin/pixmaps/emotes/small/16/sarcastic.png | Bin 0 -> 904 bytes pidgin/pixmaps/emotes/small/16/small.theme.in | 9 +++++++++ 8 files changed, 27 insertions(+) create mode 100644 pidgin/pixmaps/emotes/small/16/disappointed.png create mode 100644 pidgin/pixmaps/emotes/small/16/embarrassed.png create mode 100644 pidgin/pixmaps/emotes/small/16/mean.png create mode 100644 pidgin/pixmaps/emotes/small/16/sarcastic.png diff --git a/.mtn-ignore b/.mtn-ignore index 50c370c87b..8dddb9da88 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -43,16 +43,23 @@ pidgin/pixmaps/emblems/16/beer.png pidgin/pixmaps/emblems/16/busy.png pidgin/pixmaps/emblems/16/cigarette.png pidgin/pixmaps/emblems/16/coffee.png +pidgin/pixmaps/emblems/16/confused.png pidgin/pixmaps/emblems/16/console.png +pidgin/pixmaps/emblems/16/disappointed.png +pidgin/pixmaps/emblems/16/embarrassed.png pidgin/pixmaps/emblems/16/excited.png pidgin/pixmaps/emblems/16/in_love.png +pidgin/pixmaps/emblems/16/mean.png pidgin/pixmaps/emblems/16/meeting.png pidgin/pixmaps/emblems/16/mobile.png pidgin/pixmaps/emblems/16/musical-note.png +pidgin/pixmaps/emblems/16/neutral.png pidgin/pixmaps/emblems/16/party.png pidgin/pixmaps/emblems/16/phone.png pidgin/pixmaps/emblems/16/plate.png pidgin/pixmaps/emblems/16/question.png +pidgin/pixmaps/emblems/16/sad.png +pidgin/pixmaps/emblems/16/sarcastic.png pidgin/pixmaps/emblems/16/search.png pidgin/pixmaps/emblems/16/sick.png pidgin/pixmaps/emblems/16/sleeping.png diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index 60262190dc..1a85c70cd4 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -128,16 +128,23 @@ EMBLEMS_16_COPIED = \ emblems/16/beer.png \ emblems/16/cigarette.png \ emblems/16/coffee.png \ + emblems/16/confused.png \ emblems/16/console.png \ + emblems/16/disappointed.png \ + emblems/16/embarrassed.png \ emblems/16/excited.png \ emblems/16/in_love.png \ + emblems/16/mean.png \ emblems/16/meeting.png \ emblems/16/mobile.png \ emblems/16/musical-note.png \ + emblems/16/neutral.png \ emblems/16/party.png \ emblems/16/phone.png \ emblems/16/plate.png \ emblems/16/question.png \ + emblems/16/sad.png \ + emblems/16/sarcastic.png \ emblems/16/search.png \ emblems/16/sick.png \ emblems/16/sleeping.png \ diff --git a/pidgin/pixmaps/emotes/small/16/TODO b/pidgin/pixmaps/emotes/small/16/TODO index 94f08a1913..9c0481e7c0 100644 --- a/pidgin/pixmaps/emotes/small/16/TODO +++ b/pidgin/pixmaps/emotes/small/16/TODO @@ -1,7 +1,11 @@ The following icons where just scaled down from the 24x24 and may need work: + disappointed.png + embarrassed.png + mean.png amorous.png meeting.png question.png + sarcastic.png search.png sleepy.png smile-big.png diff --git a/pidgin/pixmaps/emotes/small/16/disappointed.png b/pidgin/pixmaps/emotes/small/16/disappointed.png new file mode 100644 index 0000000000..3b3e2a12b8 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/disappointed.png differ diff --git a/pidgin/pixmaps/emotes/small/16/embarrassed.png b/pidgin/pixmaps/emotes/small/16/embarrassed.png new file mode 100644 index 0000000000..404b38b494 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/embarrassed.png differ diff --git a/pidgin/pixmaps/emotes/small/16/mean.png b/pidgin/pixmaps/emotes/small/16/mean.png new file mode 100644 index 0000000000..be41d91e79 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/mean.png differ diff --git a/pidgin/pixmaps/emotes/small/16/sarcastic.png b/pidgin/pixmaps/emotes/small/16/sarcastic.png new file mode 100644 index 0000000000..e18fb792d0 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/sarcastic.png differ diff --git a/pidgin/pixmaps/emotes/small/16/small.theme.in b/pidgin/pixmaps/emotes/small/16/small.theme.in index f126514c9d..7f5e4a44f1 100644 --- a/pidgin/pixmaps/emotes/small/16/small.theme.in +++ b/pidgin/pixmaps/emotes/small/16/small.theme.in @@ -13,6 +13,7 @@ wink.png ;-) ;) tongue.png :P :-P :-p :p shock.png =-O =-o kiss.png :-* +embarrassed.png :-[ crying.png :'( thinking.png :-/ :-\\ angel.png O:-) o:-) @@ -27,6 +28,7 @@ tongue.png :-P :P :-p :p shock.png =-O kiss.png :-* excited.png :-D :D +embarrassed.png :-[ angel.png O:-) thinking.png :-\\ :-/ crying.png :'( @@ -40,6 +42,7 @@ wink.png ;) ;-) shock.png :-O :-o :O :o tongue.png :P :p :-P :-p angry.png :@ :-@ +embarrassed.png :$ :-$ confused.png :S :s :-S :-s sad.png :( :-( crying.png :'( @@ -55,6 +58,7 @@ phone.png (T) (t) hug-left.png ({) hug-right.png (}) beer.png (B) (b) +sarcastic.png ^o) sick.png +o( plate.png (pl) mobile.png (mp) @@ -74,6 +78,7 @@ shock.png /:O /jy /surprised party.png /8-) /dy /revel crying.png /:< /ll /cry sleeping.png /:Z /shui /sleep +embarrassed.png /:-| /gg /embarassed excited.png /:D /cy /toothy_smile smile.png /:) /wx /small_smile sad.png /:( /ng /sad @@ -105,6 +110,7 @@ sleeping.png *TIRED* crying.png :'( :'-( sick.png :-! kiss.png :-{} :-* +embarrassed.png :-[ devil.png ]:-> angel.png O:-) thinking.png :-\\ :-/ @@ -127,6 +133,8 @@ amorous.png :x :-x :X :-X angry.png X-( x-( X( x( crying.png :(( wink.png ;) ;-) +embarrassed.png :"> +mean.png :-> :> thinking.png :-? excited.png :D :-D :d :-d tongue.png :-P :P :-p :p @@ -134,6 +142,7 @@ neutral.png :| :-| sleeping.png I-) i-) |-) kiss.png :-* :* confused.png :-S :-s +sarcastic.png /:) hug-left.png >:D< >:d< party.png <:-P <:-p -- cgit v1.2.1 From 232e49fcb8689acc44a2dd89f0513ba919e4789e Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 03:06:55 +0000 Subject: Round three of icon renaming. This is probably all I'm going to do for now. --- .mtn-ignore | 6 ++++ pidgin/pixmaps/emotes/default/24/Makefile.am | 12 ++++---- pidgin/pixmaps/emotes/default/24/afraid.png | Bin 0 -> 1493 bytes pidgin/pixmaps/emotes/default/24/default.theme.in | 34 +++++++++++----------- pidgin/pixmaps/emotes/default/24/eat.png | Bin 1598 -> 0 bytes pidgin/pixmaps/emotes/default/24/happy.png | Bin 0 -> 1509 bytes pidgin/pixmaps/emotes/default/24/hot.png | Bin 0 -> 1513 bytes pidgin/pixmaps/emotes/default/24/hungry.png | Bin 0 -> 1598 bytes pidgin/pixmaps/emotes/default/24/nailbiting.png | Bin 1514 -> 0 bytes pidgin/pixmaps/emotes/default/24/nervous.png | Bin 0 -> 1514 bytes pidgin/pixmaps/emotes/default/24/shock.png | Bin 1507 -> 0 bytes pidgin/pixmaps/emotes/default/24/shocked.png | Bin 0 -> 1507 bytes pidgin/pixmaps/emotes/default/24/smile.png | Bin 1509 -> 0 bytes pidgin/pixmaps/emotes/default/24/sweat.png | Bin 1513 -> 0 bytes pidgin/pixmaps/emotes/default/24/tremble.png | Bin 1493 -> 0 bytes pidgin/pixmaps/emotes/small/16/TODO | 8 ++++- pidgin/pixmaps/emotes/small/16/afraid.png | Bin 0 -> 909 bytes pidgin/pixmaps/emotes/small/16/happy.png | Bin 0 -> 914 bytes pidgin/pixmaps/emotes/small/16/hot.png | Bin 0 -> 919 bytes pidgin/pixmaps/emotes/small/16/hungry.png | Bin 0 -> 956 bytes pidgin/pixmaps/emotes/small/16/nervous.png | Bin 0 -> 937 bytes pidgin/pixmaps/emotes/small/16/shocked.png | Bin 0 -> 937 bytes 22 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 pidgin/pixmaps/emotes/default/24/afraid.png delete mode 100644 pidgin/pixmaps/emotes/default/24/eat.png create mode 100644 pidgin/pixmaps/emotes/default/24/happy.png create mode 100644 pidgin/pixmaps/emotes/default/24/hot.png create mode 100644 pidgin/pixmaps/emotes/default/24/hungry.png delete mode 100644 pidgin/pixmaps/emotes/default/24/nailbiting.png create mode 100644 pidgin/pixmaps/emotes/default/24/nervous.png delete mode 100644 pidgin/pixmaps/emotes/default/24/shock.png create mode 100644 pidgin/pixmaps/emotes/default/24/shocked.png delete mode 100644 pidgin/pixmaps/emotes/default/24/smile.png delete mode 100644 pidgin/pixmaps/emotes/default/24/sweat.png delete mode 100644 pidgin/pixmaps/emotes/default/24/tremble.png create mode 100644 pidgin/pixmaps/emotes/small/16/afraid.png create mode 100644 pidgin/pixmaps/emotes/small/16/happy.png create mode 100644 pidgin/pixmaps/emotes/small/16/hot.png create mode 100644 pidgin/pixmaps/emotes/small/16/hungry.png create mode 100644 pidgin/pixmaps/emotes/small/16/nervous.png create mode 100644 pidgin/pixmaps/emotes/small/16/shocked.png diff --git a/.mtn-ignore b/.mtn-ignore index 8dddb9da88..710c1aa27e 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -37,6 +37,7 @@ pidgin-.*.tar.gz pidgin-.*.tar.bz2 pidgin-*.*.*-win32bin$ pidgin/pidgin$ +pidgin/pixmaps/emblems/16/afraid.png pidgin/pixmaps/emblems/16/amorous.png pidgin/pixmaps/emblems/16/angry.png pidgin/pixmaps/emblems/16/beer.png @@ -48,11 +49,15 @@ pidgin/pixmaps/emblems/16/console.png pidgin/pixmaps/emblems/16/disappointed.png pidgin/pixmaps/emblems/16/embarrassed.png pidgin/pixmaps/emblems/16/excited.png +pidgin/pixmaps/emblems/16/happy.png +pidgin/pixmaps/emblems/16/hot.png +pidgin/pixmaps/emblems/16/hungry.png pidgin/pixmaps/emblems/16/in_love.png pidgin/pixmaps/emblems/16/mean.png pidgin/pixmaps/emblems/16/meeting.png pidgin/pixmaps/emblems/16/mobile.png pidgin/pixmaps/emblems/16/musical-note.png +pidgin/pixmaps/emblems/16/nervous.png pidgin/pixmaps/emblems/16/neutral.png pidgin/pixmaps/emblems/16/party.png pidgin/pixmaps/emblems/16/phone.png @@ -61,6 +66,7 @@ pidgin/pixmaps/emblems/16/question.png pidgin/pixmaps/emblems/16/sad.png pidgin/pixmaps/emblems/16/sarcastic.png pidgin/pixmaps/emblems/16/search.png +pidgin/pixmaps/emblems/16/shocked.png pidgin/pixmaps/emblems/16/sick.png pidgin/pixmaps/emblems/16/sleeping.png pidgin/pixmaps/emblems/16/sleepy.png diff --git a/pidgin/pixmaps/emotes/default/24/Makefile.am b/pidgin/pixmaps/emotes/default/24/Makefile.am index 8482ff20b4..f4edbe83e6 100644 --- a/pidgin/pixmaps/emotes/default/24/Makefile.am +++ b/pidgin/pixmaps/emotes/default/24/Makefile.am @@ -57,7 +57,7 @@ SMILEYS = \ dont-know.png \ drink.png \ drool.png \ - eat.png \ + hungry.png \ embarrassed.png \ excited.png \ excruciating.png \ @@ -115,7 +115,7 @@ SMILEYS = \ msn.png \ musical-note.png \ music.png \ - nailbiting.png \ + nervous.png \ neutral.png \ on-the-phone.png \ party.png \ @@ -145,7 +145,7 @@ SMILEYS = \ secret.png \ shame.png \ sheep.png \ - shock.png \ + shocked.png \ shout.png \ shut-mouth.png \ sick.png \ @@ -156,7 +156,7 @@ SMILEYS = \ skywalker.png \ sleeping.png \ sleepy.png \ - smile.png \ + happy.png \ smirk.png \ snail.png \ snicker.png \ @@ -168,7 +168,7 @@ SMILEYS = \ stop.png \ struggle.png \ sun.png \ - sweat.png \ + hot.png \ talktohand.png \ teeth.png \ terror.png \ @@ -176,7 +176,7 @@ SMILEYS = \ thunder.png \ time-out.png \ tongue.png \ - tremble.png \ + afraid.png \ turtle.png \ tv.png \ umbrella.png \ diff --git a/pidgin/pixmaps/emotes/default/24/afraid.png b/pidgin/pixmaps/emotes/default/24/afraid.png new file mode 100644 index 0000000000..623a5d26e3 Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/afraid.png differ diff --git a/pidgin/pixmaps/emotes/default/24/default.theme.in b/pidgin/pixmaps/emotes/default/24/default.theme.in index 9920a2e98c..d563f857bf 100644 --- a/pidgin/pixmaps/emotes/default/24/default.theme.in +++ b/pidgin/pixmaps/emotes/default/24/default.theme.in @@ -6,12 +6,12 @@ Author=Hylke Bons # Default smileys [default] -smile.png :) :-) +happy.png :) :-) excited.png :-D :-d :D :d sad.png :-( :( wink.png ;-) ;) tongue.png :P :-P :-p :p -shock.png =-O =-o +shocked.png =-O =-o kiss.png :-* glasses-cool.png 8-) embarrassed.png :-[ @@ -29,11 +29,11 @@ shout.png >:o >:O # Following AIM 6.1 [AIM] -smile.png :-) :) +happy.png :-) :) wink.png ;-) ;) sad.png :-( :( tongue.png :-P :P :-p :p -shock.png =-O +shocked.png =-O kiss.png :-* shout.png >:o excited.png :-D :D @@ -51,10 +51,10 @@ glasses-cool.png 8-) # Following Windows Live Messenger 8.1 [MSN] -smile.png :) :-) +happy.png :) :-) excited.png :D :d :-D :-d wink.png ;) ;-) -shock.png :-O :-o :O :o +shocked.png :-O :-o :O :o tongue.png :P :p :-P :-p glasses-cool.png (H) (h) angry.png :@ :-@ @@ -139,7 +139,7 @@ fingers-crossed.png (yn) (YN) # Following QQ 2006 [QQ] -shock.png /:O /jy /surprised +shocked.png /:O /jy /surprised curl-lip.png /:~ /pz /curl_lip desire.png /:* /se /desire dazed.png /:| /dazed @@ -153,7 +153,7 @@ embarrassed.png /:-| /gg /embarassed pissed-off.png /:@ /fn /pissed_off act-up.png /:P /tp /act_up excited.png /:D /cy /toothy_smile -smile.png /:) /wx /small_smile +happy.png /:) /wx /small_smile sad.png /:( /ng /sad glasses-cool.png /:+ /kuk /cool doctor.png /:# /feid /SARS @@ -166,7 +166,7 @@ arrogant.png /;o /am /arrogant starving.png /:g /jie /starving sleepy.png /|-) /kun /sleepy terror.png /:! /jk /terror -sweat.png /:L /sweat +hot.png /:L /sweat smirk.png /:> /hanx /smirk soldier.png /:; /db /soldier struggle.png /;f /fendou /struggle @@ -180,7 +180,7 @@ skeleton.png /!!! /kl /skeleton hammer.png /xx /qiao /hammer bye.png /bye /zj /bye go-away.png /go /shan /go -tremble.png /shake /fad /shake +afraid.png /shake /fad /shake amorous.png /love /aiq /love jump.png /jump /tiao /jump search.png /find /zhao /search @@ -200,7 +200,7 @@ soccerball.png /footb /zq /soccer musical-note.png /music /yy /music poop.png /shit /bb /shit coffee.png /coffee /kf /coffee -eat.png /eat /fan /eat +hungry.png /eat /fan /eat pill.png /pill /yw /pill rose.png /rose /mg /rose wilt.png /fade /dx /wilt @@ -238,10 +238,10 @@ boy.png /<11> /nan /man # Following ICQ 6.0 [ICQ] -smile.png :-) :) +happy.png :-) :) neutral.png :-$ sad.png :-( :( -shock.png =-O +shocked.png =-O wink.png ;-) ;) tongue.png :-P :P :-p :p music.png [:-} @@ -274,9 +274,9 @@ amorous.png *IN\ LOVE* # Following Yahoo! Messenger 8.1 [Yahoo] -smile.png :) :-) +happy.png :) :-) question.png :-/ :-\\ -shock.png :-O :O :-o :o +shocked.png :-O :O :-o :o devil.png >:) angel.png O:-) o:-) 0:-) sick.png :-& @@ -321,11 +321,11 @@ mad-tongue.png >:P >:p time-out.png :-t :-T hug-left.png >:D< >:d< love-over.png =(( -sweat.png #:-S #:-s +hot.png #:-S #:-s rotfl.png =)) :-j :-J loser.png L-) l-) party.png <:-P <:-p -nailbiting.png :-SS :-Ss :-sS :-ss +nervous.png :-SS :-Ss :-sS :-ss cowboy.png <):) desire.png 8-> ! skywalker.png C:-) c:-) C:) c:) diff --git a/pidgin/pixmaps/emotes/default/24/eat.png b/pidgin/pixmaps/emotes/default/24/eat.png deleted file mode 100644 index 393482f13e..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/eat.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/happy.png b/pidgin/pixmaps/emotes/default/24/happy.png new file mode 100644 index 0000000000..8a2ba4925c Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/happy.png differ diff --git a/pidgin/pixmaps/emotes/default/24/hot.png b/pidgin/pixmaps/emotes/default/24/hot.png new file mode 100644 index 0000000000..1b7fbec14b Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/hot.png differ diff --git a/pidgin/pixmaps/emotes/default/24/hungry.png b/pidgin/pixmaps/emotes/default/24/hungry.png new file mode 100644 index 0000000000..393482f13e Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/hungry.png differ diff --git a/pidgin/pixmaps/emotes/default/24/nailbiting.png b/pidgin/pixmaps/emotes/default/24/nailbiting.png deleted file mode 100644 index 6888af8e0a..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/nailbiting.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/nervous.png b/pidgin/pixmaps/emotes/default/24/nervous.png new file mode 100644 index 0000000000..6888af8e0a Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/nervous.png differ diff --git a/pidgin/pixmaps/emotes/default/24/shock.png b/pidgin/pixmaps/emotes/default/24/shock.png deleted file mode 100644 index 0e7438e9ee..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/shock.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/shocked.png b/pidgin/pixmaps/emotes/default/24/shocked.png new file mode 100644 index 0000000000..0e7438e9ee Binary files /dev/null and b/pidgin/pixmaps/emotes/default/24/shocked.png differ diff --git a/pidgin/pixmaps/emotes/default/24/smile.png b/pidgin/pixmaps/emotes/default/24/smile.png deleted file mode 100644 index 8a2ba4925c..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/smile.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/sweat.png b/pidgin/pixmaps/emotes/default/24/sweat.png deleted file mode 100644 index 1b7fbec14b..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/sweat.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/default/24/tremble.png b/pidgin/pixmaps/emotes/default/24/tremble.png deleted file mode 100644 index 623a5d26e3..0000000000 Binary files a/pidgin/pixmaps/emotes/default/24/tremble.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/TODO b/pidgin/pixmaps/emotes/small/16/TODO index 9c0481e7c0..e4d1008102 100644 --- a/pidgin/pixmaps/emotes/small/16/TODO +++ b/pidgin/pixmaps/emotes/small/16/TODO @@ -1,12 +1,18 @@ The following icons where just scaled down from the 24x24 and may need work: + afraid.png + amorous.png disappointed.png embarrassed.png + happy.png + hot.png + hungry.png mean.png - amorous.png meeting.png + nervous.png question.png sarcastic.png search.png + shocked.png sleepy.png smile-big.png tv.png diff --git a/pidgin/pixmaps/emotes/small/16/afraid.png b/pidgin/pixmaps/emotes/small/16/afraid.png new file mode 100644 index 0000000000..b10a1a0abf Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/afraid.png differ diff --git a/pidgin/pixmaps/emotes/small/16/happy.png b/pidgin/pixmaps/emotes/small/16/happy.png new file mode 100644 index 0000000000..2daa05926c Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/happy.png differ diff --git a/pidgin/pixmaps/emotes/small/16/hot.png b/pidgin/pixmaps/emotes/small/16/hot.png new file mode 100644 index 0000000000..518ecc2274 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/hot.png differ diff --git a/pidgin/pixmaps/emotes/small/16/hungry.png b/pidgin/pixmaps/emotes/small/16/hungry.png new file mode 100644 index 0000000000..bb53909c72 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/hungry.png differ diff --git a/pidgin/pixmaps/emotes/small/16/nervous.png b/pidgin/pixmaps/emotes/small/16/nervous.png new file mode 100644 index 0000000000..dee32c7d4f Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/nervous.png differ diff --git a/pidgin/pixmaps/emotes/small/16/shocked.png b/pidgin/pixmaps/emotes/small/16/shocked.png new file mode 100644 index 0000000000..7746882016 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/shocked.png differ -- cgit v1.2.1 From eff8105666b61f90c2c170d44a2343762e2fb871 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 04:18:05 +0000 Subject: s/savable/saveable/ --- libpurple/status.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpurple/status.h b/libpurple/status.h index 21a398aaf4..f9a8093174 100644 --- a/libpurple/status.h +++ b/libpurple/status.h @@ -50,8 +50,8 @@ * your accounts are saved so that the next time you start Purple, * your accounts will be set to their last known statuses. There * is also a list of saved statuses that are written to the - * status.xml file. Also, each PurpleStatus has a "savable" boolean. - * If "savable" is set to FALSE then the status is NEVER saved. + * status.xml file. Also, each PurpleStatus has a "saveable" boolean. + * If "saveable" is set to FALSE then the status is NEVER saved. * All PurpleStatuses should be inside a PurplePresence. * * @@ -203,7 +203,7 @@ PurpleStatusType *purple_status_type_new_full(PurpleStatusPrimitive primitive, /** * Creates a new status type with some default values (not - * savable and not independent). + * saveable and not independent). * * @param primitive The primitive status type. * @param id The ID of the status type, or @c NULL to use the id of -- cgit v1.2.1 From 770e84bff5b46a22c994a49cb39aa08b29fd86ad Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 07:30:43 +0000 Subject: Move the mood UI for ICQ into Pidgin. It still uses the new request API stuff, which needs to be replaced. Then it needs to replace the XMPP UI. --- libpurple/protocols/jabber/jabber.c | 6 +- libpurple/protocols/jabber/usermood.c | 15 +-- libpurple/protocols/oscar/family_locate.c | 194 +++++++++++++++++++----------- libpurple/protocols/oscar/libicq.c | 1 + libpurple/protocols/oscar/oscar.c | 120 +++--------------- libpurple/protocols/oscar/oscar.h | 9 +- libpurple/protocols/oscar/oscarcommon.h | 2 + libpurple/protocols/oscar/tlv.c | 2 +- libpurple/prpl.h | 6 + libpurple/status.h | 6 + pidgin/gtkblist.c | 130 +++++++++++++++++++- 11 files changed, 300 insertions(+), 191 deletions(-) diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 80ec33729d..b62525a1ce 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -1567,11 +1567,11 @@ void jabber_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboole purple_notify_user_info_add_pair(user_info, _("Subscription"), sub); - status = purple_presence_get_active_status(presence); - mood = purple_status_get_attr_string(status, "mood"); + status = purple_presence_get_status(presence, "mood"); + mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); if(mood && *mood) { const char *moodtext; - moodtext = purple_status_get_attr_string(status, "moodtext"); + moodtext = purple_status_get_attr_string(status, PURPLE_MOOD_COMMENT); if(moodtext && *moodtext) { char *moodplustext = g_strdup_printf("%s (%s)", mood, moodtext); diff --git a/libpurple/protocols/jabber/usermood.c b/libpurple/protocols/jabber/usermood.c index dfd38cf15a..4bde3a3d2b 100644 --- a/libpurple/protocols/jabber/usermood.c +++ b/libpurple/protocols/jabber/usermood.c @@ -150,15 +150,12 @@ static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { } } if (newmood != NULL) { - const char *status_id; - JabberBuddyResource *resource = jabber_buddy_find_resource(buddy, NULL); - if(!resource) { /* huh? */ - g_free(moodtext); - return; - } - status_id = jabber_buddy_state_get_status_id(resource->state); - - purple_prpl_got_user_status(js->gc->account, from, status_id, "mood", _(newmood), "moodtext", moodtext?moodtext:"", NULL); + purple_prpl_got_user_status(js->gc->account, from, "mood", + PURPLE_MOOD_NAME, mood, + PURPLE_MOOD_COMMENT, moodtext, + NULL); + } else { + purple_prpl_got_user_status_deactive(js->gc->account, from, "mood"); } g_free(moodtext); } diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index 9677e74d67..eb6a6c8df0 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -252,159 +252,202 @@ static const struct { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, }; +/* Keep this array synchronized with icq_purple_moods. */ static const struct { - char *mood; - char *descriptivename; + const char *mood; guint8 data[16]; -} aim_custom_icons[] = { - /* empty X-Status for the case when customicon == 0 */ - {NULL, NULL, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, +} icq_custom_icons[] = { - {"thinking", N_("Thinking"), + {"thinking", {0x3f, 0xb0, 0xbd, 0x36, 0xaf, 0x3b, 0x4a, 0x60, 0x9e, 0xef, 0xcf, 0x19, 0x0f, 0x6a, 0x5a, 0x7f}}, - {"busy", N_("Busy"), + {"busy", {0x48, 0x8e, 0x14, 0x89, 0x8a, 0xca, 0x4a, 0x08, 0x82, 0xaa, 0x77, 0xce, 0x7a, 0x16, 0x52, 0x08}}, - {"shopping", N_("Shopping"), + {"shopping", {0x63, 0x62, 0x73, 0x37, 0xa0, 0x3f, 0x49, 0xff, 0x80, 0xe5, 0xf7, 0x09, 0xcd, 0xe0, 0xa4, 0xee}}, /* This was in the original patch, but isn't what the official client * (ICQ 6) sets when you choose its typewriter icon. */ - {"typing", NULL, + {"typing", {0x63, 0x4f, 0x6b, 0xd8 ,0xad, 0xd2, 0x4a, 0xa1, 0xaa, 0xb9, 0x11, 0x5b, 0xc2, 0x6d, 0x05, 0xa1}}, - {"question", N_("Questioning"), + {"question", {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64}}, - {"angry", N_("Angry"), + {"angry", {0x01, 0xd8, 0xd7, 0xee, 0xac, 0x3b, 0x49, 0x2a, 0xa5, 0x8d, 0xd3, 0xd8, 0x77, 0xe6, 0x6b, 0x92}}, - {"plate", N_("Eating"), + {"plate", {0xf8, 0xe8, 0xd7, 0xb2, 0x82, 0xc4, 0x41, 0x42, 0x90, 0xf8, 0x10, 0xc6, 0xce, 0x0a, 0x89, 0xa6}}, - {"cinema", N_("Watching a movie"), + {"cinema", {0x10, 0x7a, 0x9a, 0x18, 0x12, 0x32, 0x4d, 0xa4, 0xb6, 0xcd, 0x08, 0x79, 0xdb, 0x78, 0x0f, 0x09}}, - {"sick", N_("Sick"), + {"sick", {0x1f, 0x7a, 0x40, 0x71, 0xbf, 0x3b, 0x4e, 0x60, 0xbc, 0x32, 0x4c, 0x57, 0x87, 0xb0, 0x4c, 0xf1}}, - {"typing", N_("Typing"), + {"typing", {0x2c, 0xe0, 0xe4, 0xe5, 0x7c, 0x64, 0x43, 0x70, 0x9c, 0x3a, 0x7a, 0x1c, 0xe8, 0x78, 0xa7, 0xdc}}, - {"suit", N_("At the office"), + {"suit", {0xb7, 0x08, 0x67, 0xf5, 0x38, 0x25, 0x43, 0x27, 0xa1, 0xff, 0xcf, 0x4c, 0xc1, 0x93, 0x97, 0x97}}, - {"bathing", N_("Taking a bath"), + {"bathing", {0x5a, 0x58, 0x1e, 0xa1, 0xe5, 0x80, 0x43, 0x0c, 0xa0, 0x6f, 0x61, 0x22, 0x98, 0xb7, 0xe4, 0xc7}}, - {"tv", N_("Watching TV"), + {"tv", {0x80, 0x53, 0x7d, 0xe2, 0xa4, 0x67, 0x4a, 0x76, 0xb3, 0x54, 0x6d, 0xfd, 0x07, 0x5f, 0x5e, 0xc6}}, - {"excited", N_("Having fun"), + {"excited", {0x6f, 0x49, 0x30, 0x98, 0x4f, 0x7c, 0x4a, 0xff, 0xa2, 0x76, 0x34, 0xa0, 0x3b, 0xce, 0xae, 0xa7}}, - {"sleeping", N_("Sleeping"), + {"sleeping", {0x78, 0x5e, 0x8c, 0x48, 0x40, 0xd3, 0x4c, 0x65, 0x88, 0x6f, 0x04, 0xcf, 0x3f, 0x3f, 0x43, 0xdf}}, - {"hiptop", N_("Using a PDA"), + {"hiptop", {0x10, 0x11, 0x17, 0xc9, 0xa3, 0xb0, 0x40, 0xf9, 0x81, 0xac, 0x49, 0xe1, 0x59, 0xfb, 0xd5, 0xd4}}, - {"in_love", N_("In love"), + {"in_love", {0xdd, 0xcf, 0x0e, 0xa9, 0x71, 0x95, 0x40, 0x48, 0xa9, 0xc6, 0x41, 0x32, 0x06, 0xd6, 0xf2, 0x80}}, - /* Sleepy / Tired */ - {"sleepy", N_("Sleepy"), + {"sleepy", {0x83, 0xc9, 0xb7, 0x8e, 0x77, 0xe7, 0x43, 0x78, 0xb2, 0xc5, 0xfb, 0x6c, 0xfc, 0xc3, 0x5b, 0xec}}, - {"meeting", N_("Meeting friends"), + {"meeting", {0xf1, 0x8a, 0xb5, 0x2e, 0xdc, 0x57, 0x49, 0x1d, 0x99, 0xdc, 0x64, 0x44, 0x50, 0x24, 0x57, 0xaf}}, - {"phone", N_("On the phone"), + {"phone", {0x12, 0x92, 0xe5, 0x50, 0x1b, 0x64, 0x4f, 0x66, 0xb2, 0x06, 0xb2, 0x9a, 0xf3, 0x78, 0xe4, 0x8d}}, - {"surfing", N_("Surfing"), + {"surfing", {0xa6, 0xed, 0x55, 0x7e, 0x6b, 0xf7, 0x44, 0xd4, 0xa5, 0xd4, 0xd2, 0xe7, 0xd9, 0x5c, 0xe8, 0x1f}}, - /* "I am mobile." / "John is mobile." */ - {"mobile", N_("Mobile"), + {"mobile", {0x16, 0x0c, 0x60, 0xbb, 0xdd, 0x44, 0x43, 0xf3, 0x91, 0x40, 0x05, 0x0f, 0x00, 0xe6, 0xc0, 0x09}}, - {"search", N_("Searching the web"), + {"search", {0xd4, 0xe2, 0xb0, 0xba, 0x33, 0x4e, 0x4f, 0xa5, 0x98, 0xd0, 0x11, 0x7d, 0xbf, 0x4d, 0x3c, 0xc8}}, - {"party", N_("At a party"), + {"party", {0xe6, 0x01, 0xe4, 0x1c, 0x33, 0x73, 0x4b, 0xd1, 0xbc, 0x06, 0x81, 0x1d, 0x6c, 0x32, 0x3d, 0x81}}, - {"coffee", N_("Having Coffee"), + {"coffee", {0x1b, 0x78, 0xae, 0x31, 0xfa, 0x0b, 0x4d, 0x38, 0x93, 0xd1, 0x99, 0x7e, 0xee, 0xaf, 0xb2, 0x18}}, - /* Playing video games */ - {"console", N_("Gaming"), + {"console", {0xd4, 0xa6, 0x11, 0xd0, 0x8f, 0x01, 0x4e, 0xc0, 0x92, 0x23, 0xc5, 0xb6, 0xbe, 0xc6, 0xcc, 0xf0}}, - {"internet", N_("Browsing the web"), + {"internet", {0x12, 0xd0, 0x7e, 0x3e, 0xf8, 0x85, 0x48, 0x9e, 0x8e, 0x97, 0xa7, 0x2a, 0x65, 0x51, 0xe5, 0x8d}}, - {"cigarette", N_("Smoking"), + {"cigarette", {0x64, 0x43, 0xc6, 0xaf, 0x22, 0x60, 0x45, 0x17, 0xb5, 0x8c, 0xd7, 0xdf, 0x8e, 0x29, 0x03, 0x52}}, - {"writing", N_("Writing"), + {"writing", {0x00, 0x72, 0xd9, 0x08, 0x4a, 0xd1, 0x43, 0xdd, 0x91, 0x99, 0x6f, 0x02, 0x69, 0x66, 0x02, 0x6f}}, - /* Drinking [Alcohol] */ - {"beer", N_("Drinking"), + {"beer", {0x8c, 0x50, 0xdb, 0xae, 0x81, 0xed, 0x47, 0x86, 0xac, 0xca, 0x16, 0xcc, 0x32, 0x13, 0xc7, 0xb7}}, - {"music", N_("Listening to music"), + {"music", {0x61, 0xbe, 0xe0, 0xdd, 0x8b, 0xdd, 0x47, 0x5d, 0x8d, 0xee, 0x5f, 0x4b, 0xaa, 0xcf, 0x19, 0xa7}}, - {"studying", N_("Studying"), + {"studying", {0x60, 0x9d, 0x52, 0xf8, 0xa2, 0x9a, 0x49, 0xa6, 0xb2, 0xa0, 0x25, 0x24, 0xc5, 0xe9, 0xd2, 0x60}}, - {"working", N_("Working"), + {"working", {0xba, 0x74, 0xdb, 0x3e, 0x9e, 0x24, 0x43, 0x4b, 0x87, 0xb6, 0x2f, 0x6b, 0x8d, 0xfe, 0xe5, 0x0f}}, - {"restroom", N_("In the restroom"), + {"restroom", {0x16, 0xf5, 0xb7, 0x6f, 0xa9, 0xd2, 0x40, 0x35, - 0x8c, 0xc5, 0xc0, 0x84, 0x70, 0x3c, 0x98, 0xfa}} + 0x8c, 0xc5, 0xc0, 0x84, 0x70, 0x3c, 0x98, 0xfa}}, + + {NULL, + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} }; +/* Keep this array synchronized with icq_custom_icons. */ +static PurpleMood icq_purple_moods[] = { + {"thinking", N_("Thinking"), NULL}, + {"busy", N_("Busy"), NULL}, + {"shopping", N_("Shopping"), NULL}, + /* This was in the original patch, but isn't what the official client + * (ICQ 6) sets when you choose its typewriter icon. */ + {"typing", NULL, NULL}, + {"question", N_("Questioning"), NULL}, + {"angry", N_("Angry"), NULL}, + {"plate", N_("Eating"), NULL}, + {"cinema", N_("Watching a movie"), NULL}, + {"sick", N_("Sick"), NULL}, + {"typing", N_("Typing"), NULL}, + {"suit", N_("At the office"), NULL}, + {"bathing", N_("Taking a bath"), NULL}, + {"tv", N_("Watching TV"), NULL}, + {"excited", N_("Having fun"), NULL}, + {"sleeping", N_("Sleeping"), NULL}, + {"hiptop", N_("Using a PDA"), NULL}, + {"in_love", N_("In love"), NULL}, + /* Sleepy / Tired */ + {"sleepy", N_("Sleepy"), NULL}, + {"meeting", N_("Meeting friends"), NULL}, + {"phone", N_("On the phone"), NULL}, + {"surfing", N_("Surfing"), NULL}, + /* "I am mobile." / "John is mobile." */ + {"mobile", N_("Mobile"), NULL}, + {"search", N_("Searching the web"), NULL}, + {"party", N_("At a party"), NULL}, + {"coffee", N_("Having Coffee"), NULL}, + /* Playing video games */ + {"console", N_("Gaming"), NULL}, + {"internet", N_("Browsing the web"), NULL}, + {"cigarette", N_("Smoking"), NULL}, + {"writing", N_("Writing"), NULL}, + /* Drinking [Alcohol] */ + {"beer", N_("Drinking"), NULL}, + {"music", N_("Listening to music"), NULL}, + {"studying", N_("Studying"), NULL}, + {"working", N_("Working"), NULL}, + {"restroom", N_("In the restroom"), NULL}, + /* Mark the last record. */ + {NULL, NULL, NULL}, +}; + + /* * Add the userinfo to our linked list. If we already have userinfo * for this buddy, then just overwrite parts of the old data. @@ -652,10 +695,10 @@ aim_receive_custom_icon(OscarData *od, ByteStream *bs, int len) cap = byte_stream_getraw(bs, 0x10); - for (i = 1; i < G_N_ELEMENTS(aim_custom_icons); i++) { - if (memcmp(&aim_custom_icons[i].data, cap, 0x10) == 0) { - purple_debug_misc("oscar", "Custom status icon: %s\n", aim_custom_icons[i].descriptivename); - result = aim_custom_icons[i].mood; + for (i = 0; icq_custom_icons[i].mood; i++) { + if (memcmp(&icq_custom_icons[i].data, cap, 0x10) == 0) { + purple_debug_misc("oscar", "Custom status icon: %s\n", icq_purple_moods[i].description); + result = icq_custom_icons[i].mood; break; /* should only match once... */ } } @@ -1741,43 +1784,56 @@ locate_modfirst(OscarData *od, aim_module_t *mod) return 0; } -#if 1 //rlaager -size_t aim_get_custom_icons_count(void) -{ - return G_N_ELEMENTS(aim_custom_icons); -} - -char* aim_get_custom_icon_mood(gint32 no) +#if 0 //rlaager +const char* aim_get_custom_icon_mood(gint32 no) { if (no >= G_N_ELEMENTS(aim_custom_icons) || no < 1) return NULL; - return aim_custom_icons[no].mood; + return aim_custom_icons[no].mood.mood; } +#endif -char* aim_get_custom_icon_descriptivename(gint32 no) +const char* +icq_get_custom_icon_description(const char *mood) { - if (no >= G_N_ELEMENTS(aim_custom_icons) || no < 1) + int i; + + if (!(mood && *mood)) return NULL; - return aim_custom_icons[no].descriptivename; + + for (i = 0; icq_custom_icons[i].mood; i++) { + /* We check that description is not NULL to exclude + * duplicates, like the typing duplicate. */ + if (icq_purple_moods[i].description && + !strcmp(mood, icq_custom_icons[i].mood)) { + return icq_purple_moods[i].description; + } + } + + return NULL; } -#endif guint8* -aim_get_custom_icon_data(const char *mood) +icq_get_custom_icon_data(const char *mood) { int i; if (!(mood && *mood)) return NULL; - for (i = 1; i < G_N_ELEMENTS(aim_custom_icons); i++) { - /* We check that descriptivename is not NULL to exclude + for (i = 0; icq_custom_icons[i].mood; i++) { + /* We check that description is not NULL to exclude * duplicates, like the typing duplicate. */ - if (aim_custom_icons[i].descriptivename && - aim_custom_icons[i].mood && - !strcmp(mood, aim_custom_icons[i].mood)) { - return (guint8 *)aim_custom_icons[i].data; + if (icq_purple_moods[i].description && + !strcmp(mood, icq_custom_icons[i].mood)) { + return (guint8 *)icq_custom_icons[i].data; } } return NULL; } + +PurpleMood* +icq_get_purple_moods(PurpleAccount *account) +{ + return icq_purple_moods; +} diff --git a/libpurple/protocols/oscar/libicq.c b/libpurple/protocols/oscar/libicq.c index fae6fd2b64..57dd7c6650 100644 --- a/libpurple/protocols/oscar/libicq.c +++ b/libpurple/protocols/oscar/libicq.c @@ -107,6 +107,7 @@ static PurplePluginProtocolInfo prpl_info = sizeof(PurplePluginProtocolInfo), /* struct_size */ icq_get_account_text_table, /* get_account_text_table */ + oscar_get_purple_moods, /* get_moods */ }; static PurplePluginInfo info = diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 3e2844741d..bdb98607cd 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -934,6 +934,16 @@ static void oscar_user_info_append_status(PurpleConnection *gc, PurpleNotifyUser } + if (presence) { + const char *mood; + const char *description; + status = purple_presence_get_status(presence, "mood"); + mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); + description = icq_get_custom_icon_description(mood); + if (description && *description) + purple_notify_user_info_add_pair(user_info, _("Mood"), _(description)); + } + purple_notify_user_info_add_pair(user_info, _("Status"), message); g_free(message); } @@ -4866,8 +4876,11 @@ oscar_set_status(PurpleAccount *account, PurpleStatus *status) return; /* There's no need to do the stuff below for mood updates. */ - if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) + if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) { + PurpleConnection *gc = purple_account_get_connection(account); + aim_locate_setcaps((OscarData *)gc->proto_data, purple_caps); return; + } /* Set the AIM-style away message for both AIM and ICQ accounts */ oscar_set_info_and_status(account, FALSE, NULL, TRUE, status); @@ -5795,6 +5808,11 @@ int oscar_send_chat(PurpleConnection *gc, int id, const char *message, PurpleMes return 0; } +PurpleMood* oscar_get_purple_moods(PurpleAccount *account) +{ + return icq_get_purple_moods(account); +} + const char *oscar_list_icon_icq(PurpleAccount *a, PurpleBuddy *b) { if ((b == NULL) || (b->name == NULL) || aim_snvalid_sms(b->name)) @@ -6762,99 +6780,6 @@ oscar_send_file(PurpleConnection *gc, const char *who, const char *file) purple_xfer_request(xfer); } -/* XXX: rlaager wants UI in the UI. */ -#if 1 -static void -oscar_show_icq_moods_cb(PurpleConnection *gc, PurpleRequestFields *fields) { - OscarData *od = gc->proto_data; - PurpleRequestField *f; - GList *l; - - f = purple_request_fields_get_field(fields, "mood"); - l = purple_request_field_list_get_selected(f); - - if (l) { - const char *mood = purple_request_field_list_get_data(f, l->data); - PurpleAccount *account = purple_connection_get_account(gc); - - if (mood != NULL) { - purple_account_set_status(account, "mood", TRUE, - PURPLE_MOOD_NAME, mood, - NULL); - } else { - purple_account_set_status(account, "mood", FALSE, NULL); - } - } - - aim_locate_setcaps(od, purple_caps); -} - -static void -oscar_show_icq_moods(PurplePluginAction *action) -{ - PurpleConnection *gc = (PurpleConnection *) action->context; - PurpleAccount *account = purple_connection_get_account(gc); - PurplePresence *presence = purple_account_get_presence(account); - PurpleStatus *status = purple_presence_get_status(presence, "mood"); - const char *current_mood; - PurpleRequestFields *fields; - PurpleRequestFieldGroup *g; - PurpleRequestField *f; - guint32 i; - char* na_fn; - - current_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); - - fields = purple_request_fields_new(); - - g = purple_request_field_group_new(NULL); - - f = purple_request_field_list_new("mood", _("Please select your mood from the list.")); - - na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); - - purple_request_field_list_add_icon(f, _("None"), na_fn, NULL); - if (current_mood == NULL) - purple_request_field_list_add_selected(f, _("None")); - - g_free(na_fn); - - /* TODO: rlaager wants this sorted. */ - for (i = 1; i < aim_get_custom_icons_count(); i++) { - const char *mood = aim_get_custom_icon_mood(i); - const char *icon_desc = aim_get_custom_icon_descriptivename(i); - char *icon_path; - char *filename; - - if (mood == NULL || icon_desc == NULL) - continue; - - icon_path = g_strdup_printf("%s.png", mood); - filename = g_build_filename("pixmaps", "pidgin", - "emblems", "16", - icon_path, NULL); - g_free(icon_path); - - purple_request_field_list_add_icon(f, _(icon_desc), - filename, (gpointer)mood); - g_free(filename); - - if (current_mood && !strcmp(current_mood, mood)) - purple_request_field_list_add_selected(f, _(icon_desc)); - } - purple_request_field_group_add_field(g, f); - - purple_request_fields_add_group(fields, g); - - purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), - NULL, fields, - _("OK"), G_CALLBACK(oscar_show_icq_moods_cb), - _("Cancel"), NULL, - purple_connection_get_account(gc), NULL, NULL, - gc); -} -#endif - GList * oscar_actions(PurplePlugin *plugin, gpointer context) { @@ -6897,13 +6822,6 @@ oscar_actions(PurplePlugin *plugin, gpointer context) act = purple_plugin_action_new(_("Set Privacy Options..."), oscar_show_icq_privacy_opts); menu = g_list_prepend(menu, act); - -/* XXX: rlaager wants UI in the UI. */ -#if 1 - act = purple_plugin_action_new(_("Set Mood..."), - oscar_show_icq_moods); - menu = g_list_prepend(menu, act); -#endif } else { diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h index a22c7bb025..9482357758 100644 --- a/libpurple/protocols/oscar/oscar.h +++ b/libpurple/protocols/oscar/oscar.h @@ -1108,12 +1108,9 @@ int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *); #if 0 int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info); #endif -#if 1 -size_t aim_get_custom_icons_count(void); //rlaager -char* aim_get_custom_icon_mood(gint32 no);// rlaager -char* aim_get_custom_icon_descriptivename(gint32 no); // rlaager -#endif -guint8* aim_get_custom_icon_data(const char *mood); +PurpleMood* icq_get_purple_moods(PurpleAccount *account); +const char* icq_get_custom_icon_description(const char *mood); +guint8* icq_get_custom_icon_data(const char *mood); int icq_im_xstatus_request(OscarData *od, const char *sn); /* 0x0003 - family_buddy.c */ diff --git a/libpurple/protocols/oscar/oscarcommon.h b/libpurple/protocols/oscar/oscarcommon.h index 564daef492..5957658723 100644 --- a/libpurple/protocols/oscar/oscarcommon.h +++ b/libpurple/protocols/oscar/oscarcommon.h @@ -29,6 +29,7 @@ #include "prpl.h" #include "version.h" #include "notify.h" +#include "status.h" #define OSCAR_DEFAULT_LOGIN_SERVER "login.messaging.aol.com" #define OSCAR_DEFAULT_LOGIN_PORT 5190 @@ -46,6 +47,7 @@ #ifdef _WIN32 const char *oscar_get_locale_charset(void); #endif +PurpleMood* oscar_get_purple_moods(PurpleAccount *account); const char *oscar_list_icon_icq(PurpleAccount *a, PurpleBuddy *b); const char *oscar_list_icon_aim(PurpleAccount *a, PurpleBuddy *b); const char* oscar_list_emblem(PurpleBuddy *b); diff --git a/libpurple/protocols/oscar/tlv.c b/libpurple/protocols/oscar/tlv.c index 579449c121..92e42a4ff4 100644 --- a/libpurple/protocols/oscar/tlv.c +++ b/libpurple/protocols/oscar/tlv.c @@ -421,7 +421,7 @@ int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, byte_stream_putcaps(&bs, caps); /* adding of custom icon GUID */ - data = aim_get_custom_icon_data(mood); + data = icq_get_custom_icon_data(mood); if (data != NULL) byte_stream_putraw(&bs, data, 16); diff --git a/libpurple/prpl.h b/libpurple/prpl.h index 43bb6e3cad..501c71e884 100644 --- a/libpurple/prpl.h +++ b/libpurple/prpl.h @@ -440,6 +440,12 @@ struct _PurplePluginProtocolInfo * destroyed by the caller when it's no longer needed. */ GHashTable *(*get_account_text_table)(PurpleAccount *account); + + /** + * Returns an array of "PurpleMood"s, with the last one having + * "mood" set to @c NULL. + */ + PurpleMood *(*get_moods)(PurpleAccount *account); }; #define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \ diff --git a/libpurple/status.h b/libpurple/status.h index f9a8093174..47bc65ec64 100644 --- a/libpurple/status.h +++ b/libpurple/status.h @@ -77,6 +77,12 @@ typedef struct _PurpleStatusAttr PurpleStatusAttr; typedef struct _PurplePresence PurplePresence; typedef struct _PurpleStatus PurpleStatus; +typedef struct _PurpleMood { + const char *mood; + const char *description; + gpointer *padding; +} PurpleMood; + /** * A context for a presence. * diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index c71f6f8ebc..f0a8d6445e 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -7624,6 +7624,95 @@ disable_account_cb(GtkCheckMenuItem *widget, gpointer data) purple_account_set_enabled(account, PIDGIN_UI, FALSE); } +static void +edit_mood_cb(PurpleConnection *gc, PurpleRequestFields *fields) +{ + PurpleRequestField *f; + GList *l; + + f = purple_request_fields_get_field(fields, "mood"); + l = purple_request_field_list_get_selected(f); + + if (l) { + const char *mood = purple_request_field_list_get_data(f, l->data); + PurpleAccount *account = purple_connection_get_account(gc); + + if (mood != NULL) { + purple_account_set_status(account, "mood", TRUE, + PURPLE_MOOD_NAME, mood, + NULL); + } else { + purple_account_set_status(account, "mood", FALSE, NULL); + } + } +} + +static void +set_mood_cb(GtkWidget *widget, PurpleAccount *account) +{ + PurplePresence *presence = purple_account_get_presence(account); + PurpleStatus *status = purple_presence_get_status(presence, "mood"); + const char *current_mood; + PurpleRequestFields *fields; + PurpleRequestFieldGroup *g; + PurpleRequestField *f; + char* na_fn; + PurpleConnection *gc = purple_account_get_connection(account); + PurplePluginProtocolInfo *prpl_info; + PurpleMood *mood; + + g_return_if_fail(gc->prpl != NULL); + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); + + current_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); + + fields = purple_request_fields_new(); + g = purple_request_field_group_new(NULL); + f = purple_request_field_list_new("mood", _("Please select your mood from the list")); + + na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); + + purple_request_field_list_add_icon(f, _("None"), na_fn, NULL); + if (current_mood == NULL) + purple_request_field_list_add_selected(f, _("None")); + + g_free(na_fn); + + /* TODO: rlaager wants this sorted. */ + for (mood = prpl_info->get_moods(account); + mood->mood != NULL ; mood++) + { + char *icon_path; + char *filename; + + if (mood->mood == NULL || mood->description == NULL) + continue; + + icon_path = g_strdup_printf("%s.png", mood->mood); + filename = g_build_filename("pixmaps", "pidgin", + "emblems", "16", + icon_path, NULL); + g_free(icon_path); + + purple_request_field_list_add_icon(f, _(mood->description), + filename, mood->mood); + g_free(filename); + + if (current_mood && !strcmp(current_mood, mood->mood)) + purple_request_field_list_add_selected(f, _(mood->description)); + } + purple_request_field_group_add_field(g, f); + + purple_request_fields_add_group(fields, g); + + purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), + NULL, fields, + _("OK"), G_CALLBACK(edit_mood_cb), + _("Cancel"), NULL, + purple_connection_get_account(gc), + NULL, NULL, gc); +} + void pidgin_blist_update_accounts_menu(void) { @@ -7697,6 +7786,8 @@ pidgin_blist_update_accounts_menu(void) PurpleAccount *account = NULL; GdkPixbuf *pixbuf = NULL; PurplePlugin *plugin = NULL; + PurplePluginProtocolInfo *prpl_info; + GList *types; account = accounts->data; accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu)); @@ -7735,10 +7826,45 @@ pidgin_blist_update_accounts_menu(void) gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); gtk_widget_show(menuitem); - pidgin_separator(submenu); - gc = purple_account_get_connection(account); plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; + +printf("HERE1\n"); +if (plugin){ + printf("HERE1.1\n"); + if (PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) { + printf("HERE1.2: %s\n", purple_account_get_username(account)); + if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) { + printf("HERE1.3\n"); + } + } +} + if (plugin && + (prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) && + PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) + { +printf("HERE2\n"); + for (types = purple_account_get_status_types(account); + types != NULL ; types = types->next) + { + PurpleStatusType *type = types->data; +printf("HERE3\n"); + if (strcmp(purple_status_type_get_id(type), "mood") != 0) + continue; +printf("HERE4\n"); + menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood...")); + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(set_mood_cb), account); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + gtk_widget_show(menuitem); + + /* Be safe. It shouldn't match more than once anyway */ + break; + } + } + + pidgin_separator(submenu); + if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { build_plugin_actions(submenu, plugin, gc); } else { -- cgit v1.2.1 From 5f89cb7b20c43a76d20f52578773af617fc56b2b Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 08:00:25 +0000 Subject: Convert XMPP to use an array of PurpleMoods internally. --- libpurple/protocols/jabber/usermood.c | 187 +++++++++++++++++----------------- 1 file changed, 94 insertions(+), 93 deletions(-) diff --git a/libpurple/protocols/jabber/usermood.c b/libpurple/protocols/jabber/usermood.c index 4bde3a3d2b..e3d7c409ed 100644 --- a/libpurple/protocols/jabber/usermood.c +++ b/libpurple/protocols/jabber/usermood.c @@ -28,92 +28,93 @@ #include "request.h" #include "debug.h" -static const char * const moodstrings[] = { - "afraid", - "amazed", - "amorous", - "angry", - "annoyed", - "anxious", - "aroused", - "ashamed", - "bored", - "brave", - "calm", - "cautious", - "cold", - "confident", - "confused", - "contemplative", - "contented", - "cranky", - "crazy", - "creative", - "curious", - "dejected", - "depressed", - "disappointed", - "disgusted", - "dismayed", - "distracted", - "embarrassed", - "envious", - "excited", - "flirtatious", - "frustrated", - "grateful", - "grieving", - "grumpy", - "guilty", - "happy", - "hopeful", - "hot", - "humbled", - "humiliated", - "hungry", - "hurt", - "impressed", - "in_awe", - "in_love", - "indignant", - "interested", - "intoxicated", - "invincible", - "jealous", - "lonely", - "lost", - "lucky", - "mean", - "moody", - "nervous", - "neutral", - "offended", - "outraged", - "playful", - "proud", - "relaxed", - "relieved", - "remorseful", - "restless", - "sad", - "sarcastic", - "satisfied", - "serious", - "shocked", - "shy", - "sick", - "sleepy", - "spontaneous", - "stressed", - "strong", - "surprised", - "thankful", - "thirsty", - "tired", - "undefined", - "weak", - "worried", - NULL +static PurpleMood moods[] = { + {"afraid", N_("Afraid"), NULL}, + {"amazed", N_("Amazed"), NULL}, + {"amorous", N_("Amorous"), NULL}, + {"angry", N_("Angry"), NULL}, + {"annoyed", N_("Annoyed"), NULL}, + {"anxious", N_("Anxious"), NULL}, + {"aroused", N_("Aroused"), NULL}, + {"ashamed", N_("Ashamed"), NULL}, + {"bored", N_("Bored"), NULL}, + {"brave", N_("Brave"), NULL}, + {"calm", N_("Calm"), NULL}, + {"cautious", N_("Cautious"), NULL}, + {"cold", N_("Cold"), NULL}, + {"confident", N_("Confident"), NULL}, + {"confused", N_("Confused"), NULL}, + {"contemplative", N_("Contemplative"), NULL}, + {"contented", N_("Contented"), NULL}, + {"cranky", N_("Cranky"), NULL}, + {"crazy", N_("Crazy"), NULL}, + {"creative", N_("Creative"), NULL}, + {"curious", N_("Curious"), NULL}, + {"dejected", N_("Dejected"), NULL}, + {"depressed", N_("Depressed"), NULL}, + {"disappointed", N_("Disappointed"), NULL}, + {"disgusted", N_("Disgusted"), NULL}, + {"dismayed", N_("Dismayed"), NULL}, + {"distracted", N_("Distracted"), NULL}, + {"embarrassed", N_("Embarrassed"), NULL}, + {"envious", N_("Envious"), NULL}, + {"excited", N_("Excited"), NULL}, + {"flirtatious", N_("Flirtatious"), NULL}, + {"frustrated", N_("Frustrated"), NULL}, + {"grateful", N_("Grateful"), NULL}, + {"grieving", N_("Grieving"), NULL}, + {"grumpy", N_("Grumpy"), NULL}, + {"guilty", N_("Guilty"), NULL}, + {"happy", N_("Happy"), NULL}, + {"hopeful", N_("Hopeful"), NULL}, + {"hot", N_("Hot"), NULL}, + {"humbled", N_("Humbled"), NULL}, + {"humiliated", N_("Humiliated"), NULL}, + {"hungry", N_("Hungry"), NULL}, + {"hurt", N_("Hurt"), NULL}, + {"impressed", N_("Impressed"), NULL}, + {"in_awe", N_("In_awe"), NULL}, + {"in_love", N_("In_love"), NULL}, + {"indignant", N_("Indignant"), NULL}, + {"interested", N_("Interested"), NULL}, + {"intoxicated", N_("Intoxicated"), NULL}, + {"invincible", N_("Invincible"), NULL}, + {"jealous", N_("Jealous"), NULL}, + {"lonely", N_("Lonely"), NULL}, + {"lost", N_("Lost"), NULL}, + {"lucky", N_("Lucky"), NULL}, + {"mean", N_("Mean"), NULL}, + {"moody", N_("Moody"), NULL}, + {"nervous", N_("Nervous"), NULL}, + {"neutral", N_("Neutral"), NULL}, + {"offended", N_("Offended"), NULL}, + {"outraged", N_("Outraged"), NULL}, + {"playful", N_("Playful"), NULL}, + {"proud", N_("Proud"), NULL}, + {"relaxed", N_("Relaxed"), NULL}, + {"relieved", N_("Relieved"), NULL}, + {"remorseful", N_("Remorseful"), NULL}, + {"restless", N_("Restless"), NULL}, + {"sad", N_("Sad"), NULL}, + {"sarcastic", N_("Sarcastic"), NULL}, + {"satisfied", N_("Satisfied"), NULL}, + {"serious", N_("Serious"), NULL}, + {"shocked", N_("Shocked"), NULL}, + {"shy", N_("Shy"), NULL}, + {"sick", N_("Sick"), NULL}, + {"sleepy", N_("Sleepy"), NULL}, + {"spontaneous", N_("Spontaneous"), NULL}, + {"stressed", N_("Stressed"), NULL}, + {"strong", N_("Strong"), NULL}, + {"surprised", N_("Surprised"), NULL}, + {"thankful", N_("Thankful"), NULL}, + {"thirsty", N_("Thirsty"), NULL}, + {"tired", N_("Tired"), NULL}, + {"undefined", N_("Undefined"), NULL}, + {"weak", N_("Weak"), NULL}, + {"worried", N_("Worried"), NULL}, + /* Mark the last record. */ + {NULL, NULL, NULL} }; static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { @@ -137,10 +138,10 @@ static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { moodtext = xmlnode_get_data(moodinfo); } else { int i; - for (i = 0; moodstrings[i]; ++i) { + for (i = 0; moods[i].mood; ++i) { /* verify that the mood is known (valid) */ - if (!strcmp(moodinfo->name, moodstrings[i])) { - newmood = moodstrings[i]; + if (!strcmp(moodinfo->name, moods[i].mood)) { + newmood = moods[i].mood; break; } } @@ -167,7 +168,7 @@ void jabber_mood_init(void) { static void do_mood_set_from_fields(PurpleConnection *gc, PurpleRequestFields *fields) { JabberStream *js; - const int max_mood_idx = sizeof(moodstrings) / sizeof(moodstrings[0]) - 1; + const int max_mood_idx = sizeof(moods) / sizeof(moods[0]) - 1; int selected_mood = purple_request_fields_get_choice(fields, "mood"); if (!PURPLE_CONNECTION_IS_VALID(gc)) { @@ -182,7 +183,7 @@ static void do_mood_set_from_fields(PurpleConnection *gc, PurpleRequestFields *f return; } - jabber_mood_set(js, moodstrings[selected_mood], purple_request_fields_get_string(fields, "text")); + jabber_mood_set(js, moods[selected_mood].mood, purple_request_fields_get_string(fields, "text")); } static void do_mood_set_mood(PurplePluginAction *action) { @@ -200,8 +201,8 @@ static void do_mood_set_mood(PurplePluginAction *action) { field = purple_request_field_choice_new("mood", _("Mood"), 0); - for(i = 0; moodstrings[i]; ++i) - purple_request_field_choice_add(field, _(moodstrings[i])); + for(i = 0; moods[i].mood; ++i) + purple_request_field_choice_add(field, _(moods[i].description)); purple_request_field_set_required(field, TRUE); purple_request_field_group_add_field(group, field); -- cgit v1.2.1 From 30e0ebd39329cc76b251198c7545c852ad0c7439 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 08:04:36 +0000 Subject: Remove some stray debugging printf()s. --- pidgin/gtkblist.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index f0a8d6445e..df59dca2a2 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -7829,29 +7829,18 @@ pidgin_blist_update_accounts_menu(void) gc = purple_account_get_connection(account); plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; -printf("HERE1\n"); -if (plugin){ - printf("HERE1.1\n"); - if (PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) { - printf("HERE1.2: %s\n", purple_account_get_username(account)); - if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) { - printf("HERE1.3\n"); - } - } -} if (plugin && (prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) { -printf("HERE2\n"); for (types = purple_account_get_status_types(account); types != NULL ; types = types->next) { PurpleStatusType *type = types->data; -printf("HERE3\n"); + if (strcmp(purple_status_type_get_id(type), "mood") != 0) continue; -printf("HERE4\n"); + menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood...")); g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(set_mood_cb), account); -- cgit v1.2.1 From 3e049df98197f65c5dd418898939030624aaa04c Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 20:34:02 +0000 Subject: Fix a rename that I accidentally did as an add. --- pidgin/pixmaps/emotes/small/16/happy.png | Bin 914 -> 973 bytes pidgin/pixmaps/emotes/small/16/shock.png | Bin 952 -> 0 bytes pidgin/pixmaps/emotes/small/16/shocked.png | Bin 937 -> 952 bytes pidgin/pixmaps/emotes/small/16/smile.png | Bin 973 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 pidgin/pixmaps/emotes/small/16/shock.png delete mode 100644 pidgin/pixmaps/emotes/small/16/smile.png diff --git a/pidgin/pixmaps/emotes/small/16/happy.png b/pidgin/pixmaps/emotes/small/16/happy.png index 2daa05926c..cc6d3e2e89 100644 Binary files a/pidgin/pixmaps/emotes/small/16/happy.png and b/pidgin/pixmaps/emotes/small/16/happy.png differ diff --git a/pidgin/pixmaps/emotes/small/16/shock.png b/pidgin/pixmaps/emotes/small/16/shock.png deleted file mode 100644 index 0938170ee4..0000000000 Binary files a/pidgin/pixmaps/emotes/small/16/shock.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/shocked.png b/pidgin/pixmaps/emotes/small/16/shocked.png index 7746882016..0938170ee4 100644 Binary files a/pidgin/pixmaps/emotes/small/16/shocked.png and b/pidgin/pixmaps/emotes/small/16/shocked.png differ diff --git a/pidgin/pixmaps/emotes/small/16/smile.png b/pidgin/pixmaps/emotes/small/16/smile.png deleted file mode 100644 index cc6d3e2e89..0000000000 Binary files a/pidgin/pixmaps/emotes/small/16/smile.png and /dev/null differ -- cgit v1.2.1 From 8f781b6282efc383ba65b4719b08215046e3f8d9 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 20:38:19 +0000 Subject: Smiley changes: * Add :'-( as an alias for crying.png in the default set. * Add the XMPP smiley definitions from XEP-0038. I kept the default smileys in XMPP as well. * Add the hidden cyclops smiley from our default set to all of the per-protocol sets. I added all three hidden smileys to the MySpace set. * Rebuild the small.default.in set, after these changes. --- pidgin/pixmaps/emotes/default/24/default.theme.in | 56 +++++++++++++++++++++- pidgin/pixmaps/emotes/small/16/small.theme.in | 57 +++++++++++++++++------ 2 files changed, 99 insertions(+), 14 deletions(-) diff --git a/pidgin/pixmaps/emotes/default/24/default.theme.in b/pidgin/pixmaps/emotes/default/24/default.theme.in index d563f857bf..7dc5abd986 100644 --- a/pidgin/pixmaps/emotes/default/24/default.theme.in +++ b/pidgin/pixmaps/emotes/default/24/default.theme.in @@ -15,7 +15,7 @@ shocked.png =-O =-o kiss.png :-* glasses-cool.png 8-) embarrassed.png :-[ -crying.png :'( +crying.png :'( :'-( thinking.png :-/ :-\\ angel.png O:-) o:-) shut-mouth.png :-X @@ -27,6 +27,51 @@ shout.png >:o >:O ! cyclops.png O-) o-) +[XMPP] +# Following XEP-0038 + our default set, in default set order +happy.png :) :-) +excited.png :-D :-d :D :d +sad.png :-( :( +wink.png ;-) ;) +tongue.png :P :-P :-p :p +shocked.png =-O =-o +kiss.png :kiss: :-* +glasses-cool.png 8-) +embarrassed.png :-[ +crying.png :'-( :'( +thinking.png :-/ :-\\ +angel.png O:-) o:-) +shut-mouth.png :-X +moneymouth.png :-$ +foot-in-mouth.png :-! +shout.png >:o >:O + +# Following XEP-0038 +angry.png >:-( >:( +good.png :yes: +bad.png :no: +stop.png :wait: +rose.png @->-- :rose: +phone.png :telephone: +mail.png :email: +lamp.png :jabber: +cake.png :cake: +in_love.png :heart: :love: +love-over.png :brokenheart: +musical-note.png :music: +beer.png :beer: +coffee.png :coffee: +coins.png :money: +moon.png :moon: +sun.png :sun: +star.png :star: + +# Hidden icons from the default set. +! skywalker.png C:-) c:-) C:) c:) +! monkey.png :-(|) :(|) 8-|) +! cyclops.png O-) o-) + + # Following AIM 6.1 [AIM] happy.png :-) :) @@ -47,6 +92,7 @@ shut-mouth.png :-X glasses-cool.png 8-) ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) +! cyclops.png O-) o-) # Following Windows Live Messenger 8.1 @@ -129,6 +175,7 @@ sleepy.png |-) bunny.png ('.') ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) +! cyclops.png O-) o-) # Hidden MSN emotes cigarette.png (ci) (CI) @@ -234,6 +281,7 @@ girl.png /<00> /nv /woman boy.png /<11> /nan /man ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) +! cyclops.png O-) o-) # Following ICQ 6.0 @@ -270,6 +318,7 @@ glasses-cool.png 8-) amorous.png *IN\ LOVE* ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) +! cyclops.png O-) o-) # Following Yahoo! Messenger 8.1 @@ -330,6 +379,7 @@ cowboy.png <):) desire.png 8-> ! skywalker.png C:-) c:-) C:) c:) ! monkey.png :-(|) :(|) +! cyclops.png O-) o-) # Hidden Yahoo emotes alien.png =:) >-) @@ -392,3 +442,7 @@ pissed-off.png B| wink.png ;-) ;) sad.png :[ kiss.png :x +! skywalker.png C:-) c:-) C:) c:) +! monkey.png :-(|) :(|) +! cyclops.png O-) o-) + diff --git a/pidgin/pixmaps/emotes/small/16/small.theme.in b/pidgin/pixmaps/emotes/small/16/small.theme.in index 7f5e4a44f1..738a2b6c41 100644 --- a/pidgin/pixmaps/emotes/small/16/small.theme.in +++ b/pidgin/pixmaps/emotes/small/16/small.theme.in @@ -6,26 +6,51 @@ Author=Hylke Bons # Default smileys [default] -smile.png :) :-) +happy.png :) :-) excited.png :-D :-d :D :d sad.png :-( :( wink.png ;-) ;) tongue.png :P :-P :-p :p -shock.png =-O =-o +shocked.png =-O =-o kiss.png :-* embarrassed.png :-[ -crying.png :'( +crying.png :'( :'-( thinking.png :-/ :-\\ angel.png O:-) o:-) +[XMPP] +# Following XEP-0038 + our default set, in default set order +happy.png :) :-) +excited.png :-D :-d :D :d +sad.png :-( :( +wink.png ;-) ;) +tongue.png :P :-P :-p :p +shocked.png =-O =-o +kiss.png :kiss: :-* +embarrassed.png :-[ +crying.png :'-( :'( +thinking.png :-/ :-\\ +angel.png O:-) o:-) + +# Following XEP-0038 +angry.png >:-( >:( +phone.png :telephone: +in_love.png :heart: :love: +musical-note.png :music: +beer.png :beer: +coffee.png :coffee: + +# Hidden icons from the default set. + + # Following AIM 6.1 [AIM] -smile.png :-) :) +happy.png :-) :) wink.png ;-) ;) sad.png :-( :( tongue.png :-P :P :-p :p -shock.png =-O +shocked.png =-O kiss.png :-* excited.png :-D :D embarrassed.png :-[ @@ -36,10 +61,10 @@ crying.png :'( # Following Windows Live Messenger 8.1 [MSN] -smile.png :) :-) +happy.png :) :-) excited.png :D :d :-D :-d wink.png ;) ;-) -shock.png :-O :-o :O :o +shocked.png :-O :-o :O :o tongue.png :P :p :-P :-p angry.png :@ :-@ embarrassed.png :$ :-$ @@ -74,22 +99,25 @@ console.png (xx) (XX) # Following QQ 2006 [QQ] -shock.png /:O /jy /surprised +shocked.png /:O /jy /surprised party.png /8-) /dy /revel crying.png /:< /ll /cry sleeping.png /:Z /shui /sleep embarrassed.png /:-| /gg /embarassed excited.png /:D /cy /toothy_smile -smile.png /:) /wx /small_smile +happy.png /:) /wx /small_smile sad.png /:( /ng /sad sick.png /:T /tu /vomit sleepy.png /|-) /kun /sleepy +hot.png /:L /sweat question.png /? /yiw /question +afraid.png /shake /fad /shake amorous.png /love /aiq /love search.png /find /zhao /search hug-left.png /hug /yb /hug musical-note.png /music /yy /music coffee.png /coffee /kf /coffee +hungry.png /eat /fan /eat kiss.png /kiss /wen /kiss in_love.png /heart /xin /heart meeting.png /meeting /hy /meeting @@ -100,10 +128,10 @@ angry.png / /oh /angry # Following ICQ 6.0 [ICQ] -smile.png :-) :) +happy.png :-) :) neutral.png :-$ sad.png :-( :( -shock.png =-O +shocked.png =-O wink.png ;-) ;) tongue.png :-P :P :-p :p sleeping.png *TIRED* @@ -121,9 +149,9 @@ amorous.png *IN\ LOVE* # Following Yahoo! Messenger 8.1 [Yahoo] -smile.png :) :-) +happy.png :) :-) question.png :-/ :-\\ -shock.png :-O :O :-o :o +shocked.png :-O :O :-o :o devil.png >:) angel.png O:-) o:-) 0:-) sick.png :-& @@ -144,7 +172,9 @@ kiss.png :-* :* confused.png :-S :-s sarcastic.png /:) hug-left.png >:D< >:d< +hot.png #:-S #:-s party.png <:-P <:-p +nervous.png :-SS :-Ss :-sS :-ss # Hidden Yahoo emotes coffee.png ~o) ~O) @@ -168,3 +198,4 @@ tongue.png :P :p wink.png ;-) ;) sad.png :[ kiss.png :x + -- cgit v1.2.1 From 3ddfe86925dbe3e0da1410aeda74d54242cb7787 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Mon, 17 Nov 2008 21:07:43 +0000 Subject: Fix up the small theme's Makefile.am for the rename I screwed up. --- pidgin/pixmaps/emotes/small/16/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index ac8e362d51..713d6aad58 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -15,6 +15,7 @@ SMILEYS = \ dont-know.png \ excited.png \ grin.png \ + happy.png \ hug-left.png \ hug-right.png \ in_love.png \ @@ -30,12 +31,11 @@ SMILEYS = \ question.png \ sad.png \ shame.png \ - shock.png \ + shocked.png \ sick.png \ silent.png \ sleeping.png \ sleepy.png \ - smile.png \ thinking.png \ tongue.png \ tv.png \ -- cgit v1.2.1 From 0cb5b8fd6a0b5a369f6cc68ff707c22dcd3d5e87 Mon Sep 17 00:00:00 2001 From: John Bailey Date: Tue, 25 Nov 2008 17:06:45 +0000 Subject: Add minstrel, N3fr0n, and NightFox (respectively) to COPYRIGHT. --- COPYRIGHT | 3 +++ 1 file changed, 3 insertions(+) diff --git a/COPYRIGHT b/COPYRIGHT index 3252e99ef3..d02a524903 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -201,12 +201,14 @@ Thomas Huriaux Instant Messaging Freedom, Inc. Vitaliy Ischenko Intel Corporation +Andrew Ivanov Scott Jackson Hans Petter Jansson Henry Jen Benjamin Kahn Anders Kaseorg Praveen Karadakal +Tomáš Kebert John Kelm Jochen Kemnade Akuke Kok @@ -477,6 +479,7 @@ Ximian Ma Xuan Jared Yanovich Timmy Yee +Yuriy Yevgrafov Nickolai Zeldovich Tom Zickel Marco Ziech -- cgit v1.2.1 From 035d456ae31c5d38258e1d125fd86d452dfe6273 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Wed, 26 Nov 2008 22:44:08 +0000 Subject: Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to find the right icons. Thus, with a small function and a couple other small changes, I can shuffle all the icons around to eliminate the magic Makefile rules and all the duplicated icons at install-time. --- .mtn-ignore | 35 --- pidgin/gtkblist.c | 61 +++-- pidgin/gtkrequest.c | 7 +- pidgin/pixmaps/Makefile.am | 70 +----- pidgin/pixmaps/emblems/16/bathing.png | Bin 816 -> 0 bytes pidgin/pixmaps/emblems/16/cinema.png | Bin 659 -> 0 bytes pidgin/pixmaps/emblems/16/internet.png | Bin 999 -> 0 bytes pidgin/pixmaps/emblems/16/music.png | Bin 571 -> 0 bytes pidgin/pixmaps/emblems/16/restroom.png | Bin 716 -> 0 bytes pidgin/pixmaps/emblems/16/scalable/mobile.svg | 264 --------------------- pidgin/pixmaps/emblems/16/scalable/music.svg | 189 --------------- pidgin/pixmaps/emblems/16/shopping.png | Bin 645 -> 0 bytes pidgin/pixmaps/emblems/16/studying.png | Bin 718 -> 0 bytes pidgin/pixmaps/emblems/16/suit.png | Bin 804 -> 0 bytes pidgin/pixmaps/emblems/16/surfing.png | Bin 919 -> 0 bytes pidgin/pixmaps/emblems/16/typing.png | Bin 725 -> 0 bytes pidgin/pixmaps/emblems/16/working.png | Bin 924 -> 0 bytes pidgin/pixmaps/emblems/16/writing.png | Bin 714 -> 0 bytes pidgin/pixmaps/emotes/small/16/Makefile.am | 19 +- pidgin/pixmaps/emotes/small/16/bathing.png | Bin 0 -> 816 bytes pidgin/pixmaps/emotes/small/16/cinema.png | Bin 0 -> 659 bytes pidgin/pixmaps/emotes/small/16/internet.png | Bin 0 -> 999 bytes pidgin/pixmaps/emotes/small/16/music.png | Bin 0 -> 571 bytes pidgin/pixmaps/emotes/small/16/restroom.png | Bin 0 -> 716 bytes pidgin/pixmaps/emotes/small/16/scalable/mobile.svg | 264 +++++++++++++++++++++ pidgin/pixmaps/emotes/small/16/scalable/music.svg | 189 +++++++++++++++ pidgin/pixmaps/emotes/small/16/shopping.png | Bin 0 -> 645 bytes pidgin/pixmaps/emotes/small/16/studying.png | Bin 0 -> 718 bytes pidgin/pixmaps/emotes/small/16/suit.png | Bin 0 -> 804 bytes pidgin/pixmaps/emotes/small/16/surfing.png | Bin 0 -> 919 bytes pidgin/pixmaps/emotes/small/16/typing.png | Bin 0 -> 725 bytes pidgin/pixmaps/emotes/small/16/working.png | Bin 0 -> 924 bytes pidgin/pixmaps/emotes/small/16/writing.png | Bin 0 -> 714 bytes 33 files changed, 513 insertions(+), 585 deletions(-) delete mode 100644 pidgin/pixmaps/emblems/16/bathing.png delete mode 100644 pidgin/pixmaps/emblems/16/cinema.png delete mode 100644 pidgin/pixmaps/emblems/16/internet.png delete mode 100644 pidgin/pixmaps/emblems/16/music.png delete mode 100644 pidgin/pixmaps/emblems/16/restroom.png delete mode 100644 pidgin/pixmaps/emblems/16/scalable/mobile.svg delete mode 100644 pidgin/pixmaps/emblems/16/scalable/music.svg delete mode 100644 pidgin/pixmaps/emblems/16/shopping.png delete mode 100644 pidgin/pixmaps/emblems/16/studying.png delete mode 100644 pidgin/pixmaps/emblems/16/suit.png delete mode 100644 pidgin/pixmaps/emblems/16/surfing.png delete mode 100644 pidgin/pixmaps/emblems/16/typing.png delete mode 100644 pidgin/pixmaps/emblems/16/working.png delete mode 100644 pidgin/pixmaps/emblems/16/writing.png create mode 100644 pidgin/pixmaps/emotes/small/16/bathing.png create mode 100644 pidgin/pixmaps/emotes/small/16/cinema.png create mode 100644 pidgin/pixmaps/emotes/small/16/internet.png create mode 100644 pidgin/pixmaps/emotes/small/16/music.png create mode 100644 pidgin/pixmaps/emotes/small/16/restroom.png create mode 100644 pidgin/pixmaps/emotes/small/16/scalable/mobile.svg create mode 100644 pidgin/pixmaps/emotes/small/16/scalable/music.svg create mode 100644 pidgin/pixmaps/emotes/small/16/shopping.png create mode 100644 pidgin/pixmaps/emotes/small/16/studying.png create mode 100644 pidgin/pixmaps/emotes/small/16/suit.png create mode 100644 pidgin/pixmaps/emotes/small/16/surfing.png create mode 100644 pidgin/pixmaps/emotes/small/16/typing.png create mode 100644 pidgin/pixmaps/emotes/small/16/working.png create mode 100644 pidgin/pixmaps/emotes/small/16/writing.png diff --git a/.mtn-ignore b/.mtn-ignore index 710c1aa27e..3f6c88ab7b 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -37,41 +37,6 @@ pidgin-.*.tar.gz pidgin-.*.tar.bz2 pidgin-*.*.*-win32bin$ pidgin/pidgin$ -pidgin/pixmaps/emblems/16/afraid.png -pidgin/pixmaps/emblems/16/amorous.png -pidgin/pixmaps/emblems/16/angry.png -pidgin/pixmaps/emblems/16/beer.png -pidgin/pixmaps/emblems/16/busy.png -pidgin/pixmaps/emblems/16/cigarette.png -pidgin/pixmaps/emblems/16/coffee.png -pidgin/pixmaps/emblems/16/confused.png -pidgin/pixmaps/emblems/16/console.png -pidgin/pixmaps/emblems/16/disappointed.png -pidgin/pixmaps/emblems/16/embarrassed.png -pidgin/pixmaps/emblems/16/excited.png -pidgin/pixmaps/emblems/16/happy.png -pidgin/pixmaps/emblems/16/hot.png -pidgin/pixmaps/emblems/16/hungry.png -pidgin/pixmaps/emblems/16/in_love.png -pidgin/pixmaps/emblems/16/mean.png -pidgin/pixmaps/emblems/16/meeting.png -pidgin/pixmaps/emblems/16/mobile.png -pidgin/pixmaps/emblems/16/musical-note.png -pidgin/pixmaps/emblems/16/nervous.png -pidgin/pixmaps/emblems/16/neutral.png -pidgin/pixmaps/emblems/16/party.png -pidgin/pixmaps/emblems/16/phone.png -pidgin/pixmaps/emblems/16/plate.png -pidgin/pixmaps/emblems/16/question.png -pidgin/pixmaps/emblems/16/sad.png -pidgin/pixmaps/emblems/16/sarcastic.png -pidgin/pixmaps/emblems/16/search.png -pidgin/pixmaps/emblems/16/shocked.png -pidgin/pixmaps/emblems/16/sick.png -pidgin/pixmaps/emblems/16/sleeping.png -pidgin/pixmaps/emblems/16/sleepy.png -pidgin/pixmaps/emblems/16/thinking.png -pidgin/pixmaps/emblems/16/tv.png pidgin/pixmaps/emotes/default/24/theme pidgin/pixmaps/emotes/none/theme pidgin/pixmaps/emotes/small/16/theme diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index 3818249fef..8408d04e23 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -3519,7 +3519,8 @@ static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full) /* Offline? */ - /* FIXME: Why is this status special-cased by the core? -- rlaager */ + /* FIXME: Why is this status special-cased by the core? --rlaager + * FIXME: Alternatively, why not have the core do all of them? --rlaager */ if (!PURPLE_BUDDY_IS_ONLINE(b)) { purple_notify_user_info_add_pair(user_info, _("Status"), _("Offline")); } @@ -3614,6 +3615,24 @@ static GdkPixbuf * _pidgin_blist_get_cached_emblem(gchar *path) { return pb; } +static char *get_mood_icon_path(const char *mood) +{ + char *path; + + if (!strcmp(mood, "busy")) { + path = g_build_filename(DATADIR, "pixmaps", "pidgin", + "status", "16", "busy.png", NULL); + } else if (!strcmp(mood, "hiptop")) { + path = g_build_filename(DATADIR, "pixmaps", "pidgin", + "emblems", "16", "hiptop.png", NULL); + } else { + char *filename = g_strdup_printf("%s.png", mood); + path = g_build_filename(DATADIR, "pixmaps", "pidgin", + "emotes", "small", filename, NULL); + g_free(filename); + } + return path; +} GdkPixbuf * pidgin_blist_get_emblem(PurpleBlistNode *node) @@ -3637,8 +3656,10 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) gtkbuddynode = node->ui_data; presence = purple_buddy_get_presence(buddy); if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { - path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", - "16", "mobile.png", NULL); + /* This emblem comes from the small emoticon set now, + * to reduce duplication. */ + path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", + "small", "mobile.png", NULL); return _pidgin_blist_get_cached_emblem(path); } @@ -3664,12 +3685,14 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) presence = purple_buddy_get_presence(buddy); if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { - path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "mobile.png", NULL); + /* This emblem comes from the small emoticon set now, to reduce duplication. */ + path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "mobile.png", NULL); return _pidgin_blist_get_cached_emblem(path); } if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { - path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "music.png", NULL); + /* This emblem comes from the small emoticon set now, to reduce duplication. */ + path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "music.png", NULL); return _pidgin_blist_get_cached_emblem(path); } @@ -3692,12 +3715,13 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) if (!(name && *name)) return NULL; - } - - filename = g_strdup_printf("%s.png", name); - path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL); - g_free(filename); + path = get_mood_icon_path(name); + } else { + filename = g_strdup_printf("%s.png", name); + path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL); + g_free(filename); + } /* _pidgin_blist_get_cached_emblem() assumes ownership of path */ return _pidgin_blist_get_cached_emblem(path); @@ -7699,23 +7723,16 @@ set_mood_cb(GtkWidget *widget, PurpleAccount *account) /* TODO: rlaager wants this sorted. */ for (mood = prpl_info->get_moods(account); - mood->mood != NULL ; mood++) - { - char *icon_path; - char *filename; + mood->mood != NULL ; mood++) { + char *path; if (mood->mood == NULL || mood->description == NULL) continue; - icon_path = g_strdup_printf("%s.png", mood->mood); - filename = g_build_filename("pixmaps", "pidgin", - "emblems", "16", - icon_path, NULL); - g_free(icon_path); - + path = get_mood_icon_path(mood->mood); purple_request_field_list_add_icon(f, _(mood->description), - filename, mood->mood); - g_free(filename); + path, (gpointer)mood->mood); + g_free(path); if (current_mood && !strcmp(current_mood, mood->mood)) purple_request_field_list_add_selected(f, _(mood->description)); diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index 3e05eab739..8edaa00709 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -1050,15 +1050,10 @@ create_list_field(PurpleRequestField *field) if (icons) { const char *icon_path = (const char *)icons->data; - char* filename; GdkPixbuf* pixbuf = NULL; if (icon_path) - { - filename = g_build_filename(DATADIR, icon_path, NULL); - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - g_free(filename); - } + pixbuf = gdk_pixbuf_new_from_file(icon_path, NULL); gtk_list_store_set(store, &iter, 0, purple_request_field_list_get_data(field, text), diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index 1a85c70cd4..3b3acde7bf 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -97,8 +97,6 @@ EMBLEMS_16_SCALABLE = \ emblems/16/scalable/free-for-chat.svg \ emblems/16/scalable/game.svg \ emblems/16/scalable/male.svg \ - emblems/16/scalable/mobile.svg \ - emblems/16/scalable/music.svg \ emblems/16/scalable/not-authorized.svg \ emblems/16/scalable/qq-member.svg \ emblems/16/scalable/secure.svg \ @@ -106,58 +104,7 @@ EMBLEMS_16_SCALABLE = \ emblems/16/scalable/video.svg \ emblems/16/scalable/voice.svg - -# Magic to copy files from emotes/small/16 to emblems/16. -# This is necessary because UIs expect emblems in one place and -# smiley themes in another, but we don't want to duplicate these -# images in the source. -emblems/16/%.png: emotes/small/16/%.png - rm -f $@ - cp -f $< $@ - -emblems/16/busy.png: status/16/busy.png - rm -f $@ - cp -f $< $@ - -# The copied emblems. -# Ensure these are in .mtn-ignore. -EMBLEMS_16_COPIED = \ - emblems/16/amorous.png \ - emblems/16/angry.png \ - emblems/16/busy.png \ - emblems/16/beer.png \ - emblems/16/cigarette.png \ - emblems/16/coffee.png \ - emblems/16/confused.png \ - emblems/16/console.png \ - emblems/16/disappointed.png \ - emblems/16/embarrassed.png \ - emblems/16/excited.png \ - emblems/16/in_love.png \ - emblems/16/mean.png \ - emblems/16/meeting.png \ - emblems/16/mobile.png \ - emblems/16/musical-note.png \ - emblems/16/neutral.png \ - emblems/16/party.png \ - emblems/16/phone.png \ - emblems/16/plate.png \ - emblems/16/question.png \ - emblems/16/sad.png \ - emblems/16/sarcastic.png \ - emblems/16/search.png \ - emblems/16/sick.png \ - emblems/16/sleeping.png \ - emblems/16/sleepy.png \ - emblems/16/thinking.png \ - emblems/16/tv.png - - -# Non-copied emblems. -# Ensure these filenames don't clash with files in emotes/small/16 or -# bad things will happen! EMBLEMS_16 = \ - $(EMBLEMS_16_COPIED) \ emblems/16/aol-client.png \ emblems/16/birthday.png \ emblems/16/blocked.png \ @@ -170,27 +117,13 @@ EMBLEMS_16 = \ emblems/16/half-operator.png \ emblems/16/hiptop.png \ emblems/16/male.png \ - emblems/16/mobile.png \ - emblems/16/music.png \ emblems/16/not-authorized.png \ emblems/16/operator.png \ emblems/16/qq-member.png \ emblems/16/secure.png \ emblems/16/unavailable.png \ emblems/16/video.png \ - emblems/16/voice.png \ - emblems/16/bathing.png \ - emblems/16/cinema.png \ - emblems/16/internet.png \ - emblems/16/restroom.png \ - emblems/16/shopping.png \ - emblems/16/studying.png \ - emblems/16/suit.png \ - emblems/16/surfing.png \ - emblems/16/typing.png \ - emblems/16/working.png \ - emblems/16/writing.png - + emblems/16/voice.png EMOTES_DEFAULT_24_SCALABLE = \ emotes/default/24/scalable/airplane.svg \ @@ -270,6 +203,7 @@ EMOTES_DEFAULT_24_SCALABLE = \ emotes/default/24/scalable/yin-yang.svg EMOTES_SMALL_16_SCALABLE = \ + emotes/small/16/scalable/mobile.svg emotes/small/16/scalable/pidgin-emotes.svg PROTOCOLS_16_SCALABLE = \ diff --git a/pidgin/pixmaps/emblems/16/bathing.png b/pidgin/pixmaps/emblems/16/bathing.png deleted file mode 100644 index 662eb2ac97..0000000000 Binary files a/pidgin/pixmaps/emblems/16/bathing.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/cinema.png b/pidgin/pixmaps/emblems/16/cinema.png deleted file mode 100644 index e561cb0791..0000000000 Binary files a/pidgin/pixmaps/emblems/16/cinema.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/internet.png b/pidgin/pixmaps/emblems/16/internet.png deleted file mode 100644 index 9281221f98..0000000000 Binary files a/pidgin/pixmaps/emblems/16/internet.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/music.png b/pidgin/pixmaps/emblems/16/music.png deleted file mode 100644 index 4b40b6eedf..0000000000 Binary files a/pidgin/pixmaps/emblems/16/music.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/restroom.png b/pidgin/pixmaps/emblems/16/restroom.png deleted file mode 100644 index a642e7d53c..0000000000 Binary files a/pidgin/pixmaps/emblems/16/restroom.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/scalable/mobile.svg b/pidgin/pixmaps/emblems/16/scalable/mobile.svg deleted file mode 100644 index 239d2c38f5..0000000000 --- a/pidgin/pixmaps/emblems/16/scalable/mobile.svg +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pidgin/pixmaps/emblems/16/scalable/music.svg b/pidgin/pixmaps/emblems/16/scalable/music.svg deleted file mode 100644 index 29f0acfda6..0000000000 --- a/pidgin/pixmaps/emblems/16/scalable/music.svg +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/pidgin/pixmaps/emblems/16/shopping.png b/pidgin/pixmaps/emblems/16/shopping.png deleted file mode 100644 index 291107ae64..0000000000 Binary files a/pidgin/pixmaps/emblems/16/shopping.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/studying.png b/pidgin/pixmaps/emblems/16/studying.png deleted file mode 100644 index 0a6053f86c..0000000000 Binary files a/pidgin/pixmaps/emblems/16/studying.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/suit.png b/pidgin/pixmaps/emblems/16/suit.png deleted file mode 100644 index 3c0080f0dd..0000000000 Binary files a/pidgin/pixmaps/emblems/16/suit.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/surfing.png b/pidgin/pixmaps/emblems/16/surfing.png deleted file mode 100644 index 727b352f72..0000000000 Binary files a/pidgin/pixmaps/emblems/16/surfing.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/typing.png b/pidgin/pixmaps/emblems/16/typing.png deleted file mode 100644 index 7f60b0a25e..0000000000 Binary files a/pidgin/pixmaps/emblems/16/typing.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/working.png b/pidgin/pixmaps/emblems/16/working.png deleted file mode 100644 index cc90d637df..0000000000 Binary files a/pidgin/pixmaps/emblems/16/working.png and /dev/null differ diff --git a/pidgin/pixmaps/emblems/16/writing.png b/pidgin/pixmaps/emblems/16/writing.png deleted file mode 100644 index e8b5d0d53e..0000000000 Binary files a/pidgin/pixmaps/emblems/16/writing.png and /dev/null differ diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index 713d6aad58..ef9d6254e9 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -1,3 +1,19 @@ +# These are mood images that are NOT also used in the smiley theme. +MOODS = \ + bathing.png \ + cinema.png \ + internet.png \ + music.png \ + restroom.png \ + search.png \ + shopping.png \ + studying.png \ + suit.png \ + surfing.png \ + typing.png \ + working.png \ + writing.png + SMILEYS = \ amorous.png \ angel.png \ @@ -48,6 +64,7 @@ pidginsmileypix_in_files = small.theme.in if INSTALL_PIXMAPS pidginsmileypixdir = $(datadir)/pixmaps/pidgin/emotes/small pidginsmileypix_DATA = \ + $(MOODS) \ $(SMILEYS) \ theme @@ -58,4 +75,4 @@ theme: small.theme.in $< > $@ endif -EXTRA_DIST = $(SMILEYS) $(pidginsmileypix_in_files) theme +EXTRA_DIST = $(MOODS) $(SMILEYS) $(pidginsmileypix_in_files) theme diff --git a/pidgin/pixmaps/emotes/small/16/bathing.png b/pidgin/pixmaps/emotes/small/16/bathing.png new file mode 100644 index 0000000000..662eb2ac97 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/bathing.png differ diff --git a/pidgin/pixmaps/emotes/small/16/cinema.png b/pidgin/pixmaps/emotes/small/16/cinema.png new file mode 100644 index 0000000000..e561cb0791 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/cinema.png differ diff --git a/pidgin/pixmaps/emotes/small/16/internet.png b/pidgin/pixmaps/emotes/small/16/internet.png new file mode 100644 index 0000000000..9281221f98 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/internet.png differ diff --git a/pidgin/pixmaps/emotes/small/16/music.png b/pidgin/pixmaps/emotes/small/16/music.png new file mode 100644 index 0000000000..4b40b6eedf Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/music.png differ diff --git a/pidgin/pixmaps/emotes/small/16/restroom.png b/pidgin/pixmaps/emotes/small/16/restroom.png new file mode 100644 index 0000000000..a642e7d53c Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/restroom.png differ diff --git a/pidgin/pixmaps/emotes/small/16/scalable/mobile.svg b/pidgin/pixmaps/emotes/small/16/scalable/mobile.svg new file mode 100644 index 0000000000..239d2c38f5 --- /dev/null +++ b/pidgin/pixmaps/emotes/small/16/scalable/mobile.svg @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pidgin/pixmaps/emotes/small/16/scalable/music.svg b/pidgin/pixmaps/emotes/small/16/scalable/music.svg new file mode 100644 index 0000000000..29f0acfda6 --- /dev/null +++ b/pidgin/pixmaps/emotes/small/16/scalable/music.svg @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/pidgin/pixmaps/emotes/small/16/shopping.png b/pidgin/pixmaps/emotes/small/16/shopping.png new file mode 100644 index 0000000000..291107ae64 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/shopping.png differ diff --git a/pidgin/pixmaps/emotes/small/16/studying.png b/pidgin/pixmaps/emotes/small/16/studying.png new file mode 100644 index 0000000000..0a6053f86c Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/studying.png differ diff --git a/pidgin/pixmaps/emotes/small/16/suit.png b/pidgin/pixmaps/emotes/small/16/suit.png new file mode 100644 index 0000000000..3c0080f0dd Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/suit.png differ diff --git a/pidgin/pixmaps/emotes/small/16/surfing.png b/pidgin/pixmaps/emotes/small/16/surfing.png new file mode 100644 index 0000000000..727b352f72 Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/surfing.png differ diff --git a/pidgin/pixmaps/emotes/small/16/typing.png b/pidgin/pixmaps/emotes/small/16/typing.png new file mode 100644 index 0000000000..7f60b0a25e Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/typing.png differ diff --git a/pidgin/pixmaps/emotes/small/16/working.png b/pidgin/pixmaps/emotes/small/16/working.png new file mode 100644 index 0000000000..cc90d637df Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/working.png differ diff --git a/pidgin/pixmaps/emotes/small/16/writing.png b/pidgin/pixmaps/emotes/small/16/writing.png new file mode 100644 index 0000000000..e8b5d0d53e Binary files /dev/null and b/pidgin/pixmaps/emotes/small/16/writing.png differ -- cgit v1.2.1 From fdc74c938f9c1c2ff472aecaeb04bb2fa784d8da Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Sun, 7 Feb 2010 21:11:56 +0000 Subject: Made it compile again. Changed aim_info.flag to guint64, to avoid loss of precition, I hope this won't break it... Re-introduced a couple of UI callbacks lost in earlier merges --- libpurple/protocols/gg/gg.c | 3 +- libpurple/protocols/jabber/libxmpp.c | 1 + libpurple/protocols/oscar/family_buddy.c | 4 +- libpurple/protocols/oscar/family_icbm.c | 4 +- libpurple/protocols/oscar/family_locate.c | 14 ++--- libpurple/protocols/oscar/libicq.c | 2 +- libpurple/protocols/oscar/oscar.c | 32 +++++++--- libpurple/protocols/oscar/oscar.h | 7 +-- libpurple/request.h | 2 - pidgin/gtkblist.c | 100 +++++++++++++++++++++++++++--- 10 files changed, 132 insertions(+), 37 deletions(-) diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c index 67ee8a4863..21f2a136d3 100644 --- a/libpurple/protocols/gg/gg.c +++ b/libpurple/protocols/gg/gg.c @@ -2465,7 +2465,8 @@ static PurplePluginProtocolInfo prpl_info = sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* can_do_media */ + NULL /* get_moods */ }; static PurplePluginInfo info = { diff --git a/libpurple/protocols/jabber/libxmpp.c b/libpurple/protocols/jabber/libxmpp.c index f589da9dcd..0607b2f06e 100644 --- a/libpurple/protocols/jabber/libxmpp.c +++ b/libpurple/protocols/jabber/libxmpp.c @@ -126,6 +126,7 @@ static PurplePluginProtocolInfo prpl_info = NULL, /* get_account_text_table */ jabber_initiate_media, /* initiate_media */ jabber_get_media_caps, /* get_media_caps */ + NULL /* get_moods */ }; static gboolean load_plugin(PurplePlugin *plugin) diff --git a/libpurple/protocols/oscar/family_buddy.c b/libpurple/protocols/oscar/family_buddy.c index 1b03aeed16..7efd60e520 100644 --- a/libpurple/protocols/oscar/family_buddy.c +++ b/libpurple/protocols/oscar/family_buddy.c @@ -224,13 +224,13 @@ buddychange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *f if (snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING && userinfo.capabilities & OSCAR_CAPABILITY_XTRAZ) { PurpleAccount *account = purple_connection_get_account(od->gc); - PurpleBuddy *buddy = purple_find_buddy(account, userinfo.sn); + PurpleBuddy *buddy = purple_find_buddy(account, userinfo.bn); if (buddy) { PurplePresence *presence = purple_buddy_get_presence(buddy); if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) - icq_im_xstatus_request(od, userinfo.sn); + icq_im_xstatus_request(od, userinfo.bn); } } aim_info_free(&userinfo); diff --git a/libpurple/protocols/oscar/family_icbm.c b/libpurple/protocols/oscar/family_icbm.c index de74b895e4..a01a6e56f1 100644 --- a/libpurple/protocols/oscar/family_icbm.c +++ b/libpurple/protocols/oscar/family_icbm.c @@ -2675,10 +2675,10 @@ static int clientautoresp(OscarData *od, FlapConnection *conn, aim_module_t *mod } purple_debug_misc("oscar", "X-Status reply: %s\n", (const char*)xml); account = purple_connection_get_account(od->gc); - buddy = purple_find_buddy(account, sn); + buddy = purple_find_buddy(account, bn); presence = purple_buddy_get_presence(buddy); status = purple_presence_get_active_status(presence); - purple_prpl_got_user_status(account, sn, + purple_prpl_got_user_status(account, bn, purple_status_get_id(status), "message", xml, NULL); } else { purple_debug_misc("oscar", "X-Status: Can't get XML reply string\n"); diff --git a/libpurple/protocols/oscar/family_locate.c b/libpurple/protocols/oscar/family_locate.c index 8d905157b3..b3625d7a9e 100644 --- a/libpurple/protocols/oscar/family_locate.c +++ b/libpurple/protocols/oscar/family_locate.c @@ -45,7 +45,7 @@ * But, eh. */ static const struct { - guint32 flag; + guint64 flag; guint8 data[16]; } aim_caps[] = { @@ -928,11 +928,11 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) mood = aim_receive_custom_icon(od, bs, length); if (mood) - purple_prpl_got_user_status(account, outinfo->sn, "mood", + purple_prpl_got_user_status(account, outinfo->bn, "mood", PURPLE_MOOD_NAME, mood, NULL); else - purple_prpl_got_user_status_deactive(account, outinfo->sn, "mood"); + purple_prpl_got_user_status_deactive(account, outinfo->bn, "mood"); } else if (type == 0x000e) { /* @@ -1093,11 +1093,11 @@ aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo) g_free(icqmood); if (mood) - purple_prpl_got_user_status(account, outinfo->sn, "mood", + purple_prpl_got_user_status(account, outinfo->bn, "mood", PURPLE_MOOD_NAME, mood, NULL); else - purple_prpl_got_user_status_deactive(account, outinfo->sn, "mood"); + purple_prpl_got_user_status_deactive(account, outinfo->bn, "mood"); } break; } @@ -1507,11 +1507,11 @@ userinfo(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *fram mood = aim_receive_custom_icon(od, &cbs, tlv->length); if (mood) - purple_prpl_got_user_status(account, userinfo->sn, "mood", + purple_prpl_got_user_status(account, userinfo->bn, "mood", PURPLE_MOOD_NAME, mood, NULL); else - purple_prpl_got_user_status_deactive(account, userinfo->sn, "mood"); + purple_prpl_got_user_status_deactive(account, userinfo->bn, "mood"); } aim_tlvlist_free(tlvlist); diff --git a/libpurple/protocols/oscar/libicq.c b/libpurple/protocols/oscar/libicq.c index 6ccd43be07..def3c761e7 100644 --- a/libpurple/protocols/oscar/libicq.c +++ b/libpurple/protocols/oscar/libicq.c @@ -108,7 +108,7 @@ static PurplePluginProtocolInfo prpl_info = sizeof(PurplePluginProtocolInfo), /* struct_size */ icq_get_account_text_table, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* can_do_media */ oscar_get_purple_moods, /* get_moods */ }; diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index c0a2d7088d..98a1a3bda0 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -232,7 +232,6 @@ static void purple_icons_fetch(PurpleConnection *gc); void oscar_set_info(PurpleConnection *gc, const char *info); static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status); static void oscar_set_extendedstatus(PurpleConnection *gc); -static void oscar_format_username(PurpleConnection *gc, const char *nick); static gboolean purple_ssi_rerequestdata(gpointer data); static void oscar_free_name_data(struct name_data *data) { @@ -680,7 +679,7 @@ static gchar *oscar_caps_to_string(OscarCapability caps) { GString *str; const gchar *tmp; - guint bit = 1; + guint64 bit = 1; str = g_string_new(""); @@ -801,7 +800,7 @@ static char *oscar_icqstatus(int state) { else if (state & AIM_ICQ_STATE_DEPRESSION) return g_strdup(_("Depression")); else if (state & AIM_ICQ_STATE_ATHOME) - return g_strdup_(_("At home")); + return g_strdup(_("At home")); else if (state & AIM_ICQ_STATE_ATWORK) return g_strdup(_("At work")); else if (state & AIM_ICQ_STATE_LUNCH) @@ -2730,18 +2729,18 @@ incomingim_chan2(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, purple_debug_info("oscar", "Sending X-Status Reply\n"); if(args->info.rtfmsg.msgtype == 26) - icq_relay_xstatus(od, userinfo->sn, args->cookie); + icq_relay_xstatus(od, userinfo->bn, args->cookie); if(args->info.rtfmsg.msgtype == 1) { if(rtfmsg) { - serv_got_im(gc, userinfo->sn, rtfmsg, flags, + serv_got_im(gc, userinfo->bn, rtfmsg, flags, time(NULL)); } else { - serv_got_im(gc, userinfo->sn, + serv_got_im(gc, userinfo->bn, args->info.rtfmsg.rtfmsg, flags, time(NULL)); } @@ -5164,10 +5163,12 @@ oscar_set_status(PurpleAccount *account, PurpleStatus *status) if (!purple_account_is_connected(account)) return; + pc = purple_account_get_connection(account); + od = purple_connection_get_protocol_data(pc); + /* There's no need to do the stuff below for mood updates. */ if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) { - PurpleConnection *gc = purple_account_get_connection(account); - aim_locate_setcaps((OscarData *)gc->proto_data, purple_caps); + aim_locate_setcaps(od, purple_caps); return; } @@ -6723,6 +6724,21 @@ static void oscar_get_icqxstatusmsg (PurpleBlistNode *node, gpointer ignore) icq_im_xstatus_request(gc->proto_data, purple_buddy_get_name(buddy)); } +static void +oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore) +{ + PurpleBuddy *buddy; + PurpleConnection *gc; + + g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); + + buddy = (PurpleBuddy *)node; + gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + + aim_locate_getinfoshort(purple_connection_get_protocol_data(gc), + purple_buddy_get_name(buddy), 0x00000003); +} + static GList * oscar_buddy_menu(PurpleBuddy *buddy) { diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h index 02037da126..561b98c0bc 100644 --- a/libpurple/protocols/oscar/oscar.h +++ b/libpurple/protocols/oscar/oscar.h @@ -379,10 +379,8 @@ typedef enum OSCAR_CAPABILITY_XTRAZ = 0x40000000, OSCAR_CAPABILITY_GENERICUNKNOWN = 0x80000000, #warning Fix OSCAR_CAPABILITY_LAST situation -#if 0 // TODO: We're out of bits. Rework things that depend on this or remove some capability. (Or, ensure this is a 64-bit type.) - OSCAR_CAPABILITY_LAST = 0x100000000 -#endif + OSCAR_CAPABILITY_LAST = 0x100000000 } OscarCapability; /* @@ -1158,7 +1156,6 @@ guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len); void aim_info_free(aim_userinfo_t *); int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *); int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info); -#endif PurpleMood* icq_get_purple_moods(PurpleAccount *account); const char* icq_get_custom_icon_description(const char *mood); guint8* icq_get_custom_icon_data(const char *mood); @@ -1491,7 +1488,7 @@ int aim_tlvlist_add_8(GSList **list, const guint16 type, const guint8 value); int aim_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value); int aim_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value); int aim_tlvlist_add_str(GSList **list, const guint16 type, const char *value); -int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps); +int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, const char *mood); int aim_tlvlist_add_userinfo(GSList **list, guint16 type, aim_userinfo_t *userinfo); int aim_tlvlist_add_chatroom(GSList **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance); int aim_tlvlist_add_frozentlvlist(GSList **list, guint16 type, GSList **tl); diff --git a/libpurple/request.h b/libpurple/request.h index 5c23196234..049b043b93 100644 --- a/libpurple/request.h +++ b/libpurple/request.h @@ -948,7 +948,6 @@ gboolean purple_request_field_list_get_multi_select( void *purple_request_field_list_get_data(const PurpleRequestField *field, const char *text); -#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_) /** * Adds an item to a list field. * @@ -960,7 +959,6 @@ void *purple_request_field_list_get_data(const PurpleRequestField *field, */ void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data); -#endif /** * Adds an item to a list field. diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index b1b3da3834..b4b0599573 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -3830,7 +3830,7 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) PurplePluginProtocolInfo *prpl_info; const char *name = NULL; char *filename, *path; - PurplePresence *presence = NULL; + PurplePresence *p = NULL; PurpleStatus *tune; if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { @@ -3841,8 +3841,8 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { buddy = (PurpleBuddy*)node; gtkbuddynode = node->ui_data; - presence = purple_buddy_get_presence(buddy); - if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { + p = purple_buddy_get_presence(buddy); + if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { /* This emblem comes from the small emoticon set now, * to reduce duplication. */ path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", @@ -3868,10 +3868,10 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) /* If we came through the contact code flow above, we didn't need * to get the presence until now. */ - if (presence == NULL) - presence = purple_buddy_get_presence(buddy); + if (p == NULL) + p = purple_buddy_get_presence(buddy); - if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { + if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { /* This emblem comes from the small emoticon set now, to reduce duplication. */ path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "mobile.png", NULL); return _pidgin_blist_get_cached_emblem(path); @@ -3908,10 +3908,10 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) if (name == NULL) { PurpleStatus *status; - if (!purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) + if (!purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOOD)) return NULL; - status = purple_presence_get_status(presence, "mood"); + status = purple_presence_get_status(p, "mood"); name = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); if (!(name && *name)) @@ -7949,6 +7949,88 @@ disable_account_cb(GtkCheckMenuItem *widget, gpointer data) purple_account_set_enabled(account, PIDGIN_UI, FALSE); } +static void +edit_mood_cb(PurpleConnection *gc, PurpleRequestFields *fields) +{ + PurpleRequestField *f; + GList *l; + + f = purple_request_fields_get_field(fields, "mood"); + l = purple_request_field_list_get_selected(f); + + if (l) { + const char *mood = purple_request_field_list_get_data(f, l->data); + PurpleAccount *account = purple_connection_get_account(gc); + + if (mood != NULL) { + purple_account_set_status(account, "mood", TRUE, + PURPLE_MOOD_NAME, mood, + NULL); + } else { + purple_account_set_status(account, "mood", FALSE, NULL); + } + } +} + +static void +set_mood_cb(GtkWidget *widget, PurpleAccount *account) +{ + PurplePresence *presence = purple_account_get_presence(account); + PurpleStatus *status = purple_presence_get_status(presence, "mood"); + const char *current_mood; + PurpleRequestFields *fields; + PurpleRequestFieldGroup *g; + PurpleRequestField *f; + char* na_fn; + PurpleConnection *gc = purple_account_get_connection(account); + PurplePluginProtocolInfo *prpl_info; + PurpleMood *mood; + + g_return_if_fail(gc->prpl != NULL); + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); + + current_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); + + fields = purple_request_fields_new(); + g = purple_request_field_group_new(NULL); + f = purple_request_field_list_new("mood", _("Please select your mood from the list")); + + na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); + + purple_request_field_list_add_icon(f, _("None"), na_fn, NULL); + if (current_mood == NULL) + purple_request_field_list_add_selected(f, _("None")); + + g_free(na_fn); + + /* TODO: rlaager wants this sorted. */ + for (mood = prpl_info->get_moods(account); + mood->mood != NULL ; mood++) { + char *path; + + if (mood->mood == NULL || mood->description == NULL) + continue; + + path = get_mood_icon_path(mood->mood); + purple_request_field_list_add_icon(f, _(mood->description), + path, (gpointer)mood->mood); + g_free(path); + + if (current_mood && !strcmp(current_mood, mood->mood)) + purple_request_field_list_add_selected(f, _(mood->description)); + } + purple_request_field_group_add_field(g, f); + + purple_request_fields_add_group(fields, g); + + purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), + NULL, fields, + _("OK"), G_CALLBACK(edit_mood_cb), + _("Cancel"), NULL, + purple_connection_get_account(gc), + NULL, NULL, gc); +} + void pidgin_blist_update_accounts_menu(void) { @@ -8028,7 +8110,7 @@ pidgin_blist_update_accounts_menu(void) PurpleAccount *account = NULL; GdkPixbuf *pixbuf = NULL; PurplePlugin *plugin = NULL; - PurplePluginProtocolInfo *prpl_info + PurplePluginProtocolInfo *prpl_info; account = accounts->data; -- cgit v1.2.1 From 3c1a9d29d5b2a5769d99d9def0e064a33c92ccfe Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Sun, 7 Feb 2010 21:51:17 +0000 Subject: Remove the #warning about not enought bits now that OscarCapability is matched with a guint64 in aim_caps in family_locate.c --- libpurple/protocols/oscar/oscar.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h index 561b98c0bc..461feb6ffd 100644 --- a/libpurple/protocols/oscar/oscar.h +++ b/libpurple/protocols/oscar/oscar.h @@ -378,8 +378,6 @@ typedef enum OSCAR_CAPABILITY_NEWCAPS = 0x20000000, OSCAR_CAPABILITY_XTRAZ = 0x40000000, OSCAR_CAPABILITY_GENERICUNKNOWN = 0x80000000, -#warning Fix OSCAR_CAPABILITY_LAST situation - // TODO: We're out of bits. Rework things that depend on this or remove some capability. (Or, ensure this is a 64-bit type.) OSCAR_CAPABILITY_LAST = 0x100000000 } OscarCapability; -- cgit v1.2.1 From 9a8e4b189b995eea7258a76f340c0a2a0d72bb0c Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Sun, 7 Feb 2010 22:53:36 +0000 Subject: These icons moved from emblems to emotes --- pidgin/pixmaps/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index 4b8f6e50e3..74c8c7595d 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -118,8 +118,6 @@ EMBLEMS_SCALABLE = \ emblems/scalable/free-for-chat.svg \ emblems/scalable/game.svg \ emblems/scalable/male.svg \ - emblems/scalable/mobile.svg \ - emblems/scalable/music.svg \ emblems/scalable/not-authorized.svg \ emblems/scalable/qq-member.svg \ emblems/scalable/secure.svg \ -- cgit v1.2.1 From 0047e81db2af94cf986a7a3c073b1fb07c70ff61 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Mon, 8 Feb 2010 21:38:26 +0000 Subject: Implemented the get_moods prpl function for XMPP. Enables the generic mood chooser. Doesn't actually work yet... --- libpurple/protocols/jabber/jabber.c | 8 ++++++++ libpurple/protocols/jabber/libxmpp.c | 3 ++- libpurple/protocols/jabber/usermood.c | 18 ++++++++++++++++++ libpurple/protocols/jabber/usermood.h | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index d18b6e7352..d820b8b4d5 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -2132,6 +2132,14 @@ GList *jabber_status_types(PurpleAccount *account) NULL); types = g_list_prepend(types, type); + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD, + "mood", NULL, TRUE, TRUE, TRUE, + PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(PURPLE_TYPE_STRING), + PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(PURPLE_TYPE_STRING), + NULL); + types = g_list_prepend(types, type); + priority_value = purple_value_new(PURPLE_TYPE_INT); purple_value_set_int(priority_value, 1); buzz_enabled = purple_value_new(PURPLE_TYPE_BOOLEAN); diff --git a/libpurple/protocols/jabber/libxmpp.c b/libpurple/protocols/jabber/libxmpp.c index 0607b2f06e..2f2fcefa03 100644 --- a/libpurple/protocols/jabber/libxmpp.c +++ b/libpurple/protocols/jabber/libxmpp.c @@ -43,6 +43,7 @@ #include "presence.h" #include "google.h" #include "pep.h" +#include "usermood.h" #include "usertune.h" #include "caps.h" #include "data.h" @@ -126,7 +127,7 @@ static PurplePluginProtocolInfo prpl_info = NULL, /* get_account_text_table */ jabber_initiate_media, /* initiate_media */ jabber_get_media_caps, /* get_media_caps */ - NULL /* get_moods */ + jabber_get_moods /* get_moods */ }; static gboolean load_plugin(PurplePlugin *plugin) diff --git a/libpurple/protocols/jabber/usermood.c b/libpurple/protocols/jabber/usermood.c index b1b08a2970..e3623f2641 100644 --- a/libpurple/protocols/jabber/usermood.c +++ b/libpurple/protocols/jabber/usermood.c @@ -119,6 +119,10 @@ static PurpleMood moods[] = { {NULL, NULL, NULL} }; +static PurpleMood empty_moods[] = { + {NULL, NULL, NULL} +}; + static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { /* it doesn't make sense to have more than one item here, so let's just pick the first one */ xmlnode *item = xmlnode_get_child(items, "item"); @@ -252,3 +256,17 @@ void jabber_mood_set(JabberStream *js, const char *mood, const char *text) { /* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free (yay for well-defined memory management rules) */ } + +PurpleMood *jabber_get_moods(PurpleAccount *account) +{ + PurpleConnection *gc = purple_account_get_connection(account); + JabberStream *js = (JabberStream *) gc->proto_data; + + if (js->pep) { + purple_debug_info("jabber", "get_moods: account supports PEP\n"); + return moods; + } else { + purple_debug_info("jabber", "get_moods: account doesn't support PEP\n"); + return empty_moods; + } +} \ No newline at end of file diff --git a/libpurple/protocols/jabber/usermood.h b/libpurple/protocols/jabber/usermood.h index 4e27b2bb39..922da1667e 100644 --- a/libpurple/protocols/jabber/usermood.h +++ b/libpurple/protocols/jabber/usermood.h @@ -36,4 +36,6 @@ void jabber_mood_set(JabberStream *js, const char *mood, /* must be one of the valid strings defined in the XEP */ const char *text /* might be NULL */); +PurpleMood *jabber_get_moods(PurpleAccount *account); + #endif /* PURPLE_JABBER_USERMOOD_H_ */ -- cgit v1.2.1 From ec1dd9beb25dc7fe159262b3b73b2ee212fb960f Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Mon, 8 Feb 2010 21:50:15 +0000 Subject: Resurrect the PRPL actions to show up in the account submenu --- pidgin/gtkblist.c | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index b4b0599573..a9d887472d 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -8150,38 +8150,36 @@ pidgin_blist_update_accounts_menu(void) gc = purple_account_get_connection(account); plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; + prpl_info = plugin ? PURPLE_PLUGIN_PROTOCOL_INFO(plugin) : NULL; + + if (prpl_info && + (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) || + PURPLE_PLUGIN_HAS_ACTIONS(plugin))) { + if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) { + GList *types; + for (types = purple_account_get_status_types(account); + types != NULL ; types = types->next) { + PurpleStatusType *type = types->data; + + if (strcmp(purple_status_type_get_id(type), "mood") != 0) + continue; - if (plugin && - (prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) && - PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) - { - GList *types; - for (types = purple_account_get_status_types(account); - types != NULL ; types = types->next) - { - PurpleStatusType *type = types->data; - - if (strcmp(purple_status_type_get_id(type), "mood") != 0) - continue; - - menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood...")); - g_signal_connect(G_OBJECT(menuitem), "activate", - G_CALLBACK(set_mood_cb), account); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood...")); + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(set_mood_cb), account); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); - /* Be safe. It shouldn't match more than once anyway */ - break; + /* Be safe. It shouldn't match more than once anyway */ + break; + } } - } - else - { - if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { + if (PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { build_plugin_actions(submenu, plugin, gc); - } else { - menuitem = gtk_menu_item_new_with_label(_("No actions available")); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); - gtk_widget_set_sensitive(menuitem, FALSE); } + } else { + menuitem = gtk_menu_item_new_with_label(_("No actions available")); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + gtk_widget_set_sensitive(menuitem, FALSE); } pidgin_separator(submenu); -- cgit v1.2.1 From 74cb027789b1d338e493fb8634b82459eb3c1da7 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Mon, 8 Feb 2010 22:10:41 +0000 Subject: Add some missing icons to Makefile.am --- pidgin/pixmaps/emotes/small/16/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index ef9d6254e9..96595a3c7d 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -1,7 +1,12 @@ # These are mood images that are NOT also used in the smiley theme. MOODS = \ + afraid.png \ + amazed.png \ + annoyed.png \ bathing.png \ cinema.png \ + dissapointed.png \ + embarressed.png \ internet.png \ music.png \ restroom.png \ -- cgit v1.2.1 From bf1cfe6fa1649762312e9062a1530e123ee76a86 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Tue, 9 Feb 2010 20:14:10 +0000 Subject: Some code got duplicated during merge... --- libpurple/protocols/oscar/oscar.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 98a1a3bda0..9eb30bd942 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -6199,8 +6199,6 @@ const char *oscar_list_emblem(PurpleBuddy *b) return "admin"; if (userinfo->flags & AIM_FLAG_ACTIVEBUDDY) return "bot"; - if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) - return "hiptop"; if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) return "secure"; if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) -- cgit v1.2.1 From 3d8d5119a9e7cf26200d9ad42a837856a5578424 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Tue, 9 Feb 2010 21:34:38 +0000 Subject: Actually set the mood when creating a presence update when receiving mood PEP. Fixed some erronious pixmap references --- libpurple/protocols/jabber/usermood.c | 2 +- pidgin/pixmaps/emotes/small/16/Makefile.am | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libpurple/protocols/jabber/usermood.c b/libpurple/protocols/jabber/usermood.c index e3623f2641..da5c1a0ccc 100644 --- a/libpurple/protocols/jabber/usermood.c +++ b/libpurple/protocols/jabber/usermood.c @@ -160,7 +160,7 @@ static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { } if (newmood != NULL) { purple_prpl_got_user_status(js->gc->account, from, "mood", - PURPLE_MOOD_NAME, mood, + PURPLE_MOOD_NAME, newmood, PURPLE_MOOD_COMMENT, moodtext, NULL); } else { diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index 96595a3c7d..64ce3768db 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -1,12 +1,10 @@ # These are mood images that are NOT also used in the smiley theme. MOODS = \ afraid.png \ - amazed.png \ - annoyed.png \ bathing.png \ cinema.png \ - dissapointed.png \ - embarressed.png \ + disappointed.png \ + embarrassed.png \ internet.png \ music.png \ restroom.png \ -- cgit v1.2.1 From e8073fab01e6d67417f1097539c4615e61e0d297 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Tue, 9 Feb 2010 22:07:48 +0000 Subject: Show the translated mood message (again), if it matches one of the moods we know about. --- libpurple/protocols/jabber/jabber.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index d820b8b4d5..d714c2c277 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -62,6 +62,7 @@ #include "roster.h" #include "ping.h" #include "si.h" +#include "usermood.h" #include "xdata.h" #include "pep.h" #include "adhoccommands.h" @@ -2062,14 +2063,27 @@ void jabber_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboole mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); if(mood && *mood) { const char *moodtext; + /* find the mood */ + PurpleMood *moods = jabber_get_moods(account); + const char *description = NULL; + + for (; moods->mood ; moods++) { + if (purple_strequal(moods->mood, mood)) { + description = moods->description; + break; + } + } + moodtext = purple_status_get_attr_string(status, PURPLE_MOOD_COMMENT); if(moodtext && *moodtext) { - char *moodplustext = g_strdup_printf("%s (%s)", mood, moodtext); + char *moodplustext = + g_strdup_printf("%s (%s)", description ? _(description) : mood, moodtext); purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext); g_free(moodplustext); } else - purple_notify_user_info_add_pair(user_info, _("Mood"), mood); + purple_notify_user_info_add_pair(user_info, _("Mood"), + description ? _(description) : mood); } if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { PurpleStatus *tune = purple_presence_get_status(presence, "tune"); -- cgit v1.2.1 From a96437a7f15e6ec27e83f124292e0bbb89c414a4 Mon Sep 17 00:00:00 2001 From: Paul Aurich Date: Tue, 9 Feb 2010 22:38:47 +0000 Subject: disapproval of revision 'db14b022a34677416c5fd208a092d1c99f971e1d' Per conversation in devel@cpi, this still needs to be fixed (it sounds like either a bit-packed structure or a bunch of #defines are the leading "solutions") --- libpurple/protocols/oscar/oscar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h index 461feb6ffd..561b98c0bc 100644 --- a/libpurple/protocols/oscar/oscar.h +++ b/libpurple/protocols/oscar/oscar.h @@ -378,6 +378,8 @@ typedef enum OSCAR_CAPABILITY_NEWCAPS = 0x20000000, OSCAR_CAPABILITY_XTRAZ = 0x40000000, OSCAR_CAPABILITY_GENERICUNKNOWN = 0x80000000, +#warning Fix OSCAR_CAPABILITY_LAST situation + // TODO: We're out of bits. Rework things that depend on this or remove some capability. (Or, ensure this is a 64-bit type.) OSCAR_CAPABILITY_LAST = 0x100000000 } OscarCapability; -- cgit v1.2.1 From 8feced71e145be338902cd4ee12b4ce194d73d34 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Wed, 10 Feb 2010 20:53:18 +0000 Subject: jabber: Actually send a mood update when setting a mood status (using the generic mood selector). --- libpurple/protocols/jabber/presence.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c index d2d80af8f6..9e7de9aead 100644 --- a/libpurple/protocols/jabber/presence.c +++ b/libpurple/protocols/jabber/presence.c @@ -40,6 +40,7 @@ #include "jutil.h" #include "adhoccommands.h" +#include "usermood.h" #include "usertune.h" @@ -128,6 +129,15 @@ void jabber_set_status(PurpleAccount *account, PurpleStatus *status) gc = purple_account_get_connection(account); js = purple_connection_get_protocol_data(gc); + + /* it's a mood update */ + if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) { + const char *mood = + purple_status_get_attr_string(status, PURPLE_MOOD_NAME); + jabber_mood_set(js, mood, NULL); + return; + } + jabber_presence_send(js, FALSE); } -- cgit v1.2.1