comparison mcabber/src/hooks.c @ 1611:f9bf561e54d0

Use the username for authentication, added jid_get_username() to utils.c
author franky
date Sun, 11 Oct 2009 20:58:20 +0200
parents 14690e624e9d
children b008ac166b91
comparison
equal deleted inserted replaced
1610:6db9f403f707 1611:f9bf561e54d0
338 (mynick ? mynick : "me"), msg+4); 338 (mynick ? mynick : "me"), msg+4);
339 } 339 }
340 } else { 340 } else {
341 wmsg = (char*)msg; 341 wmsg = (char*)msg;
342 if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { 342 if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) {
343 const char *myid = settings_opt_get("username"); 343 char *myid = jid_get_username(settings_opt_get("jid"));
344 if (myid) 344 if (myid) {
345 wmsg = mmsg = g_strdup_printf("*%s %s", settings_opt_get("username"), 345 wmsg = mmsg = g_strdup_printf("*%s %s", myid, msg+4);
346 msg+4); 346 g_free(myid);
347 }
347 } 348 }
348 } 349 }
349 350
350 // Note: the hlog_write should not be called first, because in some 351 // Note: the hlog_write should not be called first, because in some
351 // cases scr_WriteOutgoingMessage() will load the history and we'd 352 // cases scr_WriteOutgoingMessage() will load the history and we'd