[Pkg-privacy-commits] [irssi-plugin-otr] 142/267: cleaning up dir for new release
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.
commit b1bac71f8d135536bd19dc033734a516b40d1c7e
Author: DrWhax <drwhax at gmail.com>
Date: Fri Nov 16 22:19:21 2012 +0100
cleaning up dir for new release
---
CMakeLists.txt | 225 ---------
ChangeLog | 16 -
HOWTO_PACKAGE | 17 -
INSTALL | 33 --
LICENSE | 339 --------------
Packaging-DEB.cmake | 7 -
Packaging-RPM.cmake | 23 -
Packaging.cmake | 42 --
README | 5 -
README.irssi-headers | 3 -
README.xchat | 9 -
cmake-extensions/COPYING-CMAKE-SCRIPTS | 22 -
cmake-extensions/FindLibGcrypt.cmake | 52 ---
cmake-extensions/FindLibOTR.cmake | 49 --
cmake-extensions/Git.cmake | 20 -
cmake-extensions/cscope.cmake | 17 -
formats.txt | 96 ----
io-config.h.in | 3 -
io_set.c | 62 ---
io_util.c | 269 -----------
irssi/CMakeLists.txt | 68 ---
irssi/irssi_otr.c | 302 ------------
irssi/irssi_otr.h | 81 ----
makeformats.py | 130 ------
mksrcpackage.sh | 17 -
otr.h | 243 ----------
otr_key.c | 305 -------------
otr_ops.c | 302 ------------
otr_util.c | 812 ---------------------------------
xchat/CMakeLists.txt | 35 --
xchat/xchat_otr.c | 238 ----------
xchat/xchat_otr.h | 84 ----
32 files changed, 3926 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 7754ddd..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,225 +0,0 @@
-#
-# Off-the-Record Messaging (OTR) modules for IRC
-# Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
-#
-
-PROJECT(irc-otr)
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-SET(CMAKE_MODULE_PATH
- ${PROJECT_SOURCE_DIR}/cmake-extensions/
- ${PROJECT_BINARY_DIR})
-
-INCLUDE(cmake-extensions/cscope.cmake)
-INCLUDE(cmake-extensions/Git.cmake)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(tarballdefs.cmake OPTIONAL)
-
-# get version from git
-
-IF(NOT IRCOTR_VERSION)
- IF(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
- MESSAGE(FATAL_ERROR "Cannot determine the irc-otr version since this is "
- "not a git checkout. Please set IRCOTR_VERSION, e.g.
- cmake -DIRCOTR_VERSION=mydistro-0.1
- or
- cmake -DIRCOTR_VERSION=mydistro-git-<git-commit>")
- ENDIF(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
- FIND_GIT_TAGORCOMMIT(${PROJECT_SOURCE_DIR} IRCOTR_VERSION)
- IF(NOT IRCOTR_VERSION)
- MESSAGE(FATAL_ERROR
- "Couldn't determine version. Please run cmake -DIRCOTR_VERSION=...")
- ENDIF(NOT IRCOTR_VERSION)
-ENDIF(NOT IRCOTR_VERSION)
-
-MESSAGE(STATUS "Building irc-otr version ${IRCOTR_VERSION}")
-
-# PkgConfig. Only available since 2.4.7, fetch if unavailable so people with
-# older cmake can run this
-
-FIND_PACKAGE(PkgConfig QUIET)
-
-IF(NOT PKG_CONFIG_FOUND)
- MESSAGE(STATUS "Couldn't find the pkg-config cmake module. Seems you're
- running cmake < 2.4.7. Will try to fetch the module from 2.4.7...")
- FIND_PACKAGE(Wget REQUIRED)
- EXECUTE_PROCESS(COMMAND "bash" "-c"
- "${WGET_EXECUTABLE} '-O' '-' \\
- 'http://www.cmake.org/files/v2.4/cmake-2.4.7.tar.gz' | \\
- tar xz cmake-2.4.7/Modules/FindPkgConfig.cmake && \\
- mv cmake-2.4.7/Modules/FindPkgConfig.cmake . && \\
- rmdir -p cmake-2.4.7/Modules"
- RESULT_VARIABLE PKGCONF_RET)
- IF(NOT PKGCONF_RET EQUAL 0)
- MESSAGE(FATAL_ERROR "Couldnt download cmake module for pkg-config")
- ENDIF(NOT PKGCONF_RET EQUAL 0)
- FIND_PACKAGE(PkgConfig REQUIRED)
-ENDIF(NOT PKG_CONFIG_FOUND)
-
-# GLIB
-
-pkg_check_modules(GLIB REQUIRED glib-2.0)
-
-# Python
-
-FIND_PACKAGE(PythonInterp)
-IF(NOT PYTHON_EXECUTABLE)
- MESSAGE(FATAL_ERROR "Couldn't find a python interpreter")
-ENDIF(NOT PYTHON_EXECUTABLE)
-
-# LIBOTR
-
-FIND_PACKAGE(LibOTR REQUIRED)
-IF (LIBOTR_VERSION LESS "3.1.0")
- MESSAGE(FATAL_ERROR "Need libotr version >= 3.1.0 (fragmentation)")
-ENDIF (LIBOTR_VERSION LESS "3.1.0")
-
-# LIBGCRYPT. A dependency of libotr and therefore one of ours.
-
-FIND_PACKAGE(LibGcrypt REQUIRED)
-
-# includes
-
-SET(IRCOTR_INCLUDE_DIRS
- ${PROJECT_SOURCE_DIR}
- ${PROJECT_BINARY_DIR}
- ${GLIB_INCLUDE_DIRS}
- ${LIBOTR_INCLUDE_DIRS})
-
-SET(CMAKE_REQUIRED_INCLUDES ${IRCOTR_INCLUDE_DIRS})
-SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H ${LIBGCRYPT_CFLAGS})
-
-
-include_directories(${IRCOTR_INCLUDE_DIRS})
-
-# gregex.h
-# available since 2.13 AFAIK
-# optional for html stripping and nick ignoring
-
-CHECK_INCLUDE_FILE(glib/gregex.h HAVE_GREGEX_H)
-
-# check for strsignal
-
-CHECK_FUNCTION_EXISTS(strsignal HAVE_STRSIGNAL)
-
-# generate io-config.h
-
-CONFIGURE_FILE(io-config.h.in io-config.h)
-
-# defs
-
-IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE debug)
-ENDIF(NOT CMAKE_BUILD_TYPE)
-SET(CMAKE_C_FLAGS_DEBUG -g)
-
-MESSAGE(STATUS "This is a ${CMAKE_BUILD_TYPE} build")
-
-ADD_DEFINITIONS(-DHAVE_CONFIG_H -Wall ${LIBGCRYPT_CFLAGS})
-
-# generate otr-formats.{c,h}
-
-ADD_CUSTOM_COMMAND(OUTPUT
- otr-formats.c
- xchat-formats.c
- DEPENDS makeformats.py formats.txt README
- COMMAND
- ${PYTHON_EXECUTABLE}
- ${PROJECT_SOURCE_DIR}/makeformats.py
- ${PROJECT_SOURCE_DIR}/formats.txt
- ${PROJECT_SOURCE_DIR}/README
- )
-
-
-add_custom_target(otrformats DEPENDS otr-formats.c)
-
-# Now that took some time to figure out...
-
-IF(APPLE)
- SET(APPLE_LDFLAGS "-single_module -undefined dynamic_lookup")
-ENDIF(APPLE)
-
-FOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
- SET(MAIN_LDFLAGS "${MAIN_LDFLAGS} ${X}")
-ENDFOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
-
-FIND_PATH(IRSSI_INCLUDE_DIR NAMES irssi/src/core/module.h)
-MARK_AS_ADVANCED(IRSSI_INCLUDE_DIR)
-
-FIND_PATH(WEECHAT_INCLUDE_DIR NAMES weechat/weechat-plugin.h
- PATHS ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
-MARK_AS_ADVANCED(WEECHAT_INCLUDE_DIR)
-
-FIND_PATH(XCHAT_INCLUDE_DIR NAMES xchat/xchat-plugin.h)
-MARK_AS_ADVANCED(XCHAT_INCLUDE_DIR)
-
-IF(CMAKE_SOURCE_DIR MATCHES "irssi-[^/]*$")
- SET(W_IRSSI ON)
-ELSEIF(CMAKE_SOURCE_DIR MATCHES "xchat-[^/]*$")
- SET(W_XCHAT ON)
-ELSEIF(CMAKE_SOURCE_DIR MATCHES "weechat-[^/]*$")
- SET(W_WEECHAT ON)
-ELSEIF(CMAKE_SOURCE_DIR MATCHES "bitlbee-[^/]*$")
- SET(W_BITLBEE ON)
-ELSE(CMAKE_SOURCE_DIR MATCHES "irssi-[^/]*$")
- IF(IRSSI_INCLUDE_DIR)
- SET(W_IRSSI ON)
- ENDIF(IRSSI_INCLUDE_DIR)
- IF(XCHAT_INCLUDE_DIR)
- SET(W_XCHAT ON)
- ENDIF(XCHAT_INCLUDE_DIR)
- IF(WEECHAT_INCLUDE_DIR)
- SET(W_WEECHAT ON)
- ENDIF(WEECHAT_INCLUDE_DIR)
- IF(BITLBEE_INCLUDE_DIR)
- SET(W_BITLBEE ON)
- ENDIF(BITLBEE_INCLUDE_DIR)
-ENDIF(CMAKE_SOURCE_DIR MATCHES "irssi-[^/]*$")
-
-OPTION(WANT_IRSSI "build irssi plugin" ${W_IRSSI})
-OPTION(WANT_XCHAT "build xchat plugin" ${W_XCHAT})
-OPTION(WANT_WEECHAT "build weechat plugin" ${W_WEECHAT})
-OPTION(WANT_BITLBEE "build bitlbee plugin" ${W_BITLBEE})
-
-IF(WANT_IRSSI)
- add_subdirectory(irssi)
-ENDIF(WANT_IRSSI)
-IF(WANT_XCHAT)
- add_subdirectory(xchat)
-ENDIF(WANT_XCHAT)
-IF(WANT_WEECHAT)
- add_subdirectory(weechat)
-ENDIF(WANT_WEECHAT)
-IF(WANT_BITLBEE)
- add_subdirectory(bitlbee)
-ENDIF(WANT_BITLBEE)
-
-# cscope
-
-FILE(GLOB CSANDHS *.c *.h)
-ADD_CSCOPE_TARGET("${CSANDHS}" "${IRCOTR_INCLUDE_DIRS}")
-
-# Source tarball
-ADD_CUSTOM_TARGET(src-tarball
- ${PROJECT_SOURCE_DIR}/mksrcpackage.sh ${PROJECT_SOURCE_DIR}
- ${IRCOTR_VERSION})
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 46b0eb8..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,16 +0,0 @@
-Version 0.3
- * create queries for OTR messages if otr_createqueries is set
- * finish conversations on unload unless otr_finishonunload is off
- * added settings otr_policy, otr_policy_known and otr_ignore
- * fixed two segfault sources
- * key generation now operates on a temp file
- * the .irssi/otr dir now gets created with mode 700
- * commands now take an optional nick at server argument
- (for single message window users)
- * changed loglevel of otr_log (heartbeats) and otr_finish
- * moved to the new public statusbar-item.h header
-
-Version 0.2
-
- * fixed multiple server problem.
- * fixed fragmentation problem (seen with pidgin over IRC).
diff --git a/HOWTO_PACKAGE b/HOWTO_PACKAGE
deleted file mode 100644
index 90334d5..0000000
--- a/HOWTO_PACKAGE
+++ /dev/null
@@ -1,17 +0,0 @@
-You can let cmake generate a package for you. But don't expect it to be in
-full conformance with your distribution.
-
-You'll need cmake >= 2.6. In theory, all you should have to do is:
-
- $ cmake -DCMAKE_INSTALL_TYPE=package-deb /path/to/src
- $ sudo make package
-
-For an RPM it should be package-rpm and for TGZ...you can imagine.
-
-I'm not sure yet if the RPMs/DEBs generated by cmake/CPack are 100% OK. You can
-tweak the settings in Packaging-{RPM,DEB}.cmake. If you wanna see how CPack does
-it and what variables affect it, check out:
-
- /usr/share/cmake/Modules/CPackDeb.cmake
- /usr/share/cmake/Modules/CPackRPM.cmake
-
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 2cc0bd8..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,33 +0,0 @@
----------- INSTALL ----------
-
-Usually the following will do:
-
- $ cmake /path/to/src
- $ make
- $ sudo make install
-
-If you want to install libotr.so into your home folder
-(~/.irssi/modules/libotr.so) run
-
- $ cmake -DCMAKE_INSTALL_TYPE=home /path/to/src
-
-instead.
-
----------- RUNTIME DEPENDENCIES ----------
-
-* libotr >= 3.1.0. Fragmentation has been introduced in that version so
- nothing smaller will work.
-
-* glib. Will work with < 2.13 but since there are no regexes available
- HTML stripping (OTR spits out HTML sometimes) and nick ignoring and
- setting otr_policy won't work.
-
-* irssi. Obviously ;)
-
----------- BUILD-TIME ONLY DEPENDENCIES ----------
-
-* cmake. Sry for that, but I'm not an autofoo fan. If you're running
- < cmake-2.4.7 then configure will try to download a missing module
- (pkgconfig) from the cmake-2.4.7 sources. Should work.
-
-* pkg-config, python and wget.
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d511905..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/Packaging-DEB.cmake b/Packaging-DEB.cmake
deleted file mode 100644
index 88cd52f..0000000
--- a/Packaging-DEB.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-INSTALL(TARGETS irssiotr DESTINATION lib${LIB_SUFFIX}/irssi/modules)
-INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
-
-SET(CPACK_GENERATOR DEB)
-#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
-SET(CPACK_DEBIAN_PACKAGE_SECTION "net")
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "irssi, libotr2 (>= 3.1.0)")
diff --git a/Packaging-RPM.cmake b/Packaging-RPM.cmake
deleted file mode 100644
index d560e81..0000000
--- a/Packaging-RPM.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-INSTALL(TARGETS irssiotr DESTINATION lib${LIB_SUFFIX}/irssi/modules)
-INSTALL(FILES README DESTINATION ${DOCDIR})
-
-SET(CPACK_GENERATOR RPM)
-SET(CPACK_RPM_PACKAGE_DEBUG)
-SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
-SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
-
-EXECUTE_PROCESS(COMMAND bash -c
- "ARCH=`which arch` && $ARCH | tr -d '\n'"
- OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE)
-
-#IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-# SET(CPACK_RPM_PACKAGE_ARCHITECTURE i386)
-#ELSE
-# SET(CPACK_RPM_PACKAGE_ARCHITECTURE i386)
-#ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-
-SET(CPACK_RPM_PACKAGE_RELEASE 1)
-SET(CPACK_RPM_PACKAGE_GROUP "unknown")
-SET(CPACK_RPM_FILE_NAME
- ${CPACK_PACKAGE_FILE_NAME}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE})
-SET(CPACK_PACKAGE_FILE_NAME ${CPACK_RPM_FILE_NAME})
diff --git a/Packaging.cmake b/Packaging.cmake
deleted file mode 100644
index e57d041..0000000
--- a/Packaging.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-SET(CPACK_PACKAGE_CONTACT "Ulim <a.sporto+bee at gmail.com>")
-SET(CPACK_PACKAGE_VENDOR ${CPACK_PACKAGE_CONTACT})
-
-SET(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
-SET(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README)
-
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
- "Off-The-Record Messaging (OTR) for irssi")
-
-SET(CPACK_PACKAGE_FILE_NAME
- ${CMAKE_PROJECT_NAME}-${IRCOTR_VERSION})
-
-SET(CPACK_GENERATOR TGZ)
-
-SET(CPACK_PACKAGE_VERSION ${IRCOTR_VERSION})
-
-IF(CMAKE_INSTALL_TYPE STREQUAL "package-rpm")
- CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
- INCLUDE(Packaging-RPM.cmake)
-ELSEIF(CMAKE_INSTALL_TYPE STREQUAL "package-deb")
- CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
- INCLUDE(Packaging-DEB.cmake)
-ELSEIF(CMAKE_INSTALL_TYPE STREQUAL "package-tgz")
- INSTALL(TARGETS irssiotr DESTINATION irssi/lib/modules)
- INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
-ELSE(CMAKE_INSTALL_TYPE STREQUAL "package-rpm")
- MESSAGE(FATAL_ERROR "Unknown build type '${CMAKE_INSTALL_TYPE}'")
-ENDIF(CMAKE_INSTALL_TYPE STREQUAL "package-rpm")
-
-
-
-#ENDIF(CMAKE_INSTALL_TYPE STREQUAL "package-tgz")
-#ENDIF(CMAKE_INSTALL_TYPE STREQUAL "package-deb")
-
-#SET(CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/README)
-#SET(CPACK_PACKAGE_VERSION_MAJOR "0")
-#SET(CPACK_PACKAGE_VERSION_MINOR "1")
-#SET(CPACK_PACKAGE_VERSION_PATCH "0")
-#SET(CPACK_PACKAGE_FILE_NAME
-# ${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
-
-INCLUDE(CPack)
diff --git a/README b/README
deleted file mode 100644
index 9cf2482..0000000
--- a/README
+++ /dev/null
@@ -1,5 +0,0 @@
--{ Original author: http://irssi-otr.tuxfamily.org/
-
--{ Forked to fix bugs, software is not stable at this moment, do not rely on it for strong security!
--{Original readme is the READ_ME file.
--{https://crypto.is/ project.
diff --git a/README.irssi-headers b/README.irssi-headers
deleted file mode 100644
index 2d7c9d7..0000000
--- a/README.irssi-headers
+++ /dev/null
@@ -1,3 +0,0 @@
-statusbar-item.h is an irssi header;
-hence it is licensed under the same license as irssi (GPLv2).
-If you want to know why it is here, check out irssi FS#535.
diff --git a/README.xchat b/README.xchat
deleted file mode 100644
index e55029f..0000000
--- a/README.xchat
+++ /dev/null
@@ -1,9 +0,0 @@
-The README file is written for irssi but what's said there mostly applies to
-xchat as well. The only difference is that xchat doesn't support adding
-/settings, so in order to see and change the current settings you'll have to use
-the "/otr set" command. Without arguments it will show the current settings and
-if supplied with a setting name and a value it will change the given setting.
-There is no persistence, i.e. each time you start xchat the hardcoded defaults
-will be active. Please use standard xchat scripting magic to change the defaults
-to your liking on startup. It seems overkill to have a config parser/writer just
-for this plugin and it is fortunately not neccessary.
diff --git a/cmake-extensions/COPYING-CMAKE-SCRIPTS b/cmake-extensions/COPYING-CMAKE-SCRIPTS
deleted file mode 100644
index 4b41776..0000000
--- a/cmake-extensions/COPYING-CMAKE-SCRIPTS
+++ /dev/null
@@ -1,22 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake-extensions/FindLibGcrypt.cmake b/cmake-extensions/FindLibGcrypt.cmake
deleted file mode 100644
index 9e5a245..0000000
--- a/cmake-extensions/FindLibGcrypt.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# This is from KDE SVN, I just changed LIBGCRYPT_LIBRARIES to LIBGCRYPT_LDFLAGS
-# cause that's what it is at least on my system - Uli
-
-# - Try to find the Gcrypt library
-# Once run this will define
-#
-# LIBGCRYPT_FOUND - set if the system has the gcrypt library
-# LIBGCRYPT_CFLAGS - the required gcrypt compilation flags
-# LIBGCRYPT_LDFLAGS - the linker libraries needed to use the gcrypt library
-#
-# Copyright (c) 2006 Brad Hards <bradh at kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-# libgcrypt is moving to pkg-config, but earlier version don't have it
-
-#search in typical paths for libgcrypt-config
-FIND_PROGRAM(LIBGCRYPTCONFIG_EXECUTABLE NAMES libgcrypt-config)
-
-#reset variables
-set(LIBGCRYPT_LDFLAGS)
-set(LIBGCRYPT_CFLAGS)
-
-# if libgcrypt-config has been found
-IF(LIBGCRYPTCONFIG_EXECUTABLE)
-
- EXEC_PROGRAM(${LIBGCRYPTCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_LDFLAGS)
-
- EXEC_PROGRAM(${LIBGCRYPTCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_CFLAGS)
-
- IF(${LIBGCRYPT_CFLAGS} MATCHES "\n")
- SET(LIBGCRYPT_CFLAGS " ")
- ENDIF(${LIBGCRYPT_CFLAGS} MATCHES "\n")
-
- IF(LIBGCRYPT_LDFLAGS AND LIBGCRYPT_CFLAGS)
- SET(LIBGCRYPT_FOUND TRUE)
- ENDIF(LIBGCRYPT_LDFLAGS AND LIBGCRYPT_CFLAGS)
-
-ENDIF(LIBGCRYPTCONFIG_EXECUTABLE)
-
-if (LIBGCRYPT_FOUND)
- if (NOT LibGcrypt_FIND_QUIETLY)
- message(STATUS "Found libgcrypt: ${LIBGCRYPT_LDFLAGS}")
- endif (NOT LibGcrypt_FIND_QUIETLY)
-else (LIBGCRYPT_FOUND)
- if (LibGcrypt_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find libgcrypt libraries")
- endif (LibGcrypt_FIND_REQUIRED)
-endif (LIBGCRYPT_FOUND)
-
-MARK_AS_ADVANCED(LIBGCRYPT_CFLAGS LIBGCRYPT_LDFLAGS)
diff --git a/cmake-extensions/FindLibOTR.cmake b/cmake-extensions/FindLibOTR.cmake
deleted file mode 100644
index 63624c9..0000000
--- a/cmake-extensions/FindLibOTR.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Uli Meis <a.sporto+bee at gmail.com>
-#
-# Mostly taken from cmake findcurl, version stuff from kopete
-#
-# - Find libotr
-# Find the libotr headers and library.
-#
-# LIBOTR_INCLUDE_DIR
-# LIBOTR_LIBRARIES
-# LIBOTR_FOUND
-
-# Look for the header file.
-FIND_PATH(LIBOTR_INCLUDE_DIR NAMES libotr/version.h)
-MARK_AS_ADVANCED(LIBOTR_INCLUDE_DIR)
-
-# Look for the library.
-FIND_LIBRARY(LIBOTR_LIBRARY NAMES otr)
-MARK_AS_ADVANCED(LIBOTR_LIBRARY)
-
-# Copy the results to the output variables.
-IF(LIBOTR_INCLUDE_DIR AND LIBOTR_LIBRARY)
- SET(LIBOTR_FOUND 1)
- SET(LIBOTR_LIBRARIES ${LIBOTR_LIBRARY})
- SET(LIBOTR_INCLUDE_DIRS ${LIBOTR_INCLUDE_DIR})
- EXECUTE_PROCESS(COMMAND grep "OTRL_VERSION"
- "${LIBOTR_INCLUDE_DIR}/libotr/version.h" OUTPUT_VARIABLE output)
- STRING(REGEX MATCH "OTRL_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+"
- LIBOTR_VERSION "${output}")
- STRING(REGEX REPLACE "^OTRL_VERSION \"" "" LIBOTR_VERSION "${LIBOTR_VERSION}")
- MESSAGE(STATUS " found libotr, version ${LIBOTR_VERSION}" )
-ELSE(LIBOTR_INCLUDE_DIR AND LIBOTR_LIBRARY)
- SET(LIBOTR_FOUND 0)
- SET(LIBOTR_LIBRARIES)
- SET(LIBOTR_INCLUDE_DIRS)
-ENDIF(LIBOTR_INCLUDE_DIR AND LIBOTR_LIBRARY)
-
-# Report the results.
-IF(NOT LIBOTR_FOUND)
- SET(LIBOTR_DIR_MESSAGE
- "LIBOTR was not found. Make sure LIBOTR_LIBRARY and LIBOTR_INCLUDE_DIR are set.")
- IF(NOT LIBOTR_FIND_QUIETLY)
- MESSAGE(STATUS "${LIBOTR_DIR_MESSAGE}")
- ELSE(NOT LIBOTR_FIND_QUIETLY)
- IF(LIBOTR_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${LIBOTR_DIR_MESSAGE}")
- ENDIF(LIBOTR_FIND_REQUIRED)
- ENDIF(NOT LIBOTR_FIND_QUIETLY)
-ENDIF(NOT LIBOTR_FOUND)
diff --git a/cmake-extensions/Git.cmake b/cmake-extensions/Git.cmake
deleted file mode 100644
index d731c82..0000000
--- a/cmake-extensions/Git.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Uli Meis <a.sporto+bee at gmail.com>
-#
-# Handy macro for fetching current tag or commit of a git repo.
-#
-MACRO(FIND_GIT_TAGORCOMMIT GITDIR CMAKEVAR)
- EXECUTE_PROCESS(COMMAND bash -c
- "GITCOMMIT=`git log | head -n1 | cut -d' ' -f2`;\\
- if [ -z \"$GITCOMMIT\" ]; then exit 1;fi; \\
- GITTAG=`cd .git/refs/tags && grep $GITCOMMIT * | cut -d: -f1` ;\\
- if [ -n \"$GITTAG\" ]; then \\
- echo -n $GITTAG | tr -d v; else \\
- echo -n git-$GITCOMMIT;fi"
- WORKING_DIRECTORY ${GITDIR}
- OUTPUT_VARIABLE GIT_TAGORCOMMIT
- RESULT_VARIABLE GIT_TAGORCOMMITRET)
- IF(GIT_TAGORCOMMITRET EQUAL 0)
- SET(${CMAKEVAR} ${GIT_TAGORCOMMIT})
- ENDIF(GIT_TAGORCOMMITRET EQUAL 0)
-ENDMACRO(FIND_GIT_TAGORCOMMIT)
diff --git a/cmake-extensions/cscope.cmake b/cmake-extensions/cscope.cmake
deleted file mode 100644
index 59594b4..0000000
--- a/cmake-extensions/cscope.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Uli Meis <a.sporto+bee at gmail.com>
-#
-# Handy macro for generating the cscope database
-#
-
-MACRO(ADD_CSCOPE_TARGET CSCOPE_SOURCES CSCOPE_INCLUDES)
- ADD_CUSTOM_COMMAND(
- OUTPUT cscope.out
- DEPENDS ${CSCOPE_SOURCES}
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- COMMAND
- echo '${CSCOPE_SOURCES}' | tr ' ' '\\n' >cscope.files
- COMMAND
- cscope -b `echo ${CSCOPE_INCLUDES} | xargs -n1 bash -c 'echo -I$$0'`)
- ADD_CUSTOM_TARGET(cscope DEPENDS cscope.out)
-ENDMACRO(ADD_CSCOPE_TARGET)
diff --git a/formats.txt b/formats.txt
deleted file mode 100644
index 9778174..0000000
--- a/formats.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-Keys
-kg_failed Key generation for %s: failed: %s (%s)
-kg_completed Key generation for %s: completed in %d seconds. Reloading keys
-kg_aborted_dup Key generation for %s: aborted. Key generation for %s still in progress
-kg_aborted_dir Key generation for %s: aborted, failed creating directory %s: %s
-kg_mkdir created directory %s
-kg_pipe Key generation for %s: error creating pipe: %s
-kg_fork Key generation for %s: fork() error: %s
-kg_initiated Key generation for %s: initiated. This might take several minutes or on some systems even an hour. If you wanna check that something is happening, see if there are two processes of your IRC client.
-kg_exited Key generation for %s: child terminated for unknown reason
-kg_exitsig Key generation for %s: child was killed by signal %s
-kg_pollerr Key generation for %s: error poll()ing child: %s
-kg_abort Key generation for %s: aborted
-kg_needacc I need an account name. Try something like /otr genkey mynick at irc.server.net
-kg_noabort No ongoing key generation to abort
-key_not_found no private keys found
-key_loaded private keys loaded
-key_load_error Error loading private keys: %s (%s)
-Fingerprints
-fp_saved fingerprints saved
-fp_save_error Error saving fingerprints: %s (%s)
-fp_not_found no fingerprints found
-fp_loaded fingerprints loaded
-fp_load_error Error loading fingerprints: %s (%s)
-fp_trust Trusting fingerprint from %s
-Callbacks
-ops_notify_bug BUG() in ops_notify
-ops_notify title: %s prim: %s sec: %s
-ops_display_bug BUG() in ops_display
-ops_display msg: %s
-ops_sec gone %%9secure%%9
-ops_fpcomp Your peer is not authenticated. To make sure you're talking to the right guy you can either agree on a secret and use the authentication described in %9/otr auth%9, or use the traditional way and compare fingerprints over a secure line (e.g. telephone) and subsequently enter %9/otr trust%9. Your fingerprint is: %s. %s's fingerprint: %s
-ops_insec gone %9insecure%9
-ops_still_reply still %%9secure%9 (is reply)
-ops_still_no_reply still %%9secure%9 (is not reply)
-ops_log log msg: %s
-ops_inject Couldn't inject message from %s for %s: %s
-SendingReceiving
-send_failed send failed: msg=%s
-send_change couldn't find context also OTR changed the outgoing message(BUG?)
-send_fragment failed to fragment message: msg=%s
-send_converted OTR converted sent message to %s
-receive_ignore_query ignoring rest of OTR default query msg
-receive_dequeued dequeued msg of length %d
-receive_queued queued msg of length %d
-receive_ignore ignoring protocol message of length %d, acc=%s, from=%s: %s
-receive_converted OTR converted received message
-otr_better_two <b>%s</b> has requested an <a href=\"http://otr.cypherpunks.ca/\">Off-the-Record private conversation</a>. However, you do not have a plugin to support that.
-otr_better_three See <a href=\"http://otr.cypherpunks.ca/\">http://otr.cypherpunks.ca/</a> for more information.
-Context
-ctx_not_found couldn't find context: acc=%s nick=%s
-ctx_not_create couldn't create/find context: acc=%s from=%s
-Authentication
-auth_aborted_ongoing Ongoing authentication aborted
-auth_aborted Authentication aborted
-auth_responding Responding to authentication request...
-auth_initiated Initiated authentication...
-auth_have_old %s wanted to authenticate but an old authentication was still ongoing. Old authentication will be aborted, please try again.
-auth_peer %s wants to authenticate. Type /otr auth <your-shared-secret> to complete.
-auth_peer_reply_wrong %s replied to an auth we didn't start.
-auth_peer_replied %s replied to our auth request...
-auth_peer_wrong_smp3 %s sent a wrong authentication message (SMP3).
-auth_peer_wrong_smp4 %s sent a wrong authentication message (SMP4).
-auth_successful Authentication successful!
-auth_failed Authentication failed!
-auth_needenc You need to establish an OTR session before you can authenticate.
-Commands
-cmd_otr We're alive
-cmd_qnotfound Failed: Can't get nick and server of current query window. (Or maybe you're doing this in the status window?)
-cmd_auth Please agree on a secret with your peer and then initiate the authentication with /otr auth <secret> or let him initiate. Should you initiate your peer will after a little while be instructed to enter the secret as well. Once he has done so the authentication will finish up. Should you have both typed in the same secret the authentication should be successful.
-cmd_debug_on Debug mode is on
-cmd_debug_off Debug mode is off
-cmd_finish Finished conversation with %s@%s.
-cmd_finishall_none No conversations to finish.
-cmd_version This is irc-otr version %s
-peer_finished %s has finished the OTR conversation. If you want to continue talking enter %9/otr finish%9 for plaintext or ?OTR? to restart OTR.
-Contexts
-ctx_ctx_unencrypted %%9%20s%%9 %30s plaintext
-ctx_ctx_encrypted %%9%20s%%9 %30s %gencrypted%n
-ctx_ctx_finished %%9%20s%%9 %30s finished
-ctx_ctx_unknown %%9%20s%%9 %30s unknown state(BUG?)
-ctx_fps_no %s %rnot authenticated%n
-ctx_fps_smp %s %gauthenticated%n via shared secret (SMP)
-ctx_fps_man %s %gauthenticated%n manually
-ctx_noctxs No active OTR contexts found
-Statusbar
-st_plaintext {sb plaintext}
-st_untrusted {sb %rOTR(not auth'ed)%n}
-st_trust_smp {sb %gOTR%n}
-st_trust_manual {sb %gOTR%n}
-st_smp_incoming {sb {hilight incoming auth request...}}
-st_smp_outgoing {sb {hilight awaiting auth reply...}}
-st_smp_finalize {sb {hilight finalizing auth...}}
-st_smp_unknown {sb {hilight unknown auth state!}}
-st_finished {sb finished}
-st_unknown {sb {hilight state unknown (BUG!)}}
diff --git a/io-config.h.in b/io-config.h.in
deleted file mode 100644
index a753af6..0000000
--- a/io-config.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-#cmakedefine HAVE_STRSIGNAL
-#cmakedefine HAVE_GREGEX_H
-#define IRCOTR_VERSION "${IRCOTR_VERSION}"
diff --git a/io_set.c b/io_set.c
deleted file mode 100644
index 997e078..0000000
--- a/io_set.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2009 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "otr.h"
-
-#ifdef HAVE_GREGEX_H
-extern GRegex *regex_nickignore;
-#endif
-
-char set_policy[512] = IO_DEFAULT_POLICY;
-char set_policy_known[512] = IO_DEFAULT_POLICY_KNOWN;
-char set_ignore[512] = IO_DEFAULT_IGNORE;
-int set_finishonunload = TRUE;
-
-void cmd_set(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- char *setting, *value;
-
- if (argc) {
- setting = argv[0];
- value = argv[1] ? : "";
- }
-
- if (!argc) {
- otr_logst(MSGLEVEL_CRAP,"policy: %s\n"
- "policy_known: %s\nignore: %s\n"
- "finishonunload: %s\n",
- set_policy,set_policy_known,set_ignore,
- set_finishonunload ? "true" : "false");
- } else if (strcmp(setting,"policy")==0) {
- otr_setpolicies(ioustate,value,FALSE);
- strcpy(set_policy,value);
- } else if (strcmp(setting,"policy_known")==0) {
- otr_setpolicies(ioustate,value,TRUE);
- strcpy(set_policy_known,value);
- } else if (strcmp(setting,"ignore")==0) {
-#ifdef HAVE_GREGEX_H
- if (regex_nickignore)
- g_regex_unref(regex_nickignore);
- regex_nickignore = g_regex_new(value,0,0,NULL);
- strcpy(set_ignore,value);
-#endif
- } else if (strcmp(setting,"finishonunload")==0) {
- set_finishonunload = (strcasecmp(value,"true")==0);
- }
-}
diff --git a/io_util.c b/io_util.c
deleted file mode 100644
index b347950..0000000
--- a/io_util.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "otr.h"
-
-char *otr_status_txt[] = {
- "FINISHED",
- "TRUST_MANUAL",
- "TRUST_SMP",
- "SMP_ABORT",
- "SMP_STARTED",
- "SMP_RESPONDED",
- "SMP_INCOMING",
- "SMP_FINALIZE",
- "SMP_ABORTED",
- "PEER_FINISHED",
- "SMP_FAILED",
- "SMP_SUCCESS",
- "GONE_SECURE",
- "GONE_INSECURE",
- "CTX_UPDATE"
-};
-
-int extract_nick(char *nick, char *line)
-{
- char *excl;
-
- if (*line++ != ':')
- return FALSE;
-
- strcpy(nick,line);
-
- if ((excl = strchr(nick,'!')))
- *excl = '\0';
-
- return TRUE;
-
-}
-
-int cmd_generic(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target)
-{
- char *cmd;
- struct _cmds *commands = cmds;
-
- if (!argc) {
- otr_noticest(TXT_CMD_OTR);
- return TRUE;
- }
-
- cmd = argv[0];
-
- argv++;
- argv_eol++;
- argc--;
-
- do {
- if (strcmp(commands->name,cmd)==0) {
- commands->cmdfunc(ioustate,ircctx,argc,argv,argv_eol,target);
- return TRUE;
- }
- } while ((++commands)->name);
-
- return FALSE;
-}
-
-void cmd_debug(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- debug = !debug;
- otr_noticest(debug ? TXT_CMD_DEBUG_ON : TXT_CMD_DEBUG_OFF);
-}
-
-void cmd_version(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- otr_noticest(TXT_CMD_VERSION,IRCOTR_VERSION);
-}
-
-void cmd_help(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- otr_log(ircctx,target,MSGLEVEL_CRAP,otr_help);
-}
-
-void cmd_finish(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- if (argc)
- otr_finish(NULL,NULL,argv[0],TRUE);
- else if (ircctx&&target)
- otr_finish(ircctx,target,NULL,TRUE);
- else
- otr_noticest(TXT_CMD_QNOTFOUND);
-
-}
-
-void cmd_trust(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- if (argc)
- otr_trust(NULL,NULL,argv[0]);
- else if (ircctx&&target)
- otr_trust(ircctx,target,NULL);
- else
- otr_noticest(TXT_CMD_QNOTFOUND);
-}
-
-void cmd_authabort(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- if (argc)
- otr_authabort(NULL,NULL,argv[0]);
- else if (ircctx&&target)
- otr_authabort(ircctx,target,NULL);
- else
- otr_noticest(TXT_CMD_QNOTFOUND);
-}
-
-void cmd_genkey(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- if (argc) {
- if (strcmp(argv[0],"abort")==0)
- keygen_abort(ioustate,FALSE);
- else if (strchr(argv[0],'@'))
- keygen_run(ioustate,argv[0]);
- else
- otr_noticest(TXT_KG_NEEDACC);
- } else {
- otr_noticest(TXT_KG_NEEDACC);
- }
-}
-
-void cmd_auth(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- if (!argc) {
- otr_notice(ircctx,target,
- TXT_CMD_AUTH);
- } else if ((argc>1)&&strchr(argv[0],'@')) {
- otr_auth(NULL,NULL,argv[0],argv[1]);
- } else if (ircctx&&target) {
- otr_auth(ircctx,target,NULL,argv_eol[0]);
- } else {
- otr_noticest(TXT_CMD_QNOTFOUND);
- }
-}
-
-/*
- * /otr contexts
- */
-void cmd_contexts(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target) {
- struct ctxlist_ *ctxlist = otr_contexts(ioustate),*ctxnext = ctxlist;
- struct fplist_ *fplist,*fpnext;
-
- if (!ctxlist)
- otr_infost(TXT_CTX_NOCTXS);
-
- while (ctxlist) {
- otr_infost(TXT_CTX_CTX_UNENCRYPTED+ctxlist->state,
- ctxlist->username,
- ctxlist->accountname);
-
- fplist = ctxlist->fplist;
- while (fplist) {
- otr_infost(TXT_CTX_FPS_NO+fplist->authby,
- fplist->fp);
- fplist = fplist->next;
- }
- ctxlist = ctxlist->next;
- }
- while ((ctxlist = ctxnext)) {
- ctxnext = ctxlist->next;
- fpnext = ctxlist->fplist;
- while ((fplist = fpnext)) {
- fpnext = fplist->next;
- g_free(fplist->fp);
- g_free(fplist);
- }
- g_free(ctxlist);
- }
-}
-
-struct _cmds cmds[] = {
- { "version", cmd_version },
- { "debug", cmd_debug },
- { "help", cmd_help },
- { "finish", cmd_finish },
- { "trust", cmd_trust },
- { "authabort", cmd_authabort },
- { "auth", cmd_auth },
- { "genkey", cmd_genkey },
- { "contexts", cmd_contexts },
- { NULL, NULL },
- { NULL, NULL }};
-
-void io_explode_args(const char *args, char ***argvp, char ***argv_eolp, int *argcp)
-{
- char **argv, **argv_eol;
- char *s = (char*)args;
- int argc=1,i;
-
- while ((s = strchr(s+1,' ')))
- argc++;
-
- argv = (char **)malloc(sizeof(char *)*argc);
- argv_eol = (char **)malloc(sizeof(char *)*argc);
-
- s = (char*)args;
- argv_eol[0] = strdup(args);
- i = 0;
- while (++i<argc)
- argv_eol[i] = strchr(argv_eol[i-1],' ')+1;
-
- argv[0] = strtok(strdup(args)," ");
- i = 1;
- while (i<argc) {
- argv[i++] = strtok(NULL," ");
- otr_logst(MSGLEVEL_CRAP,"arg %d: %s",i,argv[i-1]);
- }
-
- *argvp = argv;
- *argv_eolp = argv_eol;
- *argcp = argc;
-}
-
-/*
- * Get a format describing the OTR status of this conversation.
- */
-int otr_getstatus_format(IRC_CTX *ircctx, const char *nick)
-{
- int status = otr_getstatus(ircctx,nick);
-
- if (status&(IO_ST_SMP_ONGOING)) {
- /* we don't care about the trust level in that case */
- status = status & IO_ST_SMP_ONGOING;
- }
-
- switch (status) {
- case IO_ST_PLAINTEXT:
- return TXT_ST_PLAINTEXT;
- case IO_ST_FINISHED:
- return TXT_ST_FINISHED;
- case IO_ST_UNTRUSTED:
- return TXT_ST_UNTRUSTED;
- case IO_ST_SMP_INCOMING:
- return TXT_ST_SMP_INCOMING;
- case IO_ST_SMP_OUTGOING:
- return TXT_ST_SMP_OUTGOING;
- case IO_ST_SMP_FINALIZE:
- return TXT_ST_SMP_FINALIZE;
- case IO_ST_TRUST_MANUAL:
- return TXT_ST_TRUST_MANUAL;
- case IO_ST_TRUST_SMP:
- return TXT_ST_TRUST_SMP;
- default:
- return TXT_ST_SMP_UNKNOWN;
- }
-}
diff --git a/irssi/CMakeLists.txt b/irssi/CMakeLists.txt
deleted file mode 100644
index b630df7..0000000
--- a/irssi/CMakeLists.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-IF(NOT IRSSI_INCLUDE_DIR)
- MESSAGE(FATAL_ERROR "*** no irssi found. If you don't want this plugin set the
- appropriate option to OFF, use for instance 'ccmake .' ***")
-ENDIF(NOT IRSSI_INCLUDE_DIR)
-
-MESSAGE(STATUS "*** building for irssi ***")
-
-SET(IRSSIOTR_INCLUDE_DIRS
- ${IRSSI_INCLUDE_DIR}/irssi
- ${IRSSI_INCLUDE_DIR}/irssi/src
- ${IRSSI_INCLUDE_DIR}/irssi/src/core
- ${PROJECT_BINARY_DIR}/irssi-headers
- ${PROJECT_SOURCE_DIR}/irssi-headers
- ${PROJECT_SOURCE_DIR}/irssi)
-
-INCLUDE_DIRECTORIES(${IRSSIOTR_INCLUDE_DIRS})
-
-SET(CMAKE_REQUIRED_INCLUDES ${IRCOTR_INCLUDE_DIRS} ${IRSSIOTR_INCLUDE_DIRS})
-
-# irssi statusbar header
-
-CHECK_INCLUDE_FILES("glib.h;common.h;fe-text/statusbar-item.h" HAVE_IRSSISBAR_H)
-
-# Bad hack
-
-IF (NOT HAVE_IRSSISBAR_H)
- MESSAGE(STATUS "Need to fetch irssi header statusbar-item.h (you don't have it yet)")
- IF (NOT WGET_EXECUTABLE)
- FIND_PACKAGE(Wget REQUIRED)
- ENDIF (NOT WGET_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND "mkdir" -p irssi-headers/fe-text)
- EXECUTE_PROCESS(COMMAND "bash" "-c"
- "${WGET_EXECUTABLE} '--post-data=revision=4936&root=irssi' \\
- 'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/statusbar-item.h' || exit 1"
- ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY irssi-headers/fe-text
- RESULT_VARIABLE IISBAR_RET)
- IF(NOT IISBAR_RET EQUAL 0)
- MESSAGE(FATAL_ERROR_ERROR "Couldn't check out irssi headers from SVN")
- ENDIF(NOT IISBAR_RET EQUAL 0)
- SET(HAVE_IRSSISBAR_H 1 CACHE INTERNAL "Having irssi headers" FORCE)
-ENDIF (NOT HAVE_IRSSISBAR_H)
-
-ADD_LIBRARY(irssiotr SHARED irssi_otr.c ../otr_util.c ../otr_ops.c ../otr_key.c ../io_util.c ${CMAKE_BINARY_DIR}/otr-formats.c)
-TARGET_LINK_LIBRARIES(irssiotr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
-SET_TARGET_PROPERTIES(irssiotr PROPERTIES
- COMPILE_FLAGS -DTARGET_IRSSI
- OUTPUT_NAME "otr"
- LINK_FLAGS "${MAIN_LDFLAGS}")
-
-add_dependencies(irssiotr otrformats)
-set_source_files_properties(${CMAKE_BINARY_DIR}/otr-formats.c PROPERTIES GENERATED TRUE)
-
-IF(APPLE)
- SET_TARGET_PROPERTIES(irssiotr PROPERTIES SUFFIX ".so")
-ENDIF(APPLE)
-
-# docdir
-
-IF(NOT DOCDIR)
- SET(DOCDIR share/doc/irssi-otr)
-ENDIF(NOT DOCDIR)
-
-IF(CMAKE_INSTALL_TYPE MATCHES "home")
- INSTALL(TARGETS irssiotr DESTINATION "$ENV{HOME}/.irssi/modules")
-ELSE(CMAKE_INSTALL_TYPE MATCHES "home")
- INSTALL(TARGETS irssiotr DESTINATION lib${LIB_SUFFIX}/irssi/modules)
- INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
-ENDIF(CMAKE_INSTALL_TYPE MATCHES "home")
diff --git a/irssi/irssi_otr.c b/irssi/irssi_otr.c
deleted file mode 100644
index 1f0df0e..0000000
--- a/irssi/irssi_otr.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) module for the irssi IRC client
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "otr.h"
-
-int debug = FALSE;
-
-static const char *signal_args_otr_event[] = {
- "iobject", "string", "string", "NULL" };
-
-#ifdef HAVE_GREGEX_H
-GRegex *regex_nickignore = NULL;
-#endif
-
-/* need this to decode arguments in perl signal handlers. Maybe irssi should
- * install perl/perl-signals.h which is where this definition comes from? */
-void perl_signal_register(const char *signal, const char **args);
-
-static IOUSTATE *ioustate;
-
-void irc_send_message(IRC_CTX *ircctx, const char *recipient, char *msg) {
- ircctx->send_message(
- ircctx,recipient,msg,GPOINTER_TO_INT(SEND_TARGET_NICK));
-}
-
-/*
- * Pipes all outgoing private messages through OTR
- */
-static void sig_server_sendmsg(SERVER_REC *server, const char *target,
- const char *msg, void *target_type_p)
-{
- if (GPOINTER_TO_INT(target_type_p)==SEND_TARGET_NICK) {
- char *otrmsg;
-
-#ifdef HAVE_GREGEX_H
- if (g_regex_match(regex_nickignore,target,0,NULL))
- return;
-#endif
- otrmsg = otr_send(server,msg,target);
- if (otrmsg&&(otrmsg!=msg)) {
- signal_continue(4,server,target,otrmsg,target_type_p);
- otrl_message_free(otrmsg);
- } else if (!otrmsg)
- signal_stop();
- }
-}
-
-/*
- * Pipes all incoming private messages through OTR
- */
-static void sig_message_private(SERVER_REC *server, const char *msg,
- const char *nick, const char *address)
-{
- char *newmsg;
-
-#ifdef HAVE_GREGEX_H
- if (g_regex_match(regex_nickignore,nick,0,NULL))
- return;
-#endif
-
- newmsg = otr_receive(server,msg,nick);
-
- if (newmsg&&(newmsg!=msg)) {
- signal_continue(4,server,newmsg,nick,address);
- otrl_message_free(newmsg);
- } else if (newmsg==NULL)
- signal_stop();
-}
-
-/*
- * Finish an OTR conversation when its query is closed.
- */
-static void sig_query_destroyed(QUERY_REC *query) {
- if (query&&query->server&&query->server->connrec) {
- otr_finish(query->server,query->name,NULL,FALSE);
- }
-}
-
-/*
- * /otr
- */
-static void cmd_otr(const char *data,void *server,WI_ITEM_REC *item)
-{
- char **argv, **argv_eol;
- int argc;
- QUERY_REC *query = QUERY(item);
-
- if (*data == '\0') {
- otr_noticest(TXT_CMD_OTR);
- return;
- }
-
- io_explode_args(data,&argv,&argv_eol,&argc);
-
- if (query&&query->server&&query->server->connrec) {
- cmd_generic(ioustate,query->server,argc,argv,argv_eol,query->name);
- } else {
- cmd_generic(ioustate,NULL,argc,argv,argv_eol,NULL);
- }
-
- statusbar_items_redraw("otr");
-
- g_free(argv_eol[0]);
- g_free(argv_eol);
- g_free(argv);
-}
-
-/*
- * Optionally finish conversations on /quit. We're already doing this on unload
- * but the quit handler terminates irc connections before unloading.
- */
-static void cmd_quit(const char *data, void *server, WI_ITEM_REC *item)
-{
- if (settings_get_bool("otr_finishonunload"))
- otr_finishall(ioustate);
-}
-
-/*
- * otr statusbar
- */
-static void otr_statusbar(struct SBAR_ITEM_REC *item, int get_size_only)
-{
- WI_ITEM_REC *wi = active_win->active;
- QUERY_REC *query = QUERY(wi);
- int formatnum=0;
-
- if (query&&query->server&&query->server->connrec)
- formatnum = otr_getstatus_format(query->server,query->name);
-
- statusbar_item_default_handler(
- item,
- get_size_only,
- formatnum ? formats[formatnum].def : ""," ",FALSE);
-}
-
-void otr_query_create(SERVER_REC *server, const char *nick)
-{
- if (!server||!nick||
- !settings_get_bool("otr_createqueries")||
- query_find(server, nick))
- return;
-
- irc_query_create(server->tag, nick, TRUE);
-}
-
-static void read_settings(void)
-{
- otr_setpolicies(ioustate,settings_get_str("otr_policy"),FALSE);
- otr_setpolicies(ioustate,settings_get_str("otr_policy_known"),TRUE);
-#ifdef HAVE_GREGEX_H
- if (regex_nickignore)
- g_regex_unref(regex_nickignore);
- regex_nickignore = g_regex_new(settings_get_str("otr_ignore"),0,0,NULL);
-#endif
-
-}
-
-void otr_status_change(IRC_CTX *ircctx, const char *nick, int event)
-{
- statusbar_items_redraw("otr");
- signal_emit("otr event",3,ircctx,nick,otr_status_txt[event]);
-}
-
-/*
- * irssi init()
- */
-void otr_init(void)
-{
- module_register(MODULE_NAME, "core");
-
- theme_register(formats);
-
- if (otrlib_init())
- return;
-
- ioustate = otr_init_user("one to rule them all");
-
- signal_add_first("server sendmsg", (SIGNAL_FUNC) sig_server_sendmsg);
- signal_add_first("message private", (SIGNAL_FUNC) sig_message_private);
- signal_add("query destroyed", (SIGNAL_FUNC) sig_query_destroyed);
-
- command_bind("otr", NULL, (SIGNAL_FUNC) cmd_otr);
-
- command_bind_first("quit", NULL, (SIGNAL_FUNC) cmd_quit);
-
- settings_add_str("otr", "otr_policy",IO_DEFAULT_POLICY);
- settings_add_str("otr", "otr_policy_known",IO_DEFAULT_POLICY_KNOWN);
- settings_add_str("otr", "otr_ignore",IO_DEFAULT_IGNORE);
- settings_add_bool("otr", "otr_finishonunload",TRUE);
- settings_add_bool("otr", "otr_createqueries",TRUE);
- read_settings();
- signal_add("setup changed", (SIGNAL_FUNC) read_settings);
-
- statusbar_item_register("otr", NULL, otr_statusbar);
-
- statusbar_items_redraw("window");
-
- perl_signal_register("otr event",signal_args_otr_event);
-}
-
-/*
- * irssi deinit()
- */
-void otr_deinit(void)
-{
-#ifdef HAVE_GREGEX_H
- g_regex_unref(regex_nickignore);
-#endif
-
- signal_remove("server sendmsg", (SIGNAL_FUNC) sig_server_sendmsg);
- signal_remove("message private", (SIGNAL_FUNC) sig_message_private);
- signal_remove("query destroyed", (SIGNAL_FUNC) sig_query_destroyed);
-
- command_unbind("otr", (SIGNAL_FUNC) cmd_otr);
-
- command_unbind("quit", (SIGNAL_FUNC) cmd_quit);
-
- signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
-
- statusbar_item_unregister("otr");
-
- if (settings_get_bool("otr_finishonunload"))
- otr_finishall(ioustate);
-
- otr_deinit_user(ioustate);
-
- otrlib_deinit();
-
- theme_unregister();
-}
-
-IRC_CTX *ircctx_by_peername(const char *peername, char *nick)
-{
- GSList *tmp;
- char pname[256];
- char *address;
-
- strcpy(pname,peername);
-
- address = strchr(pname,'@');
-
- if (!address)
- return NULL;
-
- *address = '\0';
- strcpy(nick,pname);
- *address++ = '@';
-
- for (tmp = servers; tmp != NULL; tmp = tmp->next) {
- SERVER_REC *server = tmp->data;
-
- if (g_strcasecmp(server->connrec->address, address) == 0)
- return server;
- }
-
- return NULL;
-}
-
-char *lvlstring[] = {
- "NOTICE",
- "DEBUG"
-};
-
-
-void otr_log(IRC_CTX *server, const char *nick,
- int level, const char *format, ...) {
- va_list params;
- va_start( params, format );
- char msg[LOGMAX], *s = msg;
-
- if ((level==LVL_DEBUG)&&!debug)
- return;
-
- s += sprintf(s,"%s","%9OTR%9");
-
- if (level!=LVL_NOTICE)
- s += sprintf(s,"(%s)",lvlstring[level]);
-
- s += sprintf(s,": ");
-
- if( vsnprintf( s, LOGMAX, format, params ) < 0 )
- sprintf( s, "internal error parsing error string (BUG)" );
- va_end( params );
-
- printtext(server, nick, MSGLEVEL_MSGS, msg);
-}
diff --git a/irssi/irssi_otr.h b/irssi/irssi_otr.h
deleted file mode 100644
index 6b0eb5b..0000000
--- a/irssi/irssi_otr.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) module for the irssi IRC client
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include <common.h>
-#include <core/commands.h>
-#include <core/modules.h>
-#include <core/servers.h>
-#include <core/signals.h>
-#include <core/levels.h>
-#include <core/queries.h>
-#include <fe-common/core/printtext.h>
-#include <fe-common/core/fe-windows.h>
-#include <fe-common/core/module-formats.h>
-#include <core/modules.h>
-#include <core/settings.h>
-#include <irc/core/irc.h>
-#include <irc/core/irc-queries.h>
-
-#include <fe-text/statusbar-item.h>
-
-#define IRC_CTX SERVER_REC
-
-#define get_client_config_dir get_irssi_dir
-
-static IRC_CTX *IRCCTX_DUP(IRC_CTX *ircctx) __attribute__ ((unused));
-
-static IRC_CTX *IRCCTX_DUP(IRC_CTX *ircctx) {
- server_ref(ircctx);
- return ircctx;
-}
-
-static IRC_CTX *IRCCTX_FREE(IRC_CTX *ircctx) __attribute__ ((unused));
-
-static IRC_CTX *IRCCTX_FREE(IRC_CTX *ircctx)
-{
- server_unref(ircctx);
- return ircctx;
-}
-
-void otr_query_create(IRC_CTX *ircctx, const char *nick);
-
-#define IRCCTX_ADDR(ircctx) ircctx->connrec->address
-#define IRCCTX_NICK(ircctx) ircctx->nick
-#define IRCCTX_ACCNAME(accname,ircctx) sprintf(accname, "%s@%s", ircctx->nick, ircctx->connrec->address)
-#define IRCCTX_IO_US(ircctx) (&ioustate_uniq)
-#define IO_CREATE_US(user) (&ioustate_uniq)
-
-#define otr_noticest(formatnum,...) \
- printformat(NULL,NULL,MSGLEVEL_MSGS, formatnum, ## __VA_ARGS__)
-
-#define otr_notice(ircctx,nick,formatnum,...) { \
- otr_query_create(ircctx,nick); \
- printformat(ircctx,nick,MSGLEVEL_MSGS, formatnum, ## __VA_ARGS__);}
-
-#define otr_infost(formatnum,...) \
- printformat(NULL,NULL,MSGLEVEL_CRAP, formatnum, ## __VA_ARGS__)
-
-#define otr_info(server,nick,formatnum,...) { \
- otr_query_create(ircctx,nick); \
- printformat(ircctx,nick,MSGLEVEL_CRAP, formatnum, ## __VA_ARGS__);}
-
-#define otr_debug(ircctx,nick,formatnum,...) { \
- if (debug) { \
- otr_query_create(ircctx,nick); \
- printformat(ircctx,nick,MSGLEVEL_MSGS, formatnum, ## __VA_ARGS__); } }
diff --git a/makeformats.py b/makeformats.py
deleted file mode 100755
index 40a8706..0000000
--- a/makeformats.py
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/bin/python
-#
-# Uli Meis <a.sporto+bee at gmail.com>
-#
-# Just a short script to generate our FORMAT_REC
-#
-
-import sys,os,re
-
-lines = map(lambda x: x.strip(),open(sys.argv[1],"r").readlines())
-
-hdr = open("otr-formats.h","w")
-src = open("otr-formats.c","w")
-srcx = open("xchat-formats.c","w")
-
-src.write('#include "otr.h"\n');
-srcx.write('#include "otr.h"\n');
-
-src.write("""char *otr_help = "%s";\n""" % "\\n".join(
- ["%9- OTR help -%9"]+
- [re.sub('^(/otr.*)$','%_\\1%_',
- re.sub('^(otr_[a-z_]*)$','%_\\1%_',
- re.sub('"([^"]*)"','\\"%_\\1%_\\"',
- x.replace('\n','').replace("\t"," ")
- )))
- for x in open(sys.argv[2],"r").readlines()]
- +["%9- End of OTR help -%9"]
- ))
-
-srcx.write("""char *otr_help = "%s";\n""" % "\\n".join(
- ["- OTR help -"]+
- [re.sub('"([^"]*)"','\\"\\1\\"',
- x.replace('\n','').replace("\t"," ") )
- for x in open(sys.argv[2],"r").readlines()]
- +["- End of OTR help -"]
- ))
-
-src.write('FORMAT_REC formats[] = {\n')
-srcx.write('FORMAT_REC formats[] = {\n')
-
-src.write('{ MODULE_NAME, "otr", 0}\n')
-srcx.write('{ MODULE_NAME, "otr", 0}\n')
-
-hdr.write("extern char *otr_help;\n\n");
-
-hdr.write("enum {\n")
-
-hdr.write("TXT_OTR_MODULE_NAME")
-
-fills = 0
-
-section = None
-
-for line in lines:
- src.write(",\n")
- srcx.write(",\n")
-
- e = line.split("\t")
-
- if len(e)==1:
- # Section name
- section = e[0]
- src.write("""{ NULL, "%s", 0 }\n""" % (e[0]))
- srcx.write("""{ NULL, "%s", 0 }\n""" % (e[0]))
-
- hdr.write(",\nTXT_OTR_FILL_%d" % fills)
-
- fills += 1
-
- continue
-
- params = []
- fo = e[1]
- new = ""
- last=0
- i=0
- srcx.write("""{ "%s", "%s", 0""" % (e[0],fo.replace("%%9","").replace("%9","").replace("%g","").replace("%n","")))
- for m in re.finditer("(^|[^%])%([0-9]*)[ds]",fo):
- if m.group()[-1]=='d':
- params += ['1']
- else:
- params += ['0']
- new += fo[last:m.start()+len(m.group(1))].replace('%%','%')+"$"
- if m.group(2): new+= "[%s]" % m.group(2)
- new += "%d" % i
- last = m.end()
- i += 1
-
- new += fo[last:].replace('%%','%')
-
- e[1] = new
- e += [len(params)] + params
-
- #print "Handling line %s with elen %d" % (line,len(e))
-
- premsg = ""
- if e[1][0] != "{" and section!="Nickignore" and section!="Contexts":
- premsg = "%9OTR%9: "
-
- src.write("""{ "%s", "%s%s", %s""" % (e[0],premsg,e[1],e[2]))
-
- if len(params)>0:
- src.write(", { %s }" % ", ".join(params))
-
- src.write("}")
- srcx.write("}")
-
- hdr.write(",\n")
-
- hdr.write("TXT_%s" % e[0].upper())
-
-hdr.write("""
-};
-
-extern FORMAT_REC formats[];
-""")
-
-src.write(""",
-{ NULL, NULL, 0 }
-};
-""")
-
-srcx.write(""",
-{ NULL, NULL, 0 }
-};
-""")
-
-hdr.close()
-src.close()
-srcx.close()
diff --git a/mksrcpackage.sh b/mksrcpackage.sh
deleted file mode 100755
index 7d75cbc..0000000
--- a/mksrcpackage.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-if [ -z "$2" ]; then echo "Syntax: $0 <src-dir> <git-commit/tag>"; exit 1;fi
-SDIR="$1"
-VER=$2
-
-PKG=irc-otr-$VER.tar
-HDIR=irc-otr-$VER
-mkdir "$HDIR" &&\
-(cd "$HDIR" && ln -s ../irssi-headers &&\
- echo -e "SET(IRCOTR_VERSION $VER)" >tarballdefs.cmake) &&\
- for plugin in irc xchat irssi; do
- pkg=$plugin-otr-$VER
- (cd "$SDIR" && git archive --format=tar --prefix=$pkg/ HEAD )>$pkg.tar &&\
- tar rhf $pkg.tar "$HDIR"
- gzip $pkg.tar
- done && rm $HDIR/{irssi-headers,tarballdefs.cmake} &&\
-rmdir $HDIR
diff --git a/otr.h b/otr.h
deleted file mode 100644
index d6041f5..0000000
--- a/otr.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-/* OTR */
-
-#include <libotr/proto.h>
-#include <libotr/context.h>
-#include <libotr/message.h>
-#include <libotr/privkey.h>
-
-/* glib */
-
-#include <glib.h>
-#include <glib/gprintf.h>
-#include <glib/gstdio.h>
-
-/* user state */
-
-typedef struct {
- OtrlUserState otr_state;
- GSList *plistunknown;
- GSList *plistknown;
-} IOUSTATE;
-
-#ifndef TARGET_BITLBEE
-/* there can be only one */
-extern IOUSTATE ioustate_uniq;
-#endif
-
-/* irssi */
-
-#ifdef TARGET_IRSSI
-#include <irssi/irssi_otr.h>
-#endif
-
-/* xchat */
-
-#ifdef TARGET_XCHAT
-#include <xchat/xchat_otr.h>
-#endif
-
-/* weechat */
-
-#ifdef TARGET_WEECHAT
-#include <weechat/weechat_otr.h>
-#endif
-
-/* bitlbee */
-
-#ifdef TARGET_BITLBEE
-#include <bitlbee/bitlbee_otr.h>
-#endif
-
-/* log stuff */
-
-#define LOGMAX 1024
-
-#define LVL_NOTICE 0
-#define LVL_DEBUG 1
-
-#define otr_logst(level,format,...) \
- otr_log(NULL,NULL,level,format, ## __VA_ARGS__)
-
-void otr_log(IRC_CTX *server, const char *to,
- int level, const char *format, ...);
-
-/* own */
-
-#include "io-config.h"
-
-/* irssi module name */
-#define MODULE_NAME "otr"
-
-#include "otr-formats.h"
-
-/*
- * maybe this should be configurable?
- * I believe bitlbee has something >500.
- */
-#define OTR_MAX_MSG_SIZE 400
-
-/* otr protocol id */
-#define PROTOCOLID "IRC"
-
-#define KEYFILE "/otr/otr.key"
-#define TMPKEYFILE "/otr/otr.key.tmp"
-#define FPSFILE "/otr/otr.fp"
-
-/* some defaults */
-#define IO_DEFAULT_POLICY "*@localhost opportunistic,*bitlbee* opportunistic,*@im.* opportunistic, *serv at irc* never"
-#define IO_DEFAULT_POLICY_KNOWN "* always"
-#define IO_DEFAULT_IGNORE "xmlconsole[0-9]*"
-
-/* one for each OTR context (=communication pair) */
-struct co_info {
- char *msgqueue; /* holds partially reconstructed base64
- messages */
- IRC_CTX *ircctx; /* irssi server object for this peer */
- int received_smp_init; /* received SMP init msg */
- int smp_failed; /* last SMP failed */
- char better_msg_two[256]; /* what the second line of the "better"
- default query msg should like. Eat it
- up when it comes in */
- int finished; /* true after you've /otr finished */
-};
-
-/* these are returned by /otr contexts */
-
-struct fplist_ {
- char *fp;
- enum { NOAUTH,AUTHSMP,AUTHMAN } authby;
- struct fplist_ *next;
-};
-
-struct ctxlist_ {
- char *username;
- char *accountname;
- enum { STUNENCRYPTED,STENCRYPTED,STFINISHED,STUNKNOWN } state;
- struct fplist_ *fplist;
- struct ctxlist_ *next;
-};
-
-/* returned by otr_getstatus */
-enum {
- IO_ST_PLAINTEXT,
- IO_ST_FINISHED,
- IO_ST_SMP_INCOMING,
- IO_ST_SMP_OUTGOING,
- IO_ST_SMP_FINALIZE,
- IO_ST_UNKNOWN,
- IO_ST_UNTRUSTED=32,
- IO_ST_TRUST_MANUAL=64,
- IO_ST_TRUST_SMP=128,
- IO_ST_SMP_ONGOING=
- IO_ST_SMP_INCOMING|IO_ST_SMP_OUTGOING|IO_ST_SMP_FINALIZE
-};
-
-/* given to otr_status_change */
-enum {
- IO_STC_FINISHED,
- IO_STC_TRUST_MANUAL,
- IO_STC_TRUST_SMP,
- IO_STC_SMP_ABORT,
- IO_STC_SMP_STARTED,
- IO_STC_SMP_RESPONDED,
- IO_STC_SMP_INCOMING,
- IO_STC_SMP_FINALIZE,
- IO_STC_SMP_ABORTED,
- IO_STC_PEER_FINISHED,
- IO_STC_SMP_FAILED,
- IO_STC_SMP_SUCCESS,
- IO_STC_GONE_SECURE,
- IO_STC_GONE_INSECURE,
- IO_STC_CTX_UPDATE
-};
-
-/* the above as text for scripting */
-extern char *otr_status_txt[];
-
-/* policy list generated from /set otr_policy */
-
-struct plistentry {
- GPatternSpec *namepat;
- OtrlPolicy policy;
-};
-
-/* used by the logging functions below */
-extern int debug;
-
-void irc_send_message(IRC_CTX *ircctx, const char *recipient, char *msg);
-void otr_status_change(IRC_CTX *ircctx, const char *nick, int event);
-IRC_CTX *ircctx_by_peername(const char *peername, char *nick);
-
-/* init stuff */
-
-int otrlib_init();
-void otrlib_deinit();
-void otr_initops();
-void otr_setpolicies(IOUSTATE *ioustate, const char *policies, int known);
-IOUSTATE *otr_init_user(char *user);
-void otr_deinit_user(IOUSTATE *ioustate);
-
-/* basic send/receive/status stuff */
-
-char *otr_send(IRC_CTX *server,const char *msg,const char *to);
-char *otr_receive(IRC_CTX *server,const char *msg,const char *from);
-int otr_getstatus(IRC_CTX *ircctx, const char *nick);
-ConnContext *otr_getcontext(const char *accname,const char *nick,int create,IRC_CTX *ircctx);
-
-/* user interaction */
-
-void otr_trust(IRC_CTX *server, char *nick, const char *peername);
-void otr_finish(IRC_CTX *server, char *nick, const char *peername, int inquery);
-void otr_auth(IRC_CTX *server, char *nick, const char *peername, const char *secret);
-void otr_authabort(IRC_CTX *server, char *nick, const char *peername);
-struct ctxlist_ *otr_contexts(IOUSTATE *ioustate);
-void otr_finishall(IOUSTATE *ioustate);
-
-
-/* key/fingerprint stuff */
-
-void keygen_run(IOUSTATE *ioustate, const char *accname);
-void keygen_abort(IOUSTATE *ioustate,int ignoreidle);
-void key_load(IOUSTATE *ioustate);
-void fps_load(IOUSTATE *ioustate);
-void otr_writefps(IOUSTATE *ioustate);
-
-int extract_nick(char *nick, char *line);
-
-struct _cmds {
- char *name;
- void (*cmdfunc)(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[], char *target);
-};
-
-/* see io_util.c */
-#define CMDCOUNT 9
-extern struct _cmds cmds[];
-
-int cmd_generic(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
- char *target);
-int otr_getstatus_format(IRC_CTX *ircctx, const char *nick);
-
-void io_explode_args(const char *args, char ***argvp, char ***argv_eolp, int *argcp);
diff --git a/otr_key.c b/otr_key.c
deleted file mode 100644
index 416320f..0000000
--- a/otr_key.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#define _GNU_SOURCE
-
-#include "otr.h"
-
-#include <libgen.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/poll.h>
-#include <signal.h>
-
-typedef enum { KEYGEN_NO, KEYGEN_RUNNING } keygen_status_t;
-
-struct {
- keygen_status_t status;
- char *accountname;
- char *protocol;
- time_t started;
- GIOChannel *ch[2];
- guint cpid;
- guint cwid;
- pid_t pid;
- IOUSTATE *ioustate;
-} kg_st = {.status = KEYGEN_NO };
-
-void keygen_childwatch(GPid pid,gint status, gpointer data) {
- struct pollfd pfd = {
- .fd = g_io_channel_unix_get_fd(kg_st.ch[0]),
- .events = POLLIN };
- int ret;
-
- /* nothing to do if keygen_complete has already been called */
- if (data)
- return;
-
- kg_st.pid = 0;
-
- ret = poll(&pfd,1,0);
-
- /* data is there, let's wait for keygen_complete to be called */
- if (ret == 1)
- return;
-
- /* no data, report error and reset kg_st */
- if (ret==0) {
- if (WIFSIGNALED(status)) {
- char sigstr[16];
-
- sprintf(sigstr,
-#ifndef HAVE_STRSIGNAL
- "%d",WTERMSIG(status));
-#else
- "%s",strsignal(WTERMSIG(status)));
-#endif
- otr_noticest(TXT_KG_EXITSIG,
- kg_st.accountname,
- sigstr);
- }
- else
- otr_noticest(TXT_KG_EXITED,kg_st.accountname);
- } else if (ret==-1)
- otr_noticest(TXT_KG_POLLERR,kg_st.accountname,strerror(errno));
-
- keygen_abort(kg_st.ioustate,FALSE);
-}
-
-/*
- * Installed as g_io_watch and called when the key generation
- * process finishs.
- */
-gboolean keygen_complete(GIOChannel *source, GIOCondition condition,
- gpointer data)
-{
- gcry_error_t err;
- const char *clconfdir = get_client_config_dir();
- char *filename = g_strconcat(clconfdir,KEYFILE,NULL);
- char *tmpfilename = g_strconcat(clconfdir,TMPKEYFILE,NULL);
-
- read(g_io_channel_unix_get_fd(kg_st.ch[0]),&err,sizeof(err));
-
- g_source_remove(kg_st.cpid);
- g_io_channel_shutdown(kg_st.ch[0],FALSE,NULL);
- g_io_channel_shutdown(kg_st.ch[1],FALSE,NULL);
- g_io_channel_unref(kg_st.ch[0]);
- g_io_channel_unref(kg_st.ch[1]);
-
- if (err)
- otr_noticest(TXT_KG_FAILED,
- kg_st.accountname,
- gcry_strerror(err),
- gcry_strsource(err));
- else {
- /* reload keys */
- otr_noticest(TXT_KG_COMPLETED,
- kg_st.accountname,
- time(NULL)-kg_st.started);
- rename(tmpfilename,filename);
- //otrl_privkey_forget_all(otr_state); <-- done by lib
- key_load(kg_st.ioustate);
- }
-
- g_source_remove(kg_st.cwid);
- kg_st.cwid = g_child_watch_add(kg_st.pid,keygen_childwatch,(void*)1);
-
- kg_st.status = KEYGEN_NO;
- g_free(kg_st.accountname);
-
- g_free(filename);
- g_free(tmpfilename);
-
- return FALSE;
-}
-
-/*
- * Run key generation in a seperate process (takes ages).
- * The other process will rewrite the key file, we shouldn't
- * change anything till it's done and we've reloaded the keys.
- */
-void keygen_run(IOUSTATE *ioustate, const char *accname)
-{
- gcry_error_t err;
- int ret;
- int fds[2];
- char *filename = g_strconcat(get_client_config_dir(),TMPKEYFILE,NULL);
- char *filenamedup = g_strdup(filename);
- char *dir = dirname(filenamedup);
-
- if (kg_st.status!=KEYGEN_NO) {
- if (strcmp(accname,kg_st.accountname)!=0)
- otr_noticest(TXT_KG_ABORTED_DUP,
- accname,kg_st.accountname);
- return;
- }
-
- if (!g_file_test(dir, G_FILE_TEST_EXISTS)) {
- if (g_mkdir(dir,S_IRWXU)) {
- otr_noticest(TXT_KG_ABORTED_DIR,
- accname,dir,strerror(errno));
- g_free(filenamedup);
- g_free(filename);
- return;
- } else
- otr_noticest(TXT_KG_MKDIR,dir);
- }
- g_free(filenamedup);
-
- if (pipe(fds) != 0) {
- otr_noticest(TXT_KG_PIPE,
- accname,strerror(errno));
- g_free(filename);
- return;
- }
-
- kg_st.ch[0] = g_io_channel_unix_new(fds[0]);
- kg_st.ch[1] = g_io_channel_unix_new(fds[1]);
-
- kg_st.accountname = g_strdup(accname);
- kg_st.ioustate = ioustate;
- kg_st.protocol = PROTOCOLID;
- kg_st.started = time(NULL);
-
- if ((ret = fork())) {
- g_free(filename);
- if (ret==-1) {
- otr_noticest(TXT_KG_FORK,
- accname,strerror(errno));
- return;
- }
-
- kg_st.status = KEYGEN_RUNNING;
- kg_st.pid = ret;
-
- otr_noticest(TXT_KG_INITIATED,
- accname);
-
- kg_st.cpid = g_io_add_watch(kg_st.ch[0], G_IO_IN,
- (GIOFunc) keygen_complete, NULL);
- kg_st.cwid = g_child_watch_add(kg_st.pid,keygen_childwatch,NULL);
-
- kg_st.started = time(NULL);
- return;
- }
-
- /* child */
-
- err = otrl_privkey_generate(ioustate->otr_state,filename,accname,PROTOCOLID);
- write(fds[1],&err,sizeof(err));
-
- //g_free(filename);
- _exit(0);
-}
-
-/*
- * Abort ongoing key generation.
- */
-void keygen_abort(IOUSTATE *ioustate,int ignoreidle)
-{
- if (kg_st.status!=KEYGEN_RUNNING) {
- if (!ignoreidle)
- otr_noticest(TXT_KG_NOABORT);
- return;
- }
-
- otr_noticest(TXT_KG_ABORT,kg_st.accountname);
-
- g_source_remove(kg_st.cpid);
- g_source_remove(kg_st.cwid);
- g_free(kg_st.accountname);
-
- if (kg_st.pid!=0) {
- kill(kg_st.pid,SIGTERM);
- g_child_watch_add(kg_st.pid,keygen_childwatch,(void*)1);
- }
-
- kg_st.status = KEYGEN_NO;
-}
-
-/*
- * Write fingerprints to file.
- */
-void otr_writefps(IOUSTATE *ioustate)
-{
- gcry_error_t err;
- char *filename = g_strconcat(get_client_config_dir(),FPSFILE,NULL);
-
- err = otrl_privkey_write_fingerprints(ioustate->otr_state,filename);
-
- if (err == GPG_ERR_NO_ERROR) {
- otr_noticest(TXT_FP_SAVED);
- } else {
- otr_noticest(TXT_FP_SAVE_ERROR,
- gcry_strerror(err),
- gcry_strsource(err));
- }
- g_free(filename);
-}
-
-/*
- * Load private keys.
- */
-void key_load(IOUSTATE *ioustate)
-{
- gcry_error_t err;
- char *filename = g_strconcat(get_client_config_dir(),KEYFILE,NULL);
-
- if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
- otr_noticest(TXT_KEY_NOT_FOUND);
- return;
- }
-
- err = otrl_privkey_read(ioustate->otr_state, filename);
-
- if (err == GPG_ERR_NO_ERROR) {
- otr_noticest(TXT_KEY_LOADED);
- } else {
- otr_noticest(TXT_KEY_LOAD_ERROR,
- gcry_strerror(err),
- gcry_strsource(err));
- }
- g_free(filename);
-}
-
-/*
- * Load fingerprints.
- */
-void fps_load(IOUSTATE *ioustate)
-{
- gcry_error_t err;
- char *filename = g_strconcat(get_client_config_dir(),FPSFILE,NULL);
-
- if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
- otr_noticest(TXT_FP_NOT_FOUND);
- return;
- }
-
- err = otrl_privkey_read_fingerprints(ioustate->otr_state,filename,NULL,NULL);
-
- if (err == GPG_ERR_NO_ERROR) {
- otr_noticest(TXT_FP_LOADED);
- } else {
- otr_noticest(TXT_FP_LOAD_ERROR,
- gcry_strerror(err),
- gcry_strsource(err));
- }
- g_free(filename);
-}
-
diff --git a/otr_ops.c b/otr_ops.c
deleted file mode 100644
index df7d24b..0000000
--- a/otr_ops.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "otr.h"
-
-OtrlMessageAppOps otr_ops;
-
-OtrlPolicy IO_DEFAULT_OTR_POLICY =
- OTRL_POLICY_MANUAL|OTRL_POLICY_WHITESPACE_START_AKE;
-
-/*
- * Return policy for given context based on the otr_policy /setting
- */
-OtrlPolicy ops_policy(void *opdata, ConnContext *context)
-{
- struct co_info *coi = context->app_data;
- char *server = strchr(context->accountname,'@')+1;
- OtrlPolicy op = IO_DEFAULT_OTR_POLICY;
- GSList *pl;
- char fullname[1024];
- IOUSTATE *ioustate = IRCCTX_IO_US(coi->ircctx);
-
- sprintf(fullname, "%s@%s", context->username, server);
-
- /* loop through otr_policy */
-
- if (ioustate->plistunknown) {
- pl = ioustate->plistunknown;
- do {
- struct plistentry *ple = pl->data;
-
- if (g_pattern_match_string(ple->namepat,fullname))
- op = ple->policy;
-
- } while ((pl = g_slist_next(pl)));
- }
-
- if (ioustate->plistknown&&context->fingerprint_root.next) {
- pl = ioustate->plistknown;
-
- /* loop through otr_policy_known */
-
- do {
- struct plistentry *ple = pl->data;
-
- if (g_pattern_match_string(ple->namepat,fullname))
- op = ple->policy;
-
- } while ((pl = g_slist_next(pl)));
- }
-
- if (coi && coi->finished &&
- (op == OTRL_POLICY_OPPORTUNISTIC ||
- op == OTRL_POLICY_ALWAYS))
- op = OTRL_POLICY_MANUAL|OTRL_POLICY_WHITESPACE_START_AKE;
- return op;
-}
-
-/*
- * Request for key generation.
- * The lib actually expects us to be finished before the call returns.
- * Since this can take more than an hour on some systems there isn't even
- * a point in trying...
- */
-void ops_create_privkey(void *opdata, const char *accountname,
- const char *protocol)
-{
- IRC_CTX *ircctx __attribute__((unused)) = opdata;
-
- keygen_run(IRCCTX_IO_US(ircctx),accountname);
-}
-
-/*
- * Inject OTR message.
- * Deriving the server is currently a hack,
- * need to derive the server from accountname.
- */
-void ops_inject_msg(void *opdata, const char *accountname,
- const char *protocol, const char *recipient, const char *message)
-{
- IRC_CTX *a_serv;
- char *msgcopy = g_strdup(message);
-
- /* OTR sometimes gives us multiple lines
- * (e.g. the default query (a.k.a. "better") message) */
- g_strdelimit (msgcopy,"\n",' ');
- a_serv = opdata;
- if (!a_serv) {
- otr_notice(a_serv,recipient,TXT_OPS_INJECT,
- accountname,recipient,message);
- } else {
- irc_send_message(a_serv, recipient, msgcopy);
- }
- g_free(msgcopy);
-}
-
-/*
- * OTR notification. Haven't seen one yet.
- */
-void ops_notify(void *opdata, OtrlNotifyLevel level, const char *accountname,
- const char *protocol, const char *username,
- const char *title, const char *primary,
- const char *secondary)
-{
- ConnContext *co = otr_getcontext(accountname,username,FALSE,NULL);
- IRC_CTX *server = opdata;
- struct co_info *coi;
- if (co) {
- coi = co->app_data;
- server = coi->ircctx;
- } else
- otr_notice(server,username,TXT_OPS_NOTIFY_BUG);
-
- otr_notice(server,username,TXT_OPS_NOTIFY,
- title,primary,secondary);
-}
-
-#ifdef HAVE_GREGEX_H
-
-/* This is kind of messy. */
-const char *convert_otr_msg(const char *msg)
-{
- GRegex *regex_bold = g_regex_new("</?i([ /][^>]*)?>",0,0,NULL);
- GRegex *regex_del = g_regex_new("</?b([ /][^>]*)?>",0,0,NULL);
- gchar *msgnohtml =
- g_regex_replace_literal(regex_del,msg,-1,0,"",0,NULL);
-
- msg = g_regex_replace_literal(regex_bold,msgnohtml,-1,0,"*",0,NULL);
-
- g_free(msgnohtml);
- g_regex_unref(regex_del);
- g_regex_unref(regex_bold);
-
- return msg;
-}
-
-#endif
-
-/*
- * OTR message. E.g. "following has been transmitted in clear: ...".
- * We're trying to kill the ugly HTML.
- */
-int ops_display_msg(void *opdata, const char *accountname,
- const char *protocol, const char *username,
- const char *msg)
-{
- ConnContext *co = otr_getcontext(accountname,username,FALSE,opdata);
- IRC_CTX *server = opdata;
- struct co_info *coi;
-
- if (co) {
- coi = co->app_data;
- server = coi->ircctx;
- } else
- otr_notice(server,username,TXT_OPS_DISPLAY_BUG);
-
-#ifdef HAVE_GREGEX_H
- msg = convert_otr_msg(msg);
- otr_notice(server,username,TXT_OPS_DISPLAY,msg);
- g_free((char*)msg);
-#else
- otr_notice(server,username,TXT_OPS_DISPLAY,msg);
-#endif
-
- return 0;
-}
-
-/*
- * Gone secure.
- */
-void ops_secure(void *opdata, ConnContext *context)
-{
- struct co_info *coi = context->app_data;
- char * trust = context->active_fingerprint->trust ? : "";
- char ownfp[45],peerfp[45];
-
- otr_notice(coi->ircctx,
- context->username,TXT_OPS_SEC);
- otr_status_change(coi->ircctx,context->username,IO_STC_GONE_SECURE);
- if (*trust!='\0')
- return;
-
- /* not authenticated.
- * Let's print out the fingerprints for comparison */
-
- otrl_privkey_hash_to_human(peerfp,
- context->active_fingerprint->fingerprint);
-
- otr_notice(coi->ircctx,context->username,TXT_OPS_FPCOMP,
- otrl_privkey_fingerprint(IRCCTX_IO_US(coi->ircctx)->otr_state,
- ownfp,
- context->accountname,
- PROTOCOLID),
- context->username,
- peerfp);
-}
-
-/*
- * Gone insecure.
- */
-void ops_insecure(void *opdata, ConnContext *context)
-{
- struct co_info *coi = context->app_data;
- otr_notice(coi->ircctx,
- context->username,TXT_OPS_INSEC);
- otr_status_change(coi->ircctx,context->username,IO_STC_GONE_INSECURE);
-}
-
-/*
- * Still secure? Need to find out what that means...
- */
-void ops_still_secure(void *opdata, ConnContext *context, int is_reply)
-{
- struct co_info *coi = context->app_data;
- otr_notice(coi->ircctx,
- context->username,is_reply ?
- TXT_OPS_STILL_REPLY :
- TXT_OPS_STILL_NO_REPLY);
-}
-
-/*
- * OTR log message. IIRC heartbeats are of this category.
- */
-void ops_log(void *opdata, const char *message)
-{
- otr_infost(TXT_OPS_LOG,message);
-}
-
-/*
- * Really critical with IRC.
- * Unfortunately, we can't tell our peer which size to use.
- * (reminds me of MTU determination...)
- */
-int ops_max_msg(void *opdata, ConnContext *context)
-{
- return OTR_MAX_MSG_SIZE;
-}
-
-/*
- * A context changed.
- * I believe this is not happening for the SMP expects.
- */
-void ops_up_ctx_list(void *opdata)
-{
- otr_status_change(opdata,NULL,IO_STC_CTX_UPDATE);
-}
-
-/*
- * Save fingerprint changes.
- */
-void ops_writefps(void *data)
-{
- IRC_CTX *ircctx __attribute__((unused)) = data;
-
- otr_writefps(IRCCTX_IO_US(ircctx));
-}
-
-int ops_is_logged_in(void *opdata, const char *accountname,
- const char *protocol, const char *recipient)
-{
- /*TODO register a handler for event 401 no such nick and set
- * a variable offline=TRUE. Reset it to false in otr_receive and
- * otr_send */
- return TRUE;
-}
-
-/*
- * Initialize our OtrlMessageAppOps
- */
-void otr_initops() {
- memset(&otr_ops,0,sizeof(otr_ops));
-
- otr_ops.policy = ops_policy;
- otr_ops.create_privkey = ops_create_privkey;
- otr_ops.inject_message = ops_inject_msg;
- otr_ops.notify = ops_notify;
- otr_ops.display_otr_message = ops_display_msg;
- otr_ops.gone_secure = ops_secure;
- otr_ops.gone_insecure = ops_insecure;
- otr_ops.still_secure = ops_still_secure;
- otr_ops.log_message = ops_log;
- otr_ops.max_message_size = ops_max_msg;
- otr_ops.update_context_list = ops_up_ctx_list;
- otr_ops.write_fingerprints = ops_writefps;
- otr_ops.is_logged_in = ops_is_logged_in;
-}
diff --git a/otr_util.c b/otr_util.c
deleted file mode 100644
index 777cc8d..0000000
--- a/otr_util.c
+++ /dev/null
@@ -1,812 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "otr.h"
-
-#include <gcrypt.h>
-
-extern OtrlMessageAppOps otr_ops;
-static int otrinited = FALSE;
-
-#ifdef TARGET_BITLBEE
-GHashTable *ioustates;
-#else
-IOUSTATE ioustate_uniq = { 0,0,0 };
-#endif
-
-#ifdef HAVE_GREGEX_H
-GRegex *regex_policies;
-#endif
-
-IOUSTATE *otr_init_user(char *user)
-{
- IOUSTATE *ioustate = IO_CREATE_US(user);
-
- ioustate->otr_state = otrl_userstate_create();
-
- /* load keys and fingerprints */
-
- key_load(ioustate);
- fps_load(ioustate);
-
- return ioustate;
-}
-
-void otr_deinit_user(IOUSTATE *ioustate)
-{
- keygen_abort(ioustate,TRUE);
-
- if (ioustate->otr_state) {
- otr_writefps(ioustate);
- otrl_userstate_free(ioustate->otr_state);
- ioustate->otr_state = NULL;
- }
- otr_setpolicies(ioustate,"",FALSE);
- otr_setpolicies(ioustate,"",TRUE);
-}
-
-/*
- * init otr lib.
- */
-int otrlib_init()
-{
- if (!otrinited) {
- OTRL_INIT;
- otrinited = TRUE;
- }
-
-#ifdef TARGET_BITLBEE
- ioustates = g_hash_table_new_full(g_str_hash,g_str_equal,g_free,otr_deinit_user);
-#endif
-
- otr_initops();
-
-#ifdef HAVE_GREGEX_H
- regex_policies =
- g_regex_new("([^,]+) (never|manual|handlews|opportunistic|always)"
- "(,|$)",0,0,NULL);
-#endif
-
- return 0;
-}
-
-/*
- * deinit otr lib.
- */
-void otrlib_deinit()
-{
-#ifdef HAVE_GREGEX_H
- g_regex_unref(regex_policies);
-#endif
-
-#ifdef TARGET_BITLBEE
- g_hash_table_destroy(ioustates);
-#endif
-}
-
-
-/*
- * Free our app data.
- */
-void context_free_app_info(void *data)
-{
- struct co_info *coi = data;
- if (coi->msgqueue) {
- g_free(coi->msgqueue);
- }
- if (coi->ircctx)
- IRCCTX_FREE(coi->ircctx);
-}
-
-/*
- * Add app data to context.
- * See struct co_info for details.
- */
-void context_add_app_info(void *data,ConnContext *co)
-{
- IRC_CTX *ircctx = IRCCTX_DUP(data);
- struct co_info *coi = g_malloc(sizeof(struct co_info));
-
- memset(coi,0,sizeof(struct co_info));
- co->app_data = coi;
- co->app_data_free = context_free_app_info;
-
- coi->ircctx = ircctx;
- sprintf(coi->better_msg_two,formats[TXT_OTR_BETTER_TWO].def,co->accountname);
-}
-
-/*
- * Get a context from a pair.
- */
-ConnContext *otr_getcontext(const char *accname,const char *nick,
- int create,IRC_CTX *ircctx)
-{
- ConnContext *co = otrl_context_find(
- IRCCTX_IO_US(ircctx)->otr_state,
- nick,
- accname,
- PROTOCOLID,
- create,
- NULL,
- context_add_app_info,
- ircctx);
-
- /* context came from a fingerprint */
- if (co&&ircctx&&!co->app_data)
- context_add_app_info(ircctx,co);
-
- return co;
-}
-
-/*
- * Hand the given message to OTR.
- * Returns NULL if OTR handled the message and
- * the original message otherwise.
- */
-char *otr_send(IRC_CTX *ircctx, const char *msg,const char *to)
-{
- gcry_error_t err;
- char *newmessage = NULL;
- ConnContext *co;
- char accname[256];
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- err = otrl_message_sending(
- IRCCTX_IO_US(ircctx)->otr_state,
- &otr_ops,
- ircctx,
- accname,
- PROTOCOLID,
- to,
- msg,
- NULL,
- &newmessage,
- context_add_app_info,
- ircctx);
-
- if (err != 0) {
- otr_notice(ircctx,to,TXT_SEND_FAILED,msg);
- return NULL;
- }
-
- if (newmessage==NULL)
- return (char*)msg;
-
- /* OTR message. Need to do fragmentation */
-
- if (!(co = otr_getcontext(accname,to,FALSE,ircctx))) {
- otr_notice(ircctx,to,TXT_SEND_CHANGE);
- return NULL;
- }
-
- err = otrl_message_fragment_and_send(
- &otr_ops,
- ircctx,
- co,
- newmessage,
- OTRL_FRAGMENT_SEND_ALL,
- NULL);
-
- if (err != 0) {
- otr_notice(ircctx,to,TXT_SEND_FRAGMENT,msg);
- } else
- otr_debug(ircctx,to,TXT_SEND_CONVERTED,newmessage);
-
- return NULL;
-}
-
-struct ctxlist_ *otr_contexts(IOUSTATE *ioustate)
-{
- ConnContext *context;
- Fingerprint *fprint;
- struct ctxlist_ *ctxlist = NULL, *ctxhead = NULL;
- struct fplist_ *fplist,*fphead;
- char fp[41];
- char *trust;
- int i;
-
- for(context = ioustate->otr_state->context_root; context;
- context = context->next) {
- if (!ctxlist)
- ctxhead = ctxlist = g_malloc0(sizeof(struct ctxlist_));
- else
- ctxlist = ctxlist->next = g_malloc0(sizeof(struct
- ctxlist_));
- switch (context->msgstate) {
- case OTRL_MSGSTATE_PLAINTEXT: ctxlist->state = STUNENCRYPTED;break;
- case OTRL_MSGSTATE_ENCRYPTED: ctxlist->state = STENCRYPTED;break;
- case OTRL_MSGSTATE_FINISHED: ctxlist->state = STFINISHED;break;
- default: ctxlist->state = STUNKNOWN;break;
- }
- ctxlist->username = context->username;
- ctxlist->accountname = context->accountname;
-
- fplist = fphead = NULL;
- for (fprint = context->fingerprint_root.next; fprint;
- fprint = fprint->next) {
- if (!fplist)
- fphead = fplist = g_malloc0(sizeof(struct
- fplist_));
- else
- fplist = fplist->next = g_malloc0(sizeof(struct
- fplist_));
- trust = fprint->trust ? : "";
- for(i=0;i<20;++i)
- sprintf(fp+i*2, "%02x",
- fprint->fingerprint[i]);
- fplist->fp = g_strdup(fp);
- if (*trust=='\0')
- fplist->authby = NOAUTH;
- else if (strcmp(trust,"smp")==0)
- fplist->authby = AUTHSMP;
- else
- fplist->authby = AUTHMAN;
- }
-
- ctxlist->fplist = fphead;
- }
- return ctxhead;
-}
-
-/*
- * Get the OTR status of this conversation.
- */
-int otr_getstatus(IRC_CTX *ircctx, const char *nick)
-{
- ConnContext *co;
- char accname[128];
- struct co_info *coi;
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- if (!(co = otr_getcontext(accname,nick,FALSE,ircctx))) {
- return IO_ST_PLAINTEXT;
- }
-
- coi = co->app_data;
-
- switch (co->msgstate) {
- case OTRL_MSGSTATE_PLAINTEXT:
- return IO_ST_PLAINTEXT;
- case OTRL_MSGSTATE_ENCRYPTED: {
- char *trust = co->active_fingerprint->trust;
- int ex = co->smstate->nextExpected;
- int code=0;
-
- switch (ex) {
- case OTRL_SMP_EXPECT1:
- if (coi->received_smp_init)
- code = IO_ST_SMP_INCOMING;
- break;
- case OTRL_SMP_EXPECT2:
- code = IO_ST_SMP_OUTGOING;
- break;
- case OTRL_SMP_EXPECT3:
- case OTRL_SMP_EXPECT4:
- code = IO_ST_SMP_FINALIZE;
- break;
- default:
- otr_logst(MSGLEVEL_CRAP,"BUG Found! Please write us a mail and describe how you got here");
- return IO_ST_UNKNOWN;
- }
-
- if (trust&&(*trust!='\0'))
- code |= strcmp(trust,"smp")==0 ? IO_ST_TRUST_SMP :
- IO_ST_TRUST_MANUAL;
- else
- code |= IO_ST_UNTRUSTED;
-
- return code;
- }
- case OTRL_MSGSTATE_FINISHED:
- return IO_ST_FINISHED;
- default:
- otr_logst(MSGLEVEL_CRAP,"BUG Found! Please write us a mail and describe how you got here");
- return IO_ST_UNKNOWN;
- }
-}
-
-/*
- * Finish the conversation.
- */
-void otr_finish(IRC_CTX *ircctx, char *nick, const char *peername, int inquery)
-{
- ConnContext *co;
- char accname[128];
- struct co_info *coi;
- char nickbuf[128];
-
- if (peername) {
- nick = nickbuf;
- ircctx = ircctx_by_peername(peername,nick);
- if (!ircctx)
- return;
- }
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- if (!(co = otr_getcontext(accname,nick,FALSE,ircctx))) {
- if (inquery)
- otr_noticest(TXT_CTX_NOT_FOUND,
- accname,nick);
- return;
- }
-
- otrl_message_disconnect(IRCCTX_IO_US(ircctx)->otr_state,&otr_ops,ircctx,accname,
- PROTOCOLID,nick);
- otr_status_change(ircctx,nick,IO_STC_FINISHED);
-
- if (inquery) {
- otr_info(ircctx,nick,TXT_CMD_FINISH,nick,IRCCTX_ADDR(ircctx));
- } else {
- otr_infost(TXT_CMD_FINISH,nick,IRCCTX_ADDR(ircctx));
- }
-
- coi = co->app_data;
-
- /* finish if /otr finish has been issued. Reset if
- * we're called cause the query window has been closed. */
- if (coi)
- coi->finished = inquery;
-}
-
-void otr_finishall(IOUSTATE *ioustate)
-{
- ConnContext *context;
- int finished=0;
-
- for(context = ioustate->otr_state->context_root; context;
- context = context->next) {
- struct co_info *coi = context->app_data;
-
- if (context->msgstate!=OTRL_MSGSTATE_ENCRYPTED)
- continue;
-
- otrl_message_disconnect(ioustate->otr_state,&otr_ops,coi->ircctx,
- context->accountname,
- PROTOCOLID,
- context->username);
- otr_status_change(coi->ircctx,context->username,IO_STC_FINISHED);
-
- otr_infost(TXT_CMD_FINISH,context->username,
- IRCCTX_ADDR(coi->ircctx));
- finished++;
- }
-
- if (!finished)
- otr_infost(TXT_CMD_FINISHALL_NONE);
-}
-
-/*
- * Trust our peer.
- */
-void otr_trust(IRC_CTX *ircctx, char *nick, const char *peername)
-{
- ConnContext *co;
- char accname[128];
- struct co_info *coi;
- char nickbuf[128];
-
- if (peername) {
- nick = nickbuf;
- ircctx = ircctx_by_peername(peername,nick);
- if (!ircctx)
- return;
- }
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- if (!(co = otr_getcontext(accname,nick,FALSE,ircctx))) {
- otr_noticest(TXT_CTX_NOT_FOUND,
- accname,nick);
- return;
- }
-
- otrl_context_set_trust(co->active_fingerprint,"manual");
- otr_status_change(ircctx,nick,IO_STC_TRUST_MANUAL);
-
- coi = co->app_data;
- coi->smp_failed = FALSE;
-
- otr_notice(ircctx,nick,TXT_FP_TRUST,nick);
-
-}
-
-/*
- * Abort any ongoing SMP authentication.
- */
-void otr_abort_auth(ConnContext *co, IRC_CTX *ircctx, const char *nick)
-{
- struct co_info *coi;
-
- coi = co->app_data;
-
- coi->received_smp_init = FALSE;
-
- otr_notice(ircctx,nick,
- co->smstate->nextExpected!=OTRL_SMP_EXPECT1 ?
- TXT_AUTH_ABORTED_ONGOING :
- TXT_AUTH_ABORTED);
-
- otrl_message_abort_smp(IRCCTX_IO_US(ircctx)->otr_state,&otr_ops,ircctx,co);
- otr_status_change(ircctx,nick,IO_STC_SMP_ABORT);
-}
-
-/*
- * implements /otr authabort
- */
-void otr_authabort(IRC_CTX *ircctx, char *nick, const char *peername)
-{
- ConnContext *co;
- char accname[128];
- char nickbuf[128];
-
- if (peername) {
- nick = nickbuf;
- ircctx = ircctx_by_peername(peername,nick);
- if (!ircctx)
- return;
- }
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- if (!(co = otr_getcontext(accname,nick,FALSE,ircctx))) {
- otr_noticest(TXT_CTX_NOT_FOUND,
- accname,nick);
- return;
- }
-
- otr_abort_auth(co,ircctx,nick);
-
-}
-
-/*
- * Initiate or respond to SMP authentication.
- */
-void otr_auth(IRC_CTX *ircctx, char *nick, const char *peername, const char *secret)
-{
- ConnContext *co;
- char accname[128];
- struct co_info *coi;
- char nickbuf[128];
-
- if (peername) {
- nick = nickbuf;
- ircctx = ircctx_by_peername(peername,nick);
- if (!ircctx)
- return;
- }
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- if (!(co = otr_getcontext(accname,nick,FALSE,ircctx))) {
- otr_noticest(TXT_CTX_NOT_FOUND,
- accname,nick);
- return;
- }
-
- if (co->msgstate!=OTRL_MSGSTATE_ENCRYPTED) {
- otr_notice(ircctx,nick,TXT_AUTH_NEEDENC);
- return;
- }
-
- coi = co->app_data;
-
- /* Aborting an ongoing auth */
- if (co->smstate->nextExpected!=OTRL_SMP_EXPECT1)
- otr_abort_auth(co,ircctx,nick);
-
- coi->smp_failed = FALSE;
-
- /* reset trust level */
- if (co->active_fingerprint) {
- char *trust = co->active_fingerprint->trust;
- if (trust&&(*trust!='\0')) {
- otrl_context_set_trust(co->active_fingerprint, "");
- otr_writefps(IRCCTX_IO_US(ircctx));
- }
- }
-
- if (!coi->received_smp_init) {
- otrl_message_initiate_smp(
- IRCCTX_IO_US(ircctx)->otr_state,
- &otr_ops,
- ircctx,
- co,
- (unsigned char*)secret,
- strlen(secret));
- otr_status_change(ircctx,nick,IO_STC_SMP_STARTED);
- } else {
- otrl_message_respond_smp(
- IRCCTX_IO_US(ircctx)->otr_state,
- &otr_ops,
- ircctx,
- co,
- (unsigned char*)secret,
- strlen(secret));
- otr_status_change(ircctx,nick,IO_STC_SMP_RESPONDED);
- }
-
- otr_notice(ircctx,nick,
- coi->received_smp_init ?
- TXT_AUTH_RESPONDING :
- TXT_AUTH_INITIATED);
-
-}
-
-/*
- * Handles incoming TLVs of the SMP authentication type. We're not only updating
- * our own state but also giving libotr a leg up so it gets through the auth.
- */
-void otr_handle_tlvs(OtrlTLV *tlvs, ConnContext *co,
- struct co_info *coi,
- IRC_CTX *ircctx, const char *from)
-{
- int abort = FALSE;
-
- OtrlTLV *tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP1);
- if (tlv) {
- if (co->smstate->nextExpected != OTRL_SMP_EXPECT1) {
- otr_notice(ircctx,from,TXT_AUTH_HAVE_OLD,
- from);
- abort = TRUE;
- } else {
- otr_notice(ircctx,from,TXT_AUTH_PEER,
- from);
- coi->received_smp_init = TRUE;
- otr_status_change(ircctx,from,IO_STC_SMP_INCOMING);
- }
- }
-
- tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP2);
- if (tlv) {
- if (co->smstate->nextExpected != OTRL_SMP_EXPECT2) {
- otr_notice(ircctx,from,
- TXT_AUTH_PEER_REPLY_WRONG,
- from);
- abort = TRUE;
- } else {
- otr_notice(ircctx,from,
- TXT_AUTH_PEER_REPLIED,
- from);
- co->smstate->nextExpected = OTRL_SMP_EXPECT4;
- otr_status_change(ircctx,from,IO_STC_SMP_FINALIZE);
- }
- }
-
- tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP3);
- if (tlv) {
- if (co->smstate->nextExpected != OTRL_SMP_EXPECT3) {
- otr_notice(ircctx,from,
- TXT_AUTH_PEER_WRONG_SMP3,
- from);
- abort = TRUE;
- } else {
- char *trust = co->active_fingerprint->trust;
- if (trust&&(*trust!='\0')) {
- otr_notice(ircctx,from,
- TXT_AUTH_SUCCESSFUL);
- otr_status_change(ircctx,from,IO_STC_SMP_SUCCESS);
- } else {
- otr_notice(ircctx,from,
- TXT_AUTH_FAILED);
- coi->smp_failed = TRUE;
- otr_status_change(ircctx,from,IO_STC_SMP_FAILED);
- }
- co->smstate->nextExpected = OTRL_SMP_EXPECT1;
- coi->received_smp_init = FALSE;
- }
- }
-
- tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP4);
- if (tlv) {
- if (co->smstate->nextExpected != OTRL_SMP_EXPECT4) {
- otr_notice(ircctx,from,
- TXT_AUTH_PEER_WRONG_SMP4,
- from);
- abort = TRUE;
- } else {
- char *trust = co->active_fingerprint->trust;
- if (trust&&(*trust!='\0')) {
- otr_notice(ircctx,from,
- TXT_AUTH_SUCCESSFUL);
- otr_status_change(ircctx,from,IO_STC_SMP_SUCCESS);
- } else {
- /* unreachable since 4 is never sent out on
- * error */
- otr_notice(ircctx,from,
- TXT_AUTH_FAILED);
- coi->smp_failed = TRUE;
- otr_status_change(ircctx,from,IO_STC_SMP_FAILED);
- }
- co->smstate->nextExpected = OTRL_SMP_EXPECT1;
- coi->received_smp_init = FALSE;
- }
- }
- if (abort) {
- otr_abort_auth(co,ircctx,from);
- otr_status_change(ircctx,from,IO_STC_SMP_ABORTED);
- }
-
- tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED);
- if (tlv) {
- otr_status_change(ircctx,from,IO_STC_PEER_FINISHED);
- otr_notice(ircctx,from,TXT_PEER_FINISHED,from);
- }
-
-}
-
-/*
- * Hand the given message to OTR.
- * Returns NULL if its an OTR protocol message and
- * the (possibly) decrypted message otherwise.
- */
-char *otr_receive(IRC_CTX *ircctx, const char *msg,const char *from)
-{
- int ignore_message;
- char *newmessage = NULL;
- char accname[256];
- char *lastmsg;
- ConnContext *co;
- struct co_info *coi;
- OtrlTLV *tlvs;
-
- IRCCTX_ACCNAME(accname,ircctx);
-
- if (!(co = otr_getcontext(accname,from,TRUE,ircctx))) {
- otr_noticest(TXT_CTX_NOT_CREATE,
- accname,from);
- return NULL;
- }
-
- coi = co->app_data;
-
- /* Really lame but I don't see how you could do this in a generic
- * way unless the IRC server would somehow mark continuation messages.
- */
- if ((strcmp(msg,coi->better_msg_two)==0)||
- (strcmp(msg,formats[TXT_OTR_BETTER_THREE].def)==0)) {
- otr_debug(ircctx,from,TXT_RECEIVE_IGNORE_QUERY);
- return NULL;
- }
-
- /* The server might have split lines that were too long
- * (bitlbee does that). The heuristic is simple: If we can find ?OTR:
- * in the message but it doesn't end with a ".", queue it and wait
- * for the rest.
- */
- lastmsg = co->app_data;
-
- if (coi->msgqueue) { /* already something in the queue */
- strcpy(coi->msgqueue+strlen(coi->msgqueue),msg);
-
- /* wait for more? */
- if ((strlen(msg)>OTR_MAX_MSG_SIZE)&&
- (msg[strlen(msg)-1]!='.')&&
- (msg[strlen(msg)-1]!=','))
- return NULL;
-
- otr_debug(ircctx,from,TXT_RECEIVE_DEQUEUED,
- strlen(coi->msgqueue));
-
- msg = coi->msgqueue;
- coi->msgqueue = NULL;
-
- /* this is freed thru our caller by otrl_message_free.
- * Currently ok since that just uses free().
- */
-
- } else if (strstr(msg,"?OTR:")&&
- (strlen(msg)>OTR_MAX_MSG_SIZE)&&
- (msg[strlen(msg)-1]!='.')&&
- (msg[strlen(msg)-1]!=',')) {
- coi->msgqueue = malloc(4096*sizeof(char));
- strcpy(coi->msgqueue,msg);
- otr_debug(ircctx,from,TXT_RECEIVE_QUEUED,strlen(msg));
- return NULL;
- }
-
- ignore_message = otrl_message_receiving(
- IRCCTX_IO_US(ircctx)->otr_state,
- &otr_ops,
- ircctx,
- accname,
- PROTOCOLID,
- from,
- msg,
- &newmessage,
- &tlvs,
- NULL,
- NULL);
-
- if (tlvs)
- otr_handle_tlvs(tlvs,co,coi,ircctx,from);
-
- if (ignore_message) {
- otr_debug(ircctx,from,
- TXT_RECEIVE_IGNORE, strlen(msg),accname,from,msg);
- return NULL;
- }
-
- if (newmessage)
- otr_debug(ircctx,from,TXT_RECEIVE_CONVERTED);
-
- return newmessage ? : (char*)msg;
-}
-
-void otr_setpolicies(IOUSTATE *ioustate, const char *policies, int known)
-{
-#ifdef HAVE_GREGEX_H
- GMatchInfo *match_info;
- GSList *plist = known ? ioustate->plistknown : ioustate->plistunknown;
-
- if (plist) {
- GSList *p = plist;
- do {
- struct plistentry *ple = p->data;
- g_pattern_spec_free(ple->namepat);
- g_free(p->data);
- } while ((p = g_slist_next(p)));
-
- g_slist_free(plist);
- plist = NULL;
- }
-
- g_regex_match(regex_policies,policies,0,&match_info);
-
- while(g_match_info_matches(match_info)) {
- struct plistentry *ple = (struct plistentry *)g_malloc0(sizeof(struct plistentry));
- char *pol = g_match_info_fetch(match_info, 2);
-
- ple->namepat = g_pattern_spec_new(g_match_info_fetch(match_info, 1));
-
- switch (*pol) {
- case 'n':
- ple->policy = OTRL_POLICY_NEVER;
- break;
- case 'm':
- ple->policy = OTRL_POLICY_MANUAL;
- break;
- case 'h':
- ple->policy = OTRL_POLICY_MANUAL|OTRL_POLICY_WHITESPACE_START_AKE;
- break;
- case 'o':
- ple->policy = OTRL_POLICY_OPPORTUNISTIC;
- break;
- case 'a':
- ple->policy = OTRL_POLICY_ALWAYS;
- break;
- }
-
- plist = g_slist_append(plist,ple);
-
- g_free(pol);
-
- g_match_info_next(match_info, NULL);
- }
-
- g_match_info_free(match_info);
-
- if (known)
- ioustate->plistknown = plist;
- else
- ioustate->plistunknown = plist;
-#endif
-}
diff --git a/xchat/CMakeLists.txt b/xchat/CMakeLists.txt
deleted file mode 100644
index e235d7f..0000000
--- a/xchat/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-IF(NOT XCHAT_INCLUDE_DIR)
- MESSAGE(FATAL_ERROR "*** no xchat found. If you don't want this plugin set the
- appropriate option to OFF, use for instance 'ccmake .' ***")
-ENDIF(NOT XCHAT_INCLUDE_DIR)
-
-MESSAGE(STATUS "*** building for xchat ***")
-
-SET(XCHATOTR_INCLUDE_DIRS
- ${XCHAT_INCLUDE_DIR}/xchat
- ${PROJECT_SOURCE_DIR}/xchat)
-
-INCLUDE_DIRECTORIES(${XCHATOTR_INCLUDE_DIRS})
-
-ADD_LIBRARY(xchatotr SHARED xchat_otr.c ../otr_util.c ../otr_ops.c ../otr_key.c ../io_util.c ../io_set.c ${PROJECT_BINARY_DIR}/xchat-formats.c)
-TARGET_LINK_LIBRARIES(xchatotr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
-SET_TARGET_PROPERTIES(xchatotr PROPERTIES
- COMPILE_FLAGS -DTARGET_XCHAT
- OUTPUT_NAME "xchatotr"
- LINK_FLAGS "${MAIN_LDFLAGS}")
-
-add_dependencies(xchatotr otrformats)
-set_source_files_properties(${CMAKE_BINARY_DIR}/xchat-formats.c PROPERTIES GENERATED TRUE)
-
-IF(APPLE)
- SET_TARGET_PROPERTIES(xchatotr PROPERTIES SUFFIX ".so")
-ENDIF(APPLE)
-
-# docdir
-
-IF(NOT DOCDIR)
- SET(DOCDIR share/doc/xchat-otr)
-ENDIF(NOT DOCDIR)
-
-INSTALL(TARGETS xchatotr DESTINATION lib${LIB_SUFFIX}/xchat/plugins)
-INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
diff --git a/xchat/xchat_otr.c b/xchat/xchat_otr.c
deleted file mode 100644
index 60661af..0000000
--- a/xchat/xchat_otr.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2009 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "otr.h"
-
-int debug = 0;
-
-#ifdef HAVE_GREGEX_H
-GRegex *regex_nickignore = NULL;
-#endif
-
-static IOUSTATE *ioustate;
-
-xchat_plugin *ph;
-
-void irc_send_message(IRC_CTX *ircctx, const char *recipient, char *msg) {
- xchat_commandf(ph, "PRIVMSG %s :%s", recipient, msg);
-}
-
-int cmd_otr(char *word[], char *word_eol[], void *userdata)
-{
- const char *own_nick = xchat_get_info(ph, "nick");
- char *target = (char*)xchat_get_info(ph, "channel");
- const char *server = xchat_get_info(ph, "server");
- IRC_CTX ircctxs = {
- .nick = (char*)own_nick,
- .address = (char*)server },
- *ircctx = &ircctxs;
- int argc=0;
-
- word+=3;
- word_eol+=3;
-
- while (word[argc]&&*word[argc])
- argc++;
-
- cmd_generic(ioustate,ircctx,argc,word,word_eol,target);
-
- return XCHAT_EAT_ALL;
-}
-
-int hook_outgoing(char *word[], char *word_eol[], void *userdata)
-{
- const char *own_nick = xchat_get_info(ph, "nick");
- const char *channel = xchat_get_info(ph, "channel");
- const char *server = xchat_get_info(ph, "server");
- char newmsg[512];
- char *otrmsg;
- IRC_CTX ircctx = {
- .nick = (char*)own_nick,
- .address = (char*)server };
-
- if ((*channel == '&')||(*channel == '#'))
- return XCHAT_EAT_NONE;
-
-#ifdef HAVE_GREGEX_H
- if (g_regex_match(regex_nickignore,channel,0,NULL))
- return XCHAT_EAT_NONE;
-#endif
- otrmsg = otr_send(&ircctx,word_eol[1],channel);
-
- if (otrmsg==word_eol[1])
- return XCHAT_EAT_NONE;
-
- xchat_emit_print(ph, "Your Message", own_nick, word_eol[1], NULL, NULL);
-
- if (!otrmsg)
- return XCHAT_EAT_ALL;
-
- snprintf(newmsg, 511, "PRIVMSG %s :%s", channel, otrmsg);
-
- otrl_message_free(otrmsg);
- xchat_command(ph, newmsg);
-
- return XCHAT_EAT_ALL;
-}
-
-int hook_privmsg(char *word[], char *word_eol[], void *userdata)
-{
- char nick[256];
- char *newmsg;
- const char *server = xchat_get_info(ph, "server");
- const char *own_nick = xchat_get_info(ph, "nick");
- IRC_CTX ircctx = {
- .nick = (char*)own_nick,
- .address = (char*)server };
- xchat_context *query_ctx;
-
- if (!extract_nick(nick,word[1]))
- return XCHAT_EAT_NONE;
-
-#ifdef HAVE_GREGEX_H
- if (g_regex_match(regex_nickignore,nick,0,NULL))
- return XCHAT_EAT_NONE;
-#endif
-
- newmsg = otr_receive(&ircctx,word_eol[2],nick);
-
- if (!newmsg) {
- return XCHAT_EAT_ALL;
- }
-
- if (newmsg==word_eol[2]) {
- return XCHAT_EAT_NONE;
- }
-
- query_ctx = xchat_find_context(ph, server, nick);
-
- if (query_ctx)
- xchat_set_context(ph, query_ctx);
-
- xchat_emit_print(ph, "Private Message", nick, newmsg, NULL, NULL);
-
- otrl_message_free(newmsg);
-
- return XCHAT_EAT_ALL;
-}
-
-void xchat_plugin_get_info(char **name, char **desc, char **version, void **reserved)
-{
- *name = PNAME;
- *desc = PDESC;
- *version = PVERSION;
-}
-
-int xchat_plugin_init(xchat_plugin *plugin_handle,
- char **plugin_name,
- char **plugin_desc,
- char **plugin_version,
- char *arg)
-{
- ph = plugin_handle;
-
- *plugin_name = PNAME;
- *plugin_desc = PDESC;
- *plugin_version = PVERSION;
-
- if (otrlib_init())
- return 0;
-
- ioustate = otr_init_user("one to rule them all");
-
- xchat_hook_server(ph, "PRIVMSG", XCHAT_PRI_NORM, hook_privmsg, 0);
- xchat_hook_command(ph, "", XCHAT_PRI_NORM, hook_outgoing, 0, 0);
- xchat_hook_command(ph, "otr", XCHAT_PRI_NORM, cmd_otr, 0, 0);
-
- otr_setpolicies(ioustate,IO_DEFAULT_POLICY,FALSE);
- otr_setpolicies(ioustate,IO_DEFAULT_POLICY_KNOWN,TRUE);
-
-#ifdef HAVE_GREGEX_H
- if (regex_nickignore)
- g_regex_unref(regex_nickignore);
- regex_nickignore = g_regex_new(IO_DEFAULT_IGNORE,0,0,NULL);
-#endif
-
- xchat_print(ph, "xchat-otr loaded successfully!\n");
-
- cmds[CMDCOUNT].name = "set";
- cmds[CMDCOUNT].cmdfunc = cmd_set;
-
- return 1;
-}
-
-int xchat_plugin_deinit()
-{
-#ifdef HAVE_GREGEX_H
- g_regex_unref(regex_nickignore);
-#endif
-
- if (set_finishonunload)
- otr_finishall(ioustate);
-
- otr_deinit_user(ioustate);
-
- otrlib_deinit();
-
- return 1;
-}
-
-void printformat(IRC_CTX *ircctx, const char *nick, int lvl, int fnum, ...)
-{
- va_list params;
- va_start( params, fnum );
- char msg[LOGMAX], *s = msg;
- xchat_context *find_query_ctx;
- char *server = NULL;
-
- if (ircctx)
- server = ircctx->address;
-
- if (server&&nick) {
- find_query_ctx = xchat_find_context(ph, server, nick);
- if(find_query_ctx==NULL) {
- // no query window yet, let's open one
- xchat_commandf(ph, "query %s", nick);
- find_query_ctx = xchat_find_context(ph, server, nick);
- }
- } else {
- find_query_ctx = xchat_find_context(ph,
- NULL,
- xchat_get_info(ph,
- "network") ?
- :
- xchat_get_info(ph,"server"));
- }
-
- xchat_set_context(ph, find_query_ctx);
-
- if( vsnprintf( s, LOGMAX, formats[fnum].def, params ) < 0 )
- sprintf( s, "internal error parsing error string (BUG)" );
- va_end( params );
- xchat_printf(ph, "OTR: %s", s);
-}
-
-IRC_CTX *server_find_address(char *address)
-{
- static IRC_CTX ircctx;
-
- ircctx.address = address;
-
- return &ircctx;
-}
diff --git a/xchat/xchat_otr.h b/xchat/xchat_otr.h
deleted file mode 100644
index a8f3db3..0000000
--- a/xchat/xchat_otr.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2009 Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-
-#include "xchat-plugin.h"
-
-#define PNAME "xchat-otr"
-#define PDESC "Off-The-Record Messaging for xchat"
-#define PVERSION IRCOTR_VERSION
-
-#define MAX_FORMAT_PARAMS 10
-
-
-struct _IRC_CTX {
- char *nick;
- char *address;
-};
-
-typedef struct _IRC_CTX IRC_CTX;
-struct _FORMAT_REC {
- char *tag;
- char *def;
-
- int params;
- int paramtypes[MAX_FORMAT_PARAMS];
-};
-
-typedef struct _FORMAT_REC FORMAT_REC;
-
-enum { MSGLEVEL_CRAP, MSGLEVEL_MSGS } lvls;
-
-extern xchat_plugin *ph; /* plugin handle */
-
-/* stuff from io_set.c */
-extern char set_policy[512];
-extern char set_policy_known[512];
-extern char set_ignore[512];
-extern int set_finishonunload;
-void cmd_set(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc,
- char *argv[], char *argv_eol[], char *target);
-
-#define get_client_config_dir() xchat_get_info(ph,"xchatdir")
-
-void printformat(IRC_CTX *ircctx, const char *nick, int lvl, int fnum, ...);
-
-#define otr_noticest(formatnum,...) \
- printformat(NULL,NULL,MSGLEVEL_MSGS, formatnum, ## __VA_ARGS__)
-
-#define otr_notice(server,nick,formatnum,...) \
- printformat(server,nick,MSGLEVEL_MSGS, formatnum, ## __VA_ARGS__)
-
-#define otr_infost(formatnum,...) \
- printformat(NULL,NULL,MSGLEVEL_CRAP, formatnum, ## __VA_ARGS__)
-
-#define otr_info(server,nick,formatnum,...) \
- printformat(server,nick,MSGLEVEL_CRAP, formatnum, ## __VA_ARGS__)
-
-#define otr_debug(server,nick,formatnum,...) { \
- if (debug) \
- printformat(server,nick, \
- MSGLEVEL_MSGS, formatnum, ## __VA_ARGS__); \
-}
-#define IRCCTX_DUP(ircctx) g_memdup(ircctx,sizeof(IRC_CTX));
-#define IRCCTX_ADDR(ircctx) ircctx->address
-#define IRCCTX_NICK(ircctx) ircctx->nick
-#define IRCCTX_FREE(ircctx) g_free(ircctx)
-#define IRCCTX_ACCNAME(accname,ircctx) sprintf(accname, "%s@%s", ircctx->nick, ircctx->address)
-#define IRCCTX_IO_US(ircctx) (&ioustate_uniq)
-#define IO_CREATE_US(user) (&ioustate_uniq)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git
More information about the Pkg-privacy-commits
mailing list