comparison src/protocols/sametime/sametime.c @ 12166:d6417efb990c

[gaim-migrate @ 14467] g_str_has_prefix is only available in glib >= 2.2.0. we already have a wrapper for this in gaim, but I guess it's not legitimate to use that in meanwhile, so I duplicated the wrapper there too. code reuse at it's worst. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 19 Nov 2005 18:09:51 +0000
parents 9ce0a5f9443b
children 4d3119205a33
comparison
equal deleted inserted replaced
12165:f8e22fef03fc 12166:d6417efb990c
715 } 715 }
716 716
717 717
718 static gboolean buddy_is_external(GaimBuddy *b) { 718 static gboolean buddy_is_external(GaimBuddy *b) {
719 g_return_val_if_fail(b != NULL, FALSE); 719 g_return_val_if_fail(b != NULL, FALSE);
720 return g_str_has_prefix(b->name, "@E "); 720 return gaim_str_has_prefix(b->name, "@E ");
721 } 721 }
722 722
723 723
724 /** Actually add a buddy to the aware service, and schedule the buddy 724 /** Actually add a buddy to the aware service, and schedule the buddy
725 list to be saved to the server */ 725 list to be saved to the server */
2656 DEBUG_INFO("MIME part Content-Type: %s\n", NSTR(type)); 2656 DEBUG_INFO("MIME part Content-Type: %s\n", NSTR(type));
2657 2657
2658 if(! type) { 2658 if(! type) {
2659 ; /* feh */ 2659 ; /* feh */
2660 2660
2661 } else if(g_str_has_prefix(type, "image")) { 2661 } else if(gaim_str_has_prefix(type, "image")) {
2662 /* put images into the image store */ 2662 /* put images into the image store */
2663 2663
2664 guchar *d_dat; 2664 guchar *d_dat;
2665 gsize d_len; 2665 gsize d_len;
2666 char *cid; 2666 char *cid;
2681 g_hash_table_insert(img_by_cid, cid, GINT_TO_POINTER(img)); 2681 g_hash_table_insert(img_by_cid, cid, GINT_TO_POINTER(img));
2682 2682
2683 /* recall the image for dereferencing later */ 2683 /* recall the image for dereferencing later */
2684 images = g_list_append(images, GINT_TO_POINTER(img)); 2684 images = g_list_append(images, GINT_TO_POINTER(img));
2685 2685
2686 } else if(g_str_has_prefix(type, "text")) { 2686 } else if(gaim_str_has_prefix(type, "text")) {
2687 2687
2688 /* concatenate all the text parts together */ 2688 /* concatenate all the text parts together */
2689 guchar *data; 2689 guchar *data;
2690 char *txt; 2690 char *txt;
2691 gsize len; 2691 gsize len;
4038 acct = gaim_connection_get_account(gc); 4038 acct = gaim_connection_get_account(gc);
4039 b = gaim_find_buddy(acct, who); 4039 b = gaim_find_buddy(acct, who);
4040 4040
4041 str = g_string_new(NULL); 4041 str = g_string_new(NULL);
4042 4042
4043 if(g_str_has_prefix(who, "@E ")) { 4043 if(gaim_str_has_prefix(who, "@E ")) {
4044 g_string_append(str, _("<b>External User</b><br>")); 4044 g_string_append(str, _("<b>External User</b><br>"));
4045 } 4045 }
4046 4046
4047 g_string_append_printf(str, _("<b>User ID:</b> %s<br>"), who); 4047 g_string_append_printf(str, _("<b>User ID:</b> %s<br>"), who);
4048 4048
4450 4450
4451 pd = gc->proto_data; 4451 pd = gc->proto_data;
4452 srvc = pd->srvc_resolve; 4452 srvc = pd->srvc_resolve;
4453 4453
4454 /* catch external buddies. They won't be in the resolve service */ 4454 /* catch external buddies. They won't be in the resolve service */
4455 if(g_str_has_prefix(buddy->name, "@E ")) { 4455 if(gaim_str_has_prefix(buddy->name, "@E ")) {
4456 buddy_add(pd, buddy); 4456 buddy_add(pd, buddy);
4457 return; 4457 return;
4458 } 4458 }
4459 4459
4460 query = g_list_prepend(NULL, buddy->name); 4460 query = g_list_prepend(NULL, buddy->name);