OSDN Git Service

Rename boardmanager.cpp and boardmanager.h
[kita/kita.git] / src / libkita / jbbs.cpp
1 /***************************************************************************
2  *   Copyright (C) 2006 by Kita Developers                                 *
3  *   ikemo@users.sourceforge.jp                                            *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10 #include "jbbs.h"
11
12 #include <QtCore/QTextCodec>
13
14 #include "kita_misc.h"
15 #include "postdata.h"
16
17 using namespace Kita;
18
19 JBBS::JBBS()
20 {
21     m_readCodec = QTextCodec::codecForName("eucJP");
22 }
23
24 QString JBBS::buildPostStr(const PostData& data)
25 {
26     QString ret;
27     int mib = m_writeCodec->mibEnum();
28
29     ret += "submit=%8f%91%82%ab%8d%9e%82%de";  /* kakikomu */
30     ret += "&NAME=" + encodeString(data.name(), mib);
31     ret += "&MAIL=" + encodeString(data.mail(), mib);
32     ret += "&MESSAGE=" + encodeString(data.body(), mib).replace(';', "%3B");
33     ret += "&BBS=" + data.boardId().section('/', 1, 1);
34     ret += "&DIR=" + data.boardId().section('/', 0, 0);
35     ret += "&KEY=" + data.threadId();
36     ret += "&TIME=" + QString::number(data.serverTime());
37
38     return ret;
39 }