aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-09 09:21:46 -0300
committerdequis <dx@dxzone.com.ar>2015-11-09 09:21:46 -0300
commitd6e2aa8220ae87c58c10ff54b2de80e32b51ac08 (patch)
treec667e88df6f7e207828fb519b2675e76dd923971 /protocols/nogaim.c
parentd63f37c78c273bc345daf8c40ce99905212a84a0 (diff)
Nuke imcb_clean_handle(), which was merging handles accidentally
Well, just deprecated and turned into a no-op. It was only used for jabber anonymous MUCs, but this is something the IRC layer must take care of. It stripped all whitespace, control and non-ascii characters, breaking utf8 nicks support and accidentally merging contacts whose cleaned-up handles were the same string. For example, you could have two users with nicks ' ' and ' ' (one and two spaces respectively) and imcb_clean_handle() would just merge them into a single handle, '', which makes them look like a single irc user. The same thing happens with nicks that are entirely made of utf8. Thanks to schoppenhauer from #bitlbee for reporting this and preparing a test case channel!
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index a35b9838..9462a5d9 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -734,32 +734,8 @@ void imc_rem_block(struct im_connection *ic, char *handle)
ic->acc->prpl->rem_deny(ic, handle);
}
+/* Deprecated: using this function resulted in merging several handles accidentally
+ * Also the irc layer handles this decently nowadays */
void imcb_clean_handle(struct im_connection *ic, char *handle)
{
- /* Accepts a handle and does whatever is necessary to make it
- BitlBee-friendly. Currently this means removing everything
- outside 33-127 (ASCII printable excl spaces), @ (only one
- is allowed) and ! and : */
- char out[strlen(handle) + 1];
- int s, d;
-
- s = d = 0;
- while (handle[s]) {
- if (handle[s] > ' ' && handle[s] != '!' && handle[s] != ':' &&
- (handle[s] & 0x80) == 0) {
- if (handle[s] == '@') {
- /* See if we got an @ already? */
- out[d] = 0;
- if (strchr(out, '@')) {
- continue;
- }
- }
-
- out[d++] = handle[s];
- }
- s++;
- }
- out[d] = handle[s];
-
- strcpy(handle, out);
}