Changeset d6e2aa8 for protocols/nogaim.c
- Timestamp:
- 2015-11-09T12:21:46Z (8 years ago)
- Branches:
- master
- Children:
- 0d8a9bb0
- Parents:
- d63f37c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
rd63f37c rd6e2aa8 735 735 } 736 736 737 /* Deprecated: using this function resulted in merging several handles accidentally 738 * Also the irc layer handles this decently nowadays */ 737 739 void imcb_clean_handle(struct im_connection *ic, char *handle) 738 740 { 739 /* Accepts a handle and does whatever is necessary to make it 740 BitlBee-friendly. Currently this means removing everything 741 outside 33-127 (ASCII printable excl spaces), @ (only one 742 is allowed) and ! and : */ 743 char out[strlen(handle) + 1]; 744 int s, d; 745 746 s = d = 0; 747 while (handle[s]) { 748 if (handle[s] > ' ' && handle[s] != '!' && handle[s] != ':' && 749 (handle[s] & 0x80) == 0) { 750 if (handle[s] == '@') { 751 /* See if we got an @ already? */ 752 out[d] = 0; 753 if (strchr(out, '@')) { 754 continue; 755 } 756 } 757 758 out[d++] = handle[s]; 759 } 760 s++; 761 } 762 out[d] = handle[s]; 763 764 strcpy(handle, out); 765 } 741 }
Note: See TracChangeset
for help on using the changeset viewer.