December 21, 2009

How come + and - appears at the beginning of the line on IRC?

調べようと思ったことの発端はplumに限らず現象を見たという話から。

手がかりはxchatのソースコード: src/common/proto-irc.c:

static void
process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
{
....
case WORDL('N','O','T','I'):
{
int id = FALSE; /* identified */

text = word_eol[4];
if (*text == ':')
text++;

if (serv->have_idmsg)
{
if (*text == '+')
{
id = TRUE;
text++;
} else if (*text == '-')
text++;
}


上記のコードにあるようにxchatではある特定の条件(serv->have_idmsg)下に於いてメッセージの先頭の+および-を無視している。

では特定の条件とは何か:

static void
process_numeric (session * sess, int n,
char *word[], char *word_eol[], char *
text)
{
....
case 290: /* CAPAB reply */
if (strstr (word_eol[1], "IDENTIFY-MSG"))
{
serv->have_idmsg = TRUE;
break;
}
goto def;


CAPABコマンドの戻り値であるRPL_CLIENTCAPABIDENTIFY-MSGが渡されている場合、このような挙動になるらしい。

CAPABって何?

freenode: frequently-asked questions:
Your nick is how people on freenode know you. If you register it, you'll be able to use the same nick over and over. If you don't register, someone else may end up registering the nick you want. If you register and use the same nick, people will begin to know you by reputation. If they're running IRC software which supports CAPAB IDENTIFY-MSG, they'll be able to tell when someone is spoofing your identity.


ここよりNickServ関係であることが分かる。ということで、pruneでも似たようなコードを書いて+/-が出てくるのを回避。
http://github.com/tagoh/prune/commit/73cdf3301c422672c7a1757d6bc397d58c239721

December 8, 2009

prune - IRC protocol library for Ruby

I'm pleased to have first release of prune, IRC protocol library for Ruby now. which contains the IRC proxy daemon as the sample implementation, but works enough as powerful. in this release, strictly speaking, it doesn't have a server implementation in a class yet though, will be available in the future release.

Major features in prune are/will be:
  • Ruby-friendly to deal with the IRC protocol.
  • easy to extend the behaviour
  • the plugin mechanism
  • the reloading configuration support
Also, the features in the proxy daemon are:
  • able to keep multiple servers connection
  • the encoding support per channels.
For more details of this project, please see http://github.com/tagoh/prune. you can download the source code there too.


Enjoy,

December 2, 2009

mopera U 端末設定で作られるアカウント名を変更する

\HKCU\Software\HTC\SuperQuick\EmailAccountを任意の文字列に変更すれば実行後にPocketOutlookに作られるアカウント名がそれになる。

結構どうでもいいトリビア。