rpms/kita/F-8 kita-0.177.3-cookie-change.patch, NONE, 1.1 kita.spec, 1.10, 1.11

Mamoru Tasaka mtasaka at fedoraproject.org
Tue Sep 16 06:04:00 UTC 2008


Author: mtasaka

Update of /cvs/extras/rpms/kita/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27072/F-8

Modified Files:
	kita.spec 
Added Files:
	kita-0.177.3-cookie-change.patch 
Log Message:
* Tue Sep 16 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.3-14
- Workaround to 2ch cookie style change


kita-0.177.3-cookie-change.patch:

--- NEW FILE kita-0.177.3-cookie-change.patch ---
--- kita-0.177.3/kita/src/write/writeview.cpp.debug	2006-05-30 01:27:36.000000000 +0900
+++ kita-0.177.3/kita/src/write/writeview.cpp	2008-09-16 14:14:20.000000000 +0900
@@ -43,6 +43,9 @@
 #include <qcheckbox.h>
 #include <qlayout.h>
 
+#include <cstring>
+#include <cstdlib>
+
 /* result code */
 enum{
     K2ch_Unknown,
@@ -191,6 +194,10 @@
     for ( it = list.begin(); it != list.end(); ++it ) {
         faceCombo->insertItem( *it );
     }
+
+    cookie_type = NULL;
+    cookie_value = NULL;
+
 }
 
 
@@ -344,12 +351,48 @@
     m_array.append( data.data() );
 }
 
+void KitaWriteView::find_cookie_typevalue( const char *response ){
+	char *str_cmp, *str;
+	static char *cookie_type_static = NULL;
+	static char *cookie_value_static = NULL;
+	cookie_type = cookie_value = NULL;
+
+	str_cmp = "<input type=hidden name=\"";
+	str = strstr(response, str_cmp);
+	if (str){
+		char *str2 = strstr(str, "\"");
+		char *str3 = NULL;
+		str2++;
+		if ((!cookie_type_static) || (!(strstr(str2, cookie_type_static)))){
+			free(cookie_type_static);
+			free(cookie_value_static);
+
+			cookie_type_static = strdup(str2);
+			str3 = strstr(cookie_type_static, "\"");
+			*str3 = 0;
+
+			str = str2;
+			str2 = strstr(str, "value=\"");
+			str = str2;
+			str2 = strstr(str, "\"");
+			str2++;
+			cookie_value_static = strdup(str2);
+			str3 = strstr(cookie_value_static, "\"");
+			*str3 = 0;
+		}
+	}
+	cookie_type = cookie_type_static;
+	cookie_value = cookie_value_static;
+}
+
+
 
 /* This slot is called when posting is done. */
 /* see also slotPostMessage()                */ /* private slot */
 void KitaWriteView::slotPostFinished( KIO::Job* )
 {
     QString response;
+    const char *response_ascii;
 
     // x-euc-jp & euc-jp
     if ( m_array.contains( "euc-jp" ) ) {
@@ -401,6 +444,9 @@
         /* eat cookie, then re-post message */
     case K2ch_Cookie:
 
+	response_ascii = (const char *) QString::fromLocal8Bit(response).utf8();
+	find_cookie_typevalue(response_ascii);
+
         if ( KMessageBox::questionYesNo( 0,
                                          QTextCodec::codecForName( "utf8" ) ->toUnicode( KITAUTF8_WRITECOOKIEMSG ),
                                          resultTitle( response ) )
@@ -510,6 +556,12 @@
     ( ret += "&MESSAGE=" ) += KURL::encode_string( bodyText->text(), mib );
     ( ret += "&bbs=" ) += Kita::BoardManager::boardID( m_datURL );
     ( ret += "&hana=mogera" );
+    if (cookie_type) {
+	ret += "&" ;
+	ret += cookie_type;
+	ret += "=";
+	ret += cookie_value;
+    }
 
     /* key */
     if ( m_mode == WRITEMODE_NORMAL ) ( ret += "&key=" ) += Kita::DatManager::threadID( m_datURL );
--- kita-0.177.3/kita/src/write/writeview.h.debug	2006-05-30 01:27:36.000000000 +0900
+++ kita-0.177.3/kita/src/write/writeview.h	2008-09-16 13:23:22.000000000 +0900
@@ -45,6 +45,9 @@
 
     static QCp932Codec* m_cp932Codec;
 
+    char *cookie_type;
+    char *cookie_value;
+
 public:
 
     KitaWriteView( QWidget* parent, const char* name, const KURL& url, int mode, const QString& newThreadName = QString::null );
@@ -70,6 +73,7 @@
     void slotRecieveData( KIO::Job*, const QByteArray& );
     void slotPostFinished( KIO::Job* );
     void slotCurrentChanged ( QWidget * w );
+    void find_cookie_typevalue( const char *response );
     bool slotBodyTextChanged();
 
 private:


Index: kita.spec
===================================================================
RCS file: /cvs/extras/rpms/kita/F-8/kita.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- kita.spec	21 Aug 2007 18:32:09 -0000	1.10
+++ kita.spec	16 Sep 2008 06:03:29 -0000	1.11
@@ -3,9 +3,10 @@
 Summary:    2ch client for KDE
 Name:       kita
 Version:    %{version}
-Release:    11%{?dist}.1
-Source:     http://keihanna.dl.sourceforge.jp/kita/20336/kita-%{version}.tar.gz
+Release:    14%{?dist}
+Source:     http://downloads.sourceforge.jp/kita/20336/kita-%{version}.tar.gz
 Patch0:     kita-0.177.3-nonweak-symbol.patch
+Patch1:	    kita-0.177.3-cookie-change.patch
 License:    GPLv2+
 URL:        http://sourceforge.jp/projects/kita/
 Group:      Applications/Internet
@@ -13,12 +14,20 @@
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:       libart_lgpl-devel
+%if 0%{?fedora} >= 8
+BuildRequires:       kdelibs3-devel
+%else
 BuildRequires:       kdelibs-devel
+%endif
 BuildRequires:       desktop-file-utils
 
 Requires(post):      /sbin/ldconfig 
 Requires(postun):    /sbin/ldconfig
+%if 0%{?fedora} >= 10
+Requires:            VLGothic-fonts
+%else
 Requires:            fonts-japanese
+%endif
 
 %description
 Kita is a 2ch client for KDE.
@@ -27,6 +36,7 @@
 %setup -q
 
 %patch0 -p2 -b .link
+%patch1 -p1 -b .cookie
 
 %{__sed} -i.soname \
    -e 's|^kita\([\._][lL]\)|libkitamain\1|' \
@@ -62,7 +72,6 @@
       --delete-original \
       --vendor fedora \
       --dir %{buildroot}%{_datadir}/applications \
-      --add-category X-Fedora \
       --add-category KDE \
       --add-category Qt \
       %{buildroot}/%{name}.desktop
@@ -91,15 +100,17 @@
 
 %post
 /sbin/ldconfig
-touch --no-create %{_datadir}/icons/hicolor || :
-%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
-%{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null || :
+touch --no-create %{_datadir}/icons/hicolor
+%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
+%{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null
+exit 0
 
 %postun
 /sbin/ldconfig
-touch --no-create %{_datadir}/icons/hicolor || :
-%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
-%{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null || :
+touch --no-create %{_datadir}/icons/hicolor
+%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
+%{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null
+exit 0
 
 %files -f %{name}.lang
 %defattr(-, root, root)
@@ -112,6 +123,18 @@
 %{_datadir}/doc/HTML/en/kita/
 
 %changelog
+* Tue Sep 16 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.3-14
+- Workaround to 2ch cookie style change
+
+* Mon Jul 28 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.3-13
+- Change Japanese fonts Requires (F-10+)
+
+* Sat Feb  9 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp>
+- Rebuild against gcc43 (F-9)
+
+* Sat Dec  8 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.3-12
+- kdelibs3-devel switch (F-9)
+
 * Wed Aug 22 2007 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.3-11.dist.1
 - Mass rebuild (buildID or binutils issue)
 




More information about the fedora-extras-commits mailing list