src/protocols/sametime/sametime.c

changeset 12422
53fba178cadf
parent 12312
470a1452d009
child 12489
14274d68d499
equal deleted inserted replaced
12421:026806fcaf4e 12422:53fba178cadf
3253 attr = mwServiceAware_getAttribute(srvc, &idb, feature); 3253 attr = mwServiceAware_getAttribute(srvc, &idb, feature);
3254 return (attr != NULL) && mwAwareAttribute_asBoolean(attr); 3254 return (attr != NULL) && mwAwareAttribute_asBoolean(attr);
3255 } 3255 }
3256 3256
3257 3257
3258 char *user_supports_text(struct mwServiceAware *srvc, const char *who) { 3258 static char *user_supports_text(struct mwServiceAware *srvc, const char *who) {
3259 char *feat[] = {NULL, NULL, NULL, NULL, NULL}; 3259 char *feat[] = {NULL, NULL, NULL, NULL, NULL};
3260 char **f = feat; 3260 char **f = feat;
3261 3261
3262 if(user_supports(srvc, who, mwAttribute_AV_PREFS_SET)) { 3262 if(user_supports(srvc, who, mwAttribute_AV_PREFS_SET)) {
3263 gboolean mic, speak, video; 3263 gboolean mic, speak, video;
3736 } 3736 }
3737 3737
3738 3738
3739 /** generates a random-ish content id string */ 3739 /** generates a random-ish content id string */
3740 static char *im_mime_content_id() { 3740 static char *im_mime_content_id() {
3741 const char *c = "%03x@%05xmeanwhile"; 3741 srand(time(NULL));
3742 srand(time(0) ^ rand()); 3742 return g_strdup_printf("%03x@%05xmeanwhile", rand() & 0xfff, rand() & 0xfffff);
3743 return g_strdup_printf(c, rand() & 0xfff, rand() & 0xfffff);
3744 } 3743 }
3745 3744
3746 3745
3747 /** generates a multipart/related content type with a random-ish 3746 /** generates a multipart/related content type with a random-ish
3748 boundary value */ 3747 boundary value */
3749 static char *im_mime_content_type() { 3748 static char *im_mime_content_type() {
3750 const char *c = "multipart/related; boundary=related_MW%03x_%04x"; 3749 srand(time(NULL));
3751 srand(time(0) ^ rand()); 3750 return g_strdup_printf("multipart/related; boundary=related_MW%03x_%04x",
3752 return g_strdup_printf(c, rand() & 0xfff, rand() & 0xffff); 3751 rand() & 0xfff, rand() & 0xffff);
3753 } 3752 }
3754 3753
3755 3754
3756 /** determine content type from extension. Not so happy about this, 3755 /** determine content type from extension. Not so happy about this,
3757 but I don't want to actually write image type detection */ 3756 but I don't want to actually write image type detection */

mercurial