summaryrefslogtreecommitdiff
path: root/chat
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2014-01-10 09:50:42 +0000
committerwiz <wiz@pkgsrc.org>2014-01-10 09:50:42 +0000
commite0b52f2bfb816ac207b406135bbee6e3343f7867 (patch)
treed63f5b0ac9862fe8d6ce1a2b4cbfe7f7a7a2084d /chat
parentf1fff5c5f80334b84ac27476fb133e34206745ef (diff)
downloadpkgsrc-e0b52f2bfb816ac207b406135bbee6e3343f7867.tar.gz
Import mcabber-0.10.2 as chat/mcabber, packaged for wip by kh-p,
zul_, khorben, netcap, and jihbed. mcabber is a small Jabber console client, it supports SSL, OTR, MUC, history logging, commands completion and external actions triggers.
Diffstat (limited to 'chat')
-rw-r--r--chat/mcabber/DESCR3
-rw-r--r--chat/mcabber/Makefile33
-rw-r--r--chat/mcabber/PLIST381
-rw-r--r--chat/mcabber/distinfo9
-rw-r--r--chat/mcabber/options.mk34
-rw-r--r--chat/mcabber/patches/patch-aa22
-rw-r--r--chat/mcabber/patches/patch-configure238
-rw-r--r--chat/mcabber/patches/patch-mcabber_otr.c541
-rw-r--r--chat/mcabber/patches/patch-mcabber_otr.h16
9 files changed, 1277 insertions, 0 deletions
diff --git a/chat/mcabber/DESCR b/chat/mcabber/DESCR
new file mode 100644
index 00000000000..b8e44ed5db4
--- /dev/null
+++ b/chat/mcabber/DESCR
@@ -0,0 +1,3 @@
+mcabber is a small Jabber console client, it supports SSL, OTR,
+MUC, history logging, commands completion and external actions
+triggers.
diff --git a/chat/mcabber/Makefile b/chat/mcabber/Makefile
new file mode 100644
index 00000000000..5ecd021bff7
--- /dev/null
+++ b/chat/mcabber/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+DISTNAME= mcabber-0.10.2
+CATEGORIES= chat
+MASTER_SITES= http://www.lilotux.net/~mikael/mcabber/files/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= degroote@NetBSD.org
+HOMEPAGE= http://www.lilotux.net/~mikael/mcabber/
+COMMENT= Jabber console client
+LICENSE= gnu-gpl-v2
+
+CHECK_PORTABILITY_SKIP+= contrib/events/eventcmd.pastebin
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake xgettext pkg-config
+USE_NCURSES= yes
+
+INSTALLATION_DIRS+= share/examples/mcabber
+CONFIGURE_ARGS+= --disable-hgcset
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/mcabberrc.example \
+ ${DESTDIR}${PREFIX}/share/examples/mcabber
+.include "options.mk"
+
+.include "../../chat/loudmouth/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/libidn/buildlink3.mk"
+.include "../../devel/ncursesw/buildlink3.mk"
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/chat/mcabber/PLIST b/chat/mcabber/PLIST
new file mode 100644
index 00000000000..614a52899c7
--- /dev/null
+++ b/chat/mcabber/PLIST
@@ -0,0 +1,381 @@
+@comment $NetBSD: PLIST,v 1.1 2014/01/10 09:50:42 wiz Exp $
+bin/mcabber
+include/mcabber/api.h
+include/mcabber/caps.h
+include/mcabber/commands.h
+include/mcabber/compl.h
+include/mcabber/config.h
+include/mcabber/events.h
+include/mcabber/fifo.h
+include/mcabber/hbuf.h
+include/mcabber/help.h
+include/mcabber/histolog.h
+include/mcabber/hooks.h
+include/mcabber/logprint.h
+include/mcabber/main.h
+include/mcabber/modules.h
+include/mcabber/nohtml.h
+include/mcabber/otr.h
+include/mcabber/pgp.h
+include/mcabber/roster.h
+include/mcabber/screen.h
+include/mcabber/settings.h
+include/mcabber/utf8.c
+include/mcabber/utf8.h
+include/mcabber/utils.h
+include/mcabber/xmpp.h
+include/mcabber/xmpp_defines.h
+include/mcabber/xmpp_helper.h
+include/mcabber/xmpp_iq.h
+include/mcabber/xmpp_iqrequest.h
+include/mcabber/xmpp_muc.h
+include/mcabber/xmpp_s10n.h
+lib/mcabber/libbeep.la
+lib/mcabber/libfifo.la
+lib/mcabber/liburlregex.la
+lib/mcabber/libxttitle.la
+lib/pkgconfig/mcabber.pc
+man/man1/mcabber.1
+share/examples/mcabber/mcabberrc.example
+share/mcabber/help/cs/hlp.txt
+share/mcabber/help/cs/hlp_add.txt
+share/mcabber/help/cs/hlp_alias.txt
+share/mcabber/help/cs/hlp_authorization.txt
+share/mcabber/help/cs/hlp_bind.txt
+share/mcabber/help/cs/hlp_buffer.txt
+share/mcabber/help/cs/hlp_chat_disable.txt
+share/mcabber/help/cs/hlp_clear.txt
+share/mcabber/help/cs/hlp_color.txt
+share/mcabber/help/cs/hlp_connect.txt
+share/mcabber/help/cs/hlp_del.txt
+share/mcabber/help/cs/hlp_disconnect.txt
+share/mcabber/help/cs/hlp_echo.txt
+share/mcabber/help/cs/hlp_event.txt
+share/mcabber/help/cs/hlp_group.txt
+share/mcabber/help/cs/hlp_help.txt
+share/mcabber/help/cs/hlp_iline.txt
+share/mcabber/help/cs/hlp_info.txt
+share/mcabber/help/cs/hlp_module.txt
+share/mcabber/help/cs/hlp_move.txt
+share/mcabber/help/cs/hlp_msay.txt
+share/mcabber/help/cs/hlp_otr.txt
+share/mcabber/help/cs/hlp_otrpolicy.txt
+share/mcabber/help/cs/hlp_pgp.txt
+share/mcabber/help/cs/hlp_quit.txt
+share/mcabber/help/cs/hlp_rawxml.txt
+share/mcabber/help/cs/hlp_rename.txt
+share/mcabber/help/cs/hlp_request.txt
+share/mcabber/help/cs/hlp_room.txt
+share/mcabber/help/cs/hlp_roster.txt
+share/mcabber/help/cs/hlp_say.txt
+share/mcabber/help/cs/hlp_say_to.txt
+share/mcabber/help/cs/hlp_screen_refresh.txt
+share/mcabber/help/cs/hlp_set.txt
+share/mcabber/help/cs/hlp_source.txt
+share/mcabber/help/cs/hlp_status.txt
+share/mcabber/help/cs/hlp_status_to.txt
+share/mcabber/help/cs/hlp_version.txt
+share/mcabber/help/de/hlp.txt
+share/mcabber/help/de/hlp_add.txt
+share/mcabber/help/de/hlp_alias.txt
+share/mcabber/help/de/hlp_authorization.txt
+share/mcabber/help/de/hlp_bind.txt
+share/mcabber/help/de/hlp_buffer.txt
+share/mcabber/help/de/hlp_chat_disable.txt
+share/mcabber/help/de/hlp_clear.txt
+share/mcabber/help/de/hlp_color.txt
+share/mcabber/help/de/hlp_connect.txt
+share/mcabber/help/de/hlp_del.txt
+share/mcabber/help/de/hlp_disconnect.txt
+share/mcabber/help/de/hlp_echo.txt
+share/mcabber/help/de/hlp_event.txt
+share/mcabber/help/de/hlp_group.txt
+share/mcabber/help/de/hlp_help.txt
+share/mcabber/help/de/hlp_iline.txt
+share/mcabber/help/de/hlp_info.txt
+share/mcabber/help/de/hlp_module.txt
+share/mcabber/help/de/hlp_move.txt
+share/mcabber/help/de/hlp_msay.txt
+share/mcabber/help/de/hlp_otr.txt
+share/mcabber/help/de/hlp_otrpolicy.txt
+share/mcabber/help/de/hlp_pgp.txt
+share/mcabber/help/de/hlp_quit.txt
+share/mcabber/help/de/hlp_rawxml.txt
+share/mcabber/help/de/hlp_rename.txt
+share/mcabber/help/de/hlp_request.txt
+share/mcabber/help/de/hlp_room.txt
+share/mcabber/help/de/hlp_roster.txt
+share/mcabber/help/de/hlp_say.txt
+share/mcabber/help/de/hlp_say_to.txt
+share/mcabber/help/de/hlp_screen_refresh.txt
+share/mcabber/help/de/hlp_set.txt
+share/mcabber/help/de/hlp_source.txt
+share/mcabber/help/de/hlp_status.txt
+share/mcabber/help/de/hlp_status_to.txt
+share/mcabber/help/de/hlp_version.txt
+share/mcabber/help/en/hlp.txt
+share/mcabber/help/en/hlp_add.txt
+share/mcabber/help/en/hlp_alias.txt
+share/mcabber/help/en/hlp_authorization.txt
+share/mcabber/help/en/hlp_bind.txt
+share/mcabber/help/en/hlp_buffer.txt
+share/mcabber/help/en/hlp_chat_disable.txt
+share/mcabber/help/en/hlp_clear.txt
+share/mcabber/help/en/hlp_color.txt
+share/mcabber/help/en/hlp_connect.txt
+share/mcabber/help/en/hlp_del.txt
+share/mcabber/help/en/hlp_disconnect.txt
+share/mcabber/help/en/hlp_echo.txt
+share/mcabber/help/en/hlp_event.txt
+share/mcabber/help/en/hlp_group.txt
+share/mcabber/help/en/hlp_help.txt
+share/mcabber/help/en/hlp_iline.txt
+share/mcabber/help/en/hlp_info.txt
+share/mcabber/help/en/hlp_module.txt
+share/mcabber/help/en/hlp_move.txt
+share/mcabber/help/en/hlp_msay.txt
+share/mcabber/help/en/hlp_otr.txt
+share/mcabber/help/en/hlp_otrpolicy.txt
+share/mcabber/help/en/hlp_pgp.txt
+share/mcabber/help/en/hlp_quit.txt
+share/mcabber/help/en/hlp_rawxml.txt
+share/mcabber/help/en/hlp_rename.txt
+share/mcabber/help/en/hlp_request.txt
+share/mcabber/help/en/hlp_room.txt
+share/mcabber/help/en/hlp_roster.txt
+share/mcabber/help/en/hlp_say.txt
+share/mcabber/help/en/hlp_say_to.txt
+share/mcabber/help/en/hlp_screen_refresh.txt
+share/mcabber/help/en/hlp_set.txt
+share/mcabber/help/en/hlp_source.txt
+share/mcabber/help/en/hlp_status.txt
+share/mcabber/help/en/hlp_status_to.txt
+share/mcabber/help/en/hlp_version.txt
+share/mcabber/help/fr/hlp.txt
+share/mcabber/help/fr/hlp_add.txt
+share/mcabber/help/fr/hlp_alias.txt
+share/mcabber/help/fr/hlp_authorization.txt
+share/mcabber/help/fr/hlp_bind.txt
+share/mcabber/help/fr/hlp_buffer.txt
+share/mcabber/help/fr/hlp_chat_disable.txt
+share/mcabber/help/fr/hlp_clear.txt
+share/mcabber/help/fr/hlp_color.txt
+share/mcabber/help/fr/hlp_connect.txt
+share/mcabber/help/fr/hlp_del.txt
+share/mcabber/help/fr/hlp_disconnect.txt
+share/mcabber/help/fr/hlp_echo.txt
+share/mcabber/help/fr/hlp_event.txt
+share/mcabber/help/fr/hlp_group.txt
+share/mcabber/help/fr/hlp_help.txt
+share/mcabber/help/fr/hlp_iline.txt
+share/mcabber/help/fr/hlp_info.txt
+share/mcabber/help/fr/hlp_module.txt
+share/mcabber/help/fr/hlp_move.txt
+share/mcabber/help/fr/hlp_msay.txt
+share/mcabber/help/fr/hlp_otr.txt
+share/mcabber/help/fr/hlp_otrpolicy.txt
+share/mcabber/help/fr/hlp_pgp.txt
+share/mcabber/help/fr/hlp_quit.txt
+share/mcabber/help/fr/hlp_rawxml.txt
+share/mcabber/help/fr/hlp_rename.txt
+share/mcabber/help/fr/hlp_request.txt
+share/mcabber/help/fr/hlp_room.txt
+share/mcabber/help/fr/hlp_roster.txt
+share/mcabber/help/fr/hlp_say.txt
+share/mcabber/help/fr/hlp_say_to.txt
+share/mcabber/help/fr/hlp_screen_refresh.txt
+share/mcabber/help/fr/hlp_set.txt
+share/mcabber/help/fr/hlp_source.txt
+share/mcabber/help/fr/hlp_status.txt
+share/mcabber/help/fr/hlp_status_to.txt
+share/mcabber/help/fr/hlp_version.txt
+share/mcabber/help/it/hlp.txt
+share/mcabber/help/it/hlp_add.txt
+share/mcabber/help/it/hlp_alias.txt
+share/mcabber/help/it/hlp_authorization.txt
+share/mcabber/help/it/hlp_bind.txt
+share/mcabber/help/it/hlp_buffer.txt
+share/mcabber/help/it/hlp_chat_disable.txt
+share/mcabber/help/it/hlp_clear.txt
+share/mcabber/help/it/hlp_color.txt
+share/mcabber/help/it/hlp_connect.txt
+share/mcabber/help/it/hlp_del.txt
+share/mcabber/help/it/hlp_disconnect.txt
+share/mcabber/help/it/hlp_echo.txt
+share/mcabber/help/it/hlp_event.txt
+share/mcabber/help/it/hlp_group.txt
+share/mcabber/help/it/hlp_help.txt
+share/mcabber/help/it/hlp_iline.txt
+share/mcabber/help/it/hlp_info.txt
+share/mcabber/help/it/hlp_module.txt
+share/mcabber/help/it/hlp_move.txt
+share/mcabber/help/it/hlp_msay.txt
+share/mcabber/help/it/hlp_otr.txt
+share/mcabber/help/it/hlp_otrpolicy.txt
+share/mcabber/help/it/hlp_pgp.txt
+share/mcabber/help/it/hlp_quit.txt
+share/mcabber/help/it/hlp_rawxml.txt
+share/mcabber/help/it/hlp_rename.txt
+share/mcabber/help/it/hlp_request.txt
+share/mcabber/help/it/hlp_room.txt
+share/mcabber/help/it/hlp_roster.txt
+share/mcabber/help/it/hlp_say.txt
+share/mcabber/help/it/hlp_say_to.txt
+share/mcabber/help/it/hlp_screen_refresh.txt
+share/mcabber/help/it/hlp_set.txt
+share/mcabber/help/it/hlp_source.txt
+share/mcabber/help/it/hlp_status.txt
+share/mcabber/help/it/hlp_status_to.txt
+share/mcabber/help/it/hlp_version.txt
+share/mcabber/help/nl/hlp.txt
+share/mcabber/help/nl/hlp_add.txt
+share/mcabber/help/nl/hlp_alias.txt
+share/mcabber/help/nl/hlp_authorization.txt
+share/mcabber/help/nl/hlp_bind.txt
+share/mcabber/help/nl/hlp_buffer.txt
+share/mcabber/help/nl/hlp_chat_disable.txt
+share/mcabber/help/nl/hlp_clear.txt
+share/mcabber/help/nl/hlp_color.txt
+share/mcabber/help/nl/hlp_connect.txt
+share/mcabber/help/nl/hlp_del.txt
+share/mcabber/help/nl/hlp_disconnect.txt
+share/mcabber/help/nl/hlp_echo.txt
+share/mcabber/help/nl/hlp_event.txt
+share/mcabber/help/nl/hlp_group.txt
+share/mcabber/help/nl/hlp_help.txt
+share/mcabber/help/nl/hlp_iline.txt
+share/mcabber/help/nl/hlp_info.txt
+share/mcabber/help/nl/hlp_module.txt
+share/mcabber/help/nl/hlp_move.txt
+share/mcabber/help/nl/hlp_msay.txt
+share/mcabber/help/nl/hlp_otr.txt
+share/mcabber/help/nl/hlp_otrpolicy.txt
+share/mcabber/help/nl/hlp_pgp.txt
+share/mcabber/help/nl/hlp_quit.txt
+share/mcabber/help/nl/hlp_rawxml.txt
+share/mcabber/help/nl/hlp_rename.txt
+share/mcabber/help/nl/hlp_request.txt
+share/mcabber/help/nl/hlp_room.txt
+share/mcabber/help/nl/hlp_roster.txt
+share/mcabber/help/nl/hlp_say.txt
+share/mcabber/help/nl/hlp_say_to.txt
+share/mcabber/help/nl/hlp_screen_refresh.txt
+share/mcabber/help/nl/hlp_set.txt
+share/mcabber/help/nl/hlp_source.txt
+share/mcabber/help/nl/hlp_status.txt
+share/mcabber/help/nl/hlp_status_to.txt
+share/mcabber/help/nl/hlp_version.txt
+share/mcabber/help/pl/hlp.txt
+share/mcabber/help/pl/hlp_add.txt
+share/mcabber/help/pl/hlp_alias.txt
+share/mcabber/help/pl/hlp_authorization.txt
+share/mcabber/help/pl/hlp_bind.txt
+share/mcabber/help/pl/hlp_buffer.txt
+share/mcabber/help/pl/hlp_chat_disable.txt
+share/mcabber/help/pl/hlp_clear.txt
+share/mcabber/help/pl/hlp_color.txt
+share/mcabber/help/pl/hlp_connect.txt
+share/mcabber/help/pl/hlp_del.txt
+share/mcabber/help/pl/hlp_disconnect.txt
+share/mcabber/help/pl/hlp_echo.txt
+share/mcabber/help/pl/hlp_event.txt
+share/mcabber/help/pl/hlp_group.txt
+share/mcabber/help/pl/hlp_help.txt
+share/mcabber/help/pl/hlp_iline.txt
+share/mcabber/help/pl/hlp_info.txt
+share/mcabber/help/pl/hlp_module.txt
+share/mcabber/help/pl/hlp_move.txt
+share/mcabber/help/pl/hlp_msay.txt
+share/mcabber/help/pl/hlp_otr.txt
+share/mcabber/help/pl/hlp_otrpolicy.txt
+share/mcabber/help/pl/hlp_pgp.txt
+share/mcabber/help/pl/hlp_quit.txt
+share/mcabber/help/pl/hlp_rawxml.txt
+share/mcabber/help/pl/hlp_rename.txt
+share/mcabber/help/pl/hlp_request.txt
+share/mcabber/help/pl/hlp_room.txt
+share/mcabber/help/pl/hlp_roster.txt
+share/mcabber/help/pl/hlp_say.txt
+share/mcabber/help/pl/hlp_say_to.txt
+share/mcabber/help/pl/hlp_screen_refresh.txt
+share/mcabber/help/pl/hlp_set.txt
+share/mcabber/help/pl/hlp_source.txt
+share/mcabber/help/pl/hlp_status.txt
+share/mcabber/help/pl/hlp_status_to.txt
+share/mcabber/help/pl/hlp_version.txt
+share/mcabber/help/ru/hlp.txt
+share/mcabber/help/ru/hlp_add.txt
+share/mcabber/help/ru/hlp_alias.txt
+share/mcabber/help/ru/hlp_authorization.txt
+share/mcabber/help/ru/hlp_bind.txt
+share/mcabber/help/ru/hlp_buffer.txt
+share/mcabber/help/ru/hlp_chat_disable.txt
+share/mcabber/help/ru/hlp_clear.txt
+share/mcabber/help/ru/hlp_color.txt
+share/mcabber/help/ru/hlp_connect.txt
+share/mcabber/help/ru/hlp_del.txt
+share/mcabber/help/ru/hlp_disconnect.txt
+share/mcabber/help/ru/hlp_echo.txt
+share/mcabber/help/ru/hlp_event.txt
+share/mcabber/help/ru/hlp_group.txt
+share/mcabber/help/ru/hlp_help.txt
+share/mcabber/help/ru/hlp_iline.txt
+share/mcabber/help/ru/hlp_info.txt
+share/mcabber/help/ru/hlp_module.txt
+share/mcabber/help/ru/hlp_move.txt
+share/mcabber/help/ru/hlp_msay.txt
+share/mcabber/help/ru/hlp_otr.txt
+share/mcabber/help/ru/hlp_otrpolicy.txt
+share/mcabber/help/ru/hlp_pgp.txt
+share/mcabber/help/ru/hlp_quit.txt
+share/mcabber/help/ru/hlp_rawxml.txt
+share/mcabber/help/ru/hlp_rename.txt
+share/mcabber/help/ru/hlp_request.txt
+share/mcabber/help/ru/hlp_room.txt
+share/mcabber/help/ru/hlp_roster.txt
+share/mcabber/help/ru/hlp_say.txt
+share/mcabber/help/ru/hlp_say_to.txt
+share/mcabber/help/ru/hlp_screen_refresh.txt
+share/mcabber/help/ru/hlp_set.txt
+share/mcabber/help/ru/hlp_source.txt
+share/mcabber/help/ru/hlp_status.txt
+share/mcabber/help/ru/hlp_status_to.txt
+share/mcabber/help/ru/hlp_version.txt
+share/mcabber/help/uk/hlp.txt
+share/mcabber/help/uk/hlp_add.txt
+share/mcabber/help/uk/hlp_alias.txt
+share/mcabber/help/uk/hlp_authorization.txt
+share/mcabber/help/uk/hlp_bind.txt
+share/mcabber/help/uk/hlp_buffer.txt
+share/mcabber/help/uk/hlp_chat_disable.txt
+share/mcabber/help/uk/hlp_clear.txt
+share/mcabber/help/uk/hlp_color.txt
+share/mcabber/help/uk/hlp_connect.txt
+share/mcabber/help/uk/hlp_del.txt
+share/mcabber/help/uk/hlp_disconnect.txt
+share/mcabber/help/uk/hlp_echo.txt
+share/mcabber/help/uk/hlp_event.txt
+share/mcabber/help/uk/hlp_group.txt
+share/mcabber/help/uk/hlp_help.txt
+share/mcabber/help/uk/hlp_iline.txt
+share/mcabber/help/uk/hlp_info.txt
+share/mcabber/help/uk/hlp_module.txt
+share/mcabber/help/uk/hlp_move.txt
+share/mcabber/help/uk/hlp_msay.txt
+share/mcabber/help/uk/hlp_otr.txt
+share/mcabber/help/uk/hlp_otrpolicy.txt
+share/mcabber/help/uk/hlp_pgp.txt
+share/mcabber/help/uk/hlp_quit.txt
+share/mcabber/help/uk/hlp_rawxml.txt
+share/mcabber/help/uk/hlp_rename.txt
+share/mcabber/help/uk/hlp_request.txt
+share/mcabber/help/uk/hlp_room.txt
+share/mcabber/help/uk/hlp_roster.txt
+share/mcabber/help/uk/hlp_say.txt
+share/mcabber/help/uk/hlp_say_to.txt
+share/mcabber/help/uk/hlp_screen_refresh.txt
+share/mcabber/help/uk/hlp_set.txt
+share/mcabber/help/uk/hlp_source.txt
+share/mcabber/help/uk/hlp_status.txt
+share/mcabber/help/uk/hlp_status_to.txt
+share/mcabber/help/uk/hlp_version.txt
diff --git a/chat/mcabber/distinfo b/chat/mcabber/distinfo
new file mode 100644
index 00000000000..c0210e324ba
--- /dev/null
+++ b/chat/mcabber/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+SHA1 (mcabber-0.10.2.tar.bz2) = 7bff70dcf09e8a8a4cc7219e03b48bad382a6bda
+RMD160 (mcabber-0.10.2.tar.bz2) = 16f82605b9b0c81e9627a4197653cfd991773c78
+Size (mcabber-0.10.2.tar.bz2) = 604378 bytes
+SHA1 (patch-aa) = 6c340bae29a7ba66a911ad94bef4aca8d8a08751
+SHA1 (patch-configure) = f681202f7069d2c2abcc8dddd94dd8ce46a7e421
+SHA1 (patch-mcabber_otr.c) = 9d69418a96f1867d402de191c93314f3bd5ea597
+SHA1 (patch-mcabber_otr.h) = d8b2a3b85ae3bd87831a5a265ba68ee13cdb4450
diff --git a/chat/mcabber/options.mk b/chat/mcabber/options.mk
new file mode 100644
index 00000000000..b31dcb22265
--- /dev/null
+++ b/chat/mcabber/options.mk
@@ -0,0 +1,34 @@
+# $NetBSD: options.mk,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.mcabber
+PKG_SUPPORTED_OPTIONS= aspell enchant gpgme otr ssl
+PKG_SUGGESTED_OPTIONS= gpgme otr ssl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mgpgme)
+.include "../../security/gpgme/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-gpgme
+.endif
+
+.if !empty(PKG_OPTIONS:Motr)
+.include "../../chat/libotr/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-otr
+.endif
+
+.if !empty(PKG_OPTIONS:Maspell)
+.include "../../textproc/aspell/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-aspell
+.endif
+
+.if !empty(PKG_OPTIONS:Menchant)
+.include "../../textproc/enchant/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-enchant
+.endif
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-ssl
+.endif
diff --git a/chat/mcabber/patches/patch-aa b/chat/mcabber/patches/patch-aa
new file mode 100644
index 00000000000..cdd9a2d8e04
--- /dev/null
+++ b/chat/mcabber/patches/patch-aa
@@ -0,0 +1,22 @@
+$NetBSD: patch-aa,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+Handle correctly panel on NetBSD, not sure it is correct in general
+
+--- mcabber/screen.h.orig 2012-12-02 13:27:32.000000000 +0000
++++ mcabber/screen.h
+@@ -7,14 +7,12 @@
+
+ #if HAVE_NCURSESW_NCURSES_H
+ # include <ncursesw/ncurses.h>
+-# include <ncursesw/panel.h>
+ #elif HAVE_NCURSES_NCURSES_H
+ # include <ncurses/ncurses.h>
+-# include <ncurses/panel.h>
+ #else
+ # include <ncurses.h>
+-# include <panel.h>
+ #endif
++# include <panel.h>
+
+ #if defined(WITH_ENCHANT) || defined(WITH_ASPELL)
+ void spellcheck_init(void);
diff --git a/chat/mcabber/patches/patch-configure b/chat/mcabber/patches/patch-configure
new file mode 100644
index 00000000000..7ac08a4fd83
--- /dev/null
+++ b/chat/mcabber/patches/patch-configure
@@ -0,0 +1,238 @@
+$NetBSD: patch-configure,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+Fix libotr>=4 detection.
+
+--- configure.orig 2012-12-02 13:30:10.000000000 +0000
++++ configure
+@@ -15502,7 +15502,7 @@ else
+ fi
+
+ if test "x$enable_otr" = "xyes"; then
+- # Look for libgcrypt and libotr
++ # Look for libgcrypt and libotr
+
+ # Check whether --with-libgcrypt-prefix was given.
+ if test "${with_libgcrypt_prefix+set}" = set; then :
+@@ -15687,7 +15687,182 @@ $as_echo "does not match. want=$req_libg
+ LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
+ LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+
+- libotr_save_CFLAGS="$CFLAGS"
++ libotr_save_CFLAGS="$CFLAGS"
++libotr_save_LDFLAGS="$LDFLAGS"
++libotr_save_LIBS="$LIBS"
++libotr_found=yes
++
++
++# Check whether --with-libotr-prefix was given.
++if test "${with_libotr_prefix+set}" = set; then :
++ withval=$with_libotr_prefix; libotr_prefix="$withval"
++else
++ libotr_prefix=""
++fi
++
++
++
++# Check whether --with-libotr-inc-prefix was given.
++if test "${with_libotr_inc_prefix+set}" = set; then :
++ withval=$with_libotr_inc_prefix; libotr_inc_prefix="$withval"
++else
++ libotr_inc_prefix=""
++fi
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr CFLAGS" >&5
++$as_echo_n "checking for libotr CFLAGS... " >&6; }
++if test "$libotr_inc_prefix" != "" ; then
++ LIBOTR_CFLAGS="$LIBOTR_CFLAGS -I$libotr_inc_prefix"
++ CFLAGS="$CFLAGS $LIBOTR_CFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTR_CFLAGS" >&5
++$as_echo "$LIBOTR_CFLAGS" >&6; }
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr LIBS" >&5
++$as_echo_n "checking for libotr LIBS... " >&6; }
++if test "$libotr_prefix" != "" ; then
++ LIBOTR_LIBS="$LIBOTR_LIBS -L$libotr_prefix"
++ LDFLAGS="$LDFLAGS $LIBOTR_LIBS"
++fi
++
++LIBOTR_LIBS="$LIBOTR_LIBS -lotr"
++LIBS="$LIBOTR_LIBS $LIBS"
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTR_LIBS" >&5
++$as_echo "$LIBOTR_LIBS" >&6; }
++
++min_libotr_version=4.0.0
++no_libotr=""
++ libotr_min_major_version=`echo $min_libotr_version | \
++ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
++ libotr_min_minor_version=`echo $min_libotr_version | \
++ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
++ libotr_min_sub_version=`echo $min_libotr_version | \
++ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotr headers version $libotr_min_major_version.x >= $min_libotr_version" >&5
++$as_echo_n "checking for libotr headers version $libotr_min_major_version.x >= $min_libotr_version... " >&6; }
++
++
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++#include <stdlib.h>
++#include <libotr/version.h>
++
++int
++main ()
++{
++
++# if(OTRL_VERSION_MAJOR != $libotr_min_major_version)
++# error not present
++# else
++
++# if(OTRL_VERSION_MINOR > $libotr_min_minor_version)
++ exit(0);
++# else
++# if(OTRL_VERSION_MINOR < $libotr_min_minor_version)
++# error not present
++# endif
++
++# if(OTRL_VERSION_SUB < $libotr_min_sub_version)
++# error not present
++# endif
++# endif
++# endif
++exit(0);
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5
++$as_echo "found." >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5
++$as_echo "not present." >&6; }
++
++ libotr_found=no
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for otrl_message_receiving in -lotr" >&5
++$as_echo_n "checking for otrl_message_receiving in -lotr... " >&6; }
++if ${ac_cv_lib_otr_otrl_message_receiving+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lotr $LIBGCRYPT_LIBS
++ $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char otrl_message_receiving ();
++int
++main ()
++{
++return otrl_message_receiving ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_otr_otrl_message_receiving=yes
++else
++ ac_cv_lib_otr_otrl_message_receiving=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_otr_otrl_message_receiving" >&5
++$as_echo "$ac_cv_lib_otr_otrl_message_receiving" >&6; }
++if test "x$ac_cv_lib_otr_otrl_message_receiving" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBOTR 1
++_ACEOF
++
++ LIBS="-lotr $LIBS"
++
++else
++
++ libotr_found=no
++fi
++
++
++LDFLAGS="$libotr_save_LDFLAGS"
++LIBS="$libotr_save_LIBS"
++
++if test "x$libotr_found" = "xyes" ; then
++
++
++$as_echo "#define HAVE_LIBOTR 1" >>confdefs.h
++
++
++else
++ LIBOTR_CFLAGS=""
++ LIBOTR_LIBS=""
++
++ libotr_save_CFLAGS="$CFLAGS"
+ libotr_save_LDFLAGS="$LDFLAGS"
+ libotr_save_LIBS="$LIBS"
+ libotr_found=yes
+@@ -15853,11 +16028,26 @@ LDFLAGS="$libotr_save_LDFLAGS"
+ LIBS="$libotr_save_LIBS"
+
+ if test "x$libotr_found" = "xyes" ; then
+- :
++
++
++$as_echo "#define HAVE_LIBOTR 1" >>confdefs.h
++
++
++$as_echo "#define HAVE_LIBOTR3 1" >>confdefs.h
++
++
+ else
+ LIBOTR_CFLAGS=""
+ LIBOTR_LIBS=""
+- as_fn_error $? "libotr 3.1.0 or newer is required." "$LINENO" 5
++
++ as_fn_error $? "libotr 3.1.0 or newer is required." "$LINENO" 5
++
++fi
++
++
++
++
++
+ fi
+
+
+@@ -15890,7 +16080,8 @@ $as_echo "$as_me: WARNING:
+ else
+ LIBGCRYPT_CFLAGS=""
+ LIBGCRYPT_LIBS=""
+- as_fn_error $? "libgcrypt 1.2.2 or newer is required." "$LINENO" 5
++
++ as_fn_error $? "libgcrypt 1.2.2 or newer is required." "$LINENO" 5
+
+ fi
+
diff --git a/chat/mcabber/patches/patch-mcabber_otr.c b/chat/mcabber/patches/patch-mcabber_otr.c
new file mode 100644
index 00000000000..2524b018cdd
--- /dev/null
+++ b/chat/mcabber/patches/patch-mcabber_otr.c
@@ -0,0 +1,541 @@
+$NetBSD: patch-mcabber_otr.c,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+Fix libotr>=4 build.
+
+--- mcabber/otr.c.orig 2012-12-02 13:27:32.000000000 +0000
++++ mcabber/otr.c
+@@ -56,6 +56,20 @@ static void cb_inject_message
+ const char *protocol,
+ const char *recipient,
+ const char *message);
++static void cb_update_context_list(void *opdata);
++static void cb_new_fingerprint (void *opdata, OtrlUserState us,
++ const char *accountname,
++ const char *protocol,
++ const char *username,
++ unsigned char fingerprint[20]);
++static void cb_write_fingerprints (void *opdata);
++static void cb_gone_secure (void *opdata, ConnContext *context);
++static void cb_gone_insecure (void *opdata, ConnContext *context);
++static void cb_still_secure (void *opdata, ConnContext *context,
++ int is_reply);
++static int cb_max_message_size (void *opdata, ConnContext *context);
++
++#ifdef HAVE_LIBOTR3
+ static void cb_notify (void *opdata,
+ OtrlNotifyLevel level,
+ const char *accountname,
+@@ -69,22 +83,26 @@ static int cb_display_otr_message
+ const char *protocol,
+ const char *username,
+ const char *msg);
+-static void cb_update_context_list(void *opdata);
+ static const char *cb_protocol_name (void *opdata, const char *protocol);
+ static void cb_protocol_name_free (void *opdata,
+ const char *protocol_name);
+-static void cb_new_fingerprint (void *opdata, OtrlUserState us,
+- const char *accountname,
+- const char *protocol,
+- const char *username,
+- unsigned char fingerprint[20]);
+-static void cb_write_fingerprints (void *opdata);
+-static void cb_gone_secure (void *opdata, ConnContext *context);
+-static void cb_gone_insecure (void *opdata, ConnContext *context);
+-static void cb_still_secure (void *opdata, ConnContext *context,
+- int is_reply);
+ static void cb_log_message (void *opdata, const char *message);
+-static int cb_max_message_size (void *opdata, ConnContext *context);
++
++static void otr_handle_smp_tlvs (OtrlTLV *tlvs, ConnContext *ctx);
++#else /* HAVE_LIBOTR3 */
++static char *tagfile = NULL;
++static guint otr_timer_source = 0;
++
++static void cb_handle_smp_event (void *opdata, OtrlSMPEvent event,
++ ConnContext *context, unsigned short percent,
++ char *question);
++static void cb_handle_msg_event (void *opdata, OtrlMessageEvent event,
++ ConnContext *context, const char *message,
++ gcry_error_t err);
++static void cb_create_instag (void *opdata, const char *accountname,
++ const char *protocol);
++static void cb_timer_control (void *opdata, unsigned int interval);
++#endif /* HAVE_LIBOTR3 */
+
+ static OtrlMessageAppOps ops =
+ {
+@@ -92,26 +110,44 @@ static OtrlMessageAppOps ops =
+ cb_create_privkey,
+ cb_is_logged_in,
+ cb_inject_message,
++#ifdef HAVE_LIBOTR3
+ cb_notify,
+ cb_display_otr_message,
++#endif
+ cb_update_context_list,
++#ifdef HAVE_LIBOTR3
+ cb_protocol_name,
+ cb_protocol_name_free,
++#endif
+ cb_new_fingerprint,
+ cb_write_fingerprints,
+ cb_gone_secure,
+ cb_gone_insecure,
+ cb_still_secure,
++#ifdef HAVE_LIBOTR3
+ cb_log_message,
++#endif
+ cb_max_message_size,
+- NULL, /*account_name*/
+- NULL /*account_name_free*/
++ NULL, /* account_name */
++ NULL, /* account_name_free */
++#ifndef HAVE_LIBOTR3
++ NULL, /* received_symkey */
++ NULL, /* otr_error_message */
++ NULL, /* otr_error_message_free */
++ NULL, /* resent_msg_prefix */
++ NULL, /* resent_msg_prefix_free */
++ cb_handle_smp_event,
++ cb_handle_msg_event,
++ cb_create_instag,
++ NULL, /* convert_msg */
++ NULL, /* convert_free */
++ cb_timer_control,
++#endif
+ };
+
+ static void otr_message_disconnect(ConnContext *ctx);
+ static ConnContext *otr_get_context(const char *buddy);
+ static void otr_startstop(const char *buddy, int start);
+-static void otr_handle_smp_tlvs(OtrlTLV *tlvs, ConnContext *ctx);
+
+ static char *otr_get_dir(void);
+
+@@ -135,7 +171,6 @@ void otr_init(const char *fjid)
+ account = jidtodisp(fjid);
+ keyfile = g_strdup_printf("%s%s.key", root, account);
+ fprfile = g_strdup_printf("%s%s.fpr", root, account);
+- g_free(root);
+
+ if (otrl_privkey_read(userstate, keyfile)){
+ scr_LogPrint(LPRINT_LOGNORM, "Could not read OTR key from %s", keyfile);
+@@ -145,6 +180,14 @@ void otr_init(const char *fjid)
+ scr_LogPrint(LPRINT_LOGNORM, "Could not read OTR fingerprints from %s",
+ fprfile);
+ }
++#ifndef HAVE_LIBOTR3
++ tagfile = g_strdup_printf("%s%s.tag", root, account);
++ if (otrl_instag_read(userstate, tagfile)) {
++ scr_LogPrint(LPRINT_LOGNORM, "Could not read OTR instance tag from %s", tagfile);
++ cb_create_instag(NULL, account, OTR_PROTOCOL_NAME);
++ }
++#endif
++ g_free(root);
+ }
+
+ void otr_terminate(void)
+@@ -154,6 +197,13 @@ void otr_terminate(void)
+ if (!otr_is_enabled)
+ return;
+
++#ifndef HAVE_LIBOTR3
++ if (otr_timer_source > 0) {
++ g_source_remove (otr_timer_source);
++ otr_timer_source = 0;
++ }
++#endif
++
+ for (ctx = userstate->context_root; ctx; ctx = ctx->next)
+ if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED)
+ otr_message_disconnect(ctx);
+@@ -175,6 +225,12 @@ void otr_terminate(void)
+ userstate = NULL;
+ g_free(keyfile);
+ keyfile = NULL;
++ g_free(fprfile);
++ fprfile = NULL;
++#ifndef HAVE_LIBOTR3
++ g_free(tagfile);
++ tagfile = NULL;
++#endif
+ }
+
+ static char *otr_get_dir(void)
+@@ -206,7 +262,12 @@ static ConnContext *otr_get_context(cons
+
+ mc_strtolower(lowcasebuddy);
+ ctx = otrl_context_find(userstate, lowcasebuddy, account, OTR_PROTOCOL_NAME,
++#ifdef HAVE_LIBOTR3
+ 1, &null, NULL, NULL);
++#else
++ // INSTAG XXX
++ OTRL_INSTAG_BEST, 1, &null, NULL, NULL);
++#endif
+ g_free(lowcasebuddy);
+ return ctx;
+ }
+@@ -216,7 +277,12 @@ static void otr_message_disconnect(ConnC
+ if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED)
+ cb_gone_insecure(NULL, ctx);
+ otrl_message_disconnect(userstate, &ops, NULL, ctx->accountname,
++#ifdef HAVE_LIBOTR3
+ ctx->protocol, ctx->username);
++#else
++ // INSTAG XXX
++ ctx->protocol, ctx->username, OTRL_INSTAG_BEST);
++#endif
+ }
+
+ static void otr_startstop(const char *buddy, int start)
+@@ -283,6 +349,8 @@ void otr_fingerprint(const char *buddy,
+ cb_write_fingerprints(NULL);
+ }
+
++#ifdef HAVE_LIBOTR3
++
+ static void otr_handle_smp_tlvs(OtrlTLV *tlvs, ConnContext *ctx)
+ {
+ OtrlTLV *tlv = NULL;
+@@ -354,6 +422,130 @@ static void otr_handle_smp_tlvs(OtrlTLV
+ }
+ }
+
++#else /* HAVE_LIBOTR3 */
++
++static void cb_handle_smp_event(void *opdata, OtrlSMPEvent event,
++ ConnContext *context, unsigned short percent,
++ char *question)
++{
++ const char *msg = NULL;
++ char *freeme = NULL;
++ switch (event) {
++ case OTRL_SMPEVENT_ASK_FOR_SECRET:
++ msg = freeme = g_strdup_printf("OTR: Socialist Millionaires' Protocol: "
++ "Received SMP Initiation.\n"
++ "Answer with /otr smpr %s $secret",
++ context->username);
++ break;
++ case OTRL_SMPEVENT_ASK_FOR_ANSWER:
++ msg = freeme = g_strdup_printf("OTR: Socialist Millionaires' Protocol: "
++ "Received SMP Initiation.\n"
++ "Answer with /otr smpr %s $secret\n"
++ "Question: %s", context->username,
++ question);
++ break;
++ case OTRL_SMPEVENT_CHEATED:
++ msg = "OTR: Socialist Millionaires' Protocol: Correspondent cancelled negotiation!";
++ otrl_message_abort_smp(userstate, &ops, opdata, context);
++ break;
++ case OTRL_SMPEVENT_IN_PROGRESS:
++ scr_log_print(LPRINT_DEBUG, "OTR: Socialist Millionaires' Protocol: "
++ "Negotiation is in pogress...");
++ break;
++ case OTRL_SMPEVENT_SUCCESS:
++ msg = "OTR: Socialist Millionaires' Protocol: Success!";
++ break;
++ case OTRL_SMPEVENT_FAILURE:
++ msg = "OTR: Socialist Millionaires' Protocol: Failure.";
++ break;
++ case OTRL_SMPEVENT_ABORT:
++ msg = "OTR: Socialist Millionaires' Protocol: Aborted.";
++ break;
++ case OTRL_SMPEVENT_ERROR:
++ msg = "OTR: Socialist Millionaires' Protocol: Error occured, aborting negotiations!";
++ otrl_message_abort_smp(userstate, &ops, opdata, context);
++ break;
++ default:
++ break;
++ }
++
++ if (msg) {
++ scr_WriteIncomingMessage(context->username, msg, 0, HBB_PREFIX_INFO, 0);
++ g_free(freeme);
++ }
++}
++
++static void cb_handle_msg_event(void *opdata, OtrlMessageEvent event,
++ ConnContext *context, const char *message,
++ gcry_error_t err)
++{
++ const char *msg = NULL;
++ char *freeme = NULL;
++ switch (event) {
++ case OTRL_MSGEVENT_ENCRYPTION_REQUIRED:
++ msg = "OTR: Policy requires encryption on message!";
++ break;
++ case OTRL_MSGEVENT_ENCRYPTION_ERROR:
++ msg = "OTR: Encryption error! Message not sent.";
++ break;
++ case OTRL_MSGEVENT_CONNECTION_ENDED:
++ msg = "OTR: Connection closed by remote end, message lost. "
++ "Close or refresh connection.";
++ break;
++ case OTRL_MSGEVENT_SETUP_ERROR:
++ // FIXME
++ msg = freeme = g_strdup_printf("OTR: Error setting up private conversation: %u",
++ err);
++ break;
++ case OTRL_MSGEVENT_MSG_REFLECTED:
++ msg = "OTR: Received own OTR message!";
++ break;
++ case OTRL_MSGEVENT_MSG_RESENT:
++ msg = "OTR: Previous message was resent.";
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE:
++ msg = "OTR: Received encrypted message, but connection is not established " \
++ "yet! Message lost.";
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_UNREADABLE:
++ msg = "OTR: Unable to read incoming message!";
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_MALFORMED:
++ msg = "OTR: Malformed incoming message!";
++ break;
++ case OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD:
++ scr_log_print(LPRINT_DEBUG, "OTR: Received heartbeat.");
++ break;
++ case OTRL_MSGEVENT_LOG_HEARTBEAT_SENT:
++ scr_log_print(LPRINT_DEBUG, "OTR: Sent heartbeat.");
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR:
++ msg = freeme = g_strdup_printf("OTR: Received general otr error: %s",
++ message);
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED:
++ msg = freeme = g_strdup_printf("OTR: Received unencrypted message: %s",
++ message);
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED:
++ msg = "OTR: Unable to determine type of received OTR message!";
++ break;
++ case OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE:
++ // XXX
++ scr_log_print(LPRINT_DEBUG, "OTR: Received message for other instance.");
++ break;
++ default:
++ break;
++ }
++
++ if (msg) {
++ scr_WriteIncomingMessage(context->username, msg, 0, HBB_PREFIX_INFO, 0);
++ g_free(freeme);
++ }
++}
++
++#endif /* HAVE_LIBOTR3 */
++
+ /*
+ * returns whether a otr_message was received
+ * sets *otr_data to NULL, when it was an internal otr message
+@@ -362,8 +554,10 @@ int otr_receive(char **otr_data, const c
+ {
+ int ignore_message;
+ char *newmessage = NULL;
++#ifdef HAVE_LIBOTR3
+ OtrlTLV *tlvs = NULL;
+ OtrlTLV *tlv = NULL;
++#endif
+ ConnContext *ctx;
+
+ ctx = otr_get_context(buddy);
+@@ -371,8 +565,8 @@ int otr_receive(char **otr_data, const c
+ ignore_message = otrl_message_receiving(userstate, &ops, NULL,
+ ctx->accountname, ctx->protocol,
+ ctx->username, *otr_data,
+- &newmessage, &tlvs,NULL, NULL);
+-
++#ifdef HAVE_LIBOTR3
++ &newmessage, &tlvs, NULL, NULL);
+
+ tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED);
+ if (tlv) {
+@@ -387,6 +581,9 @@ int otr_receive(char **otr_data, const c
+
+ if (tlvs != NULL)
+ otrl_tlv_free(tlvs);
++#else
++ &newmessage, NULL, NULL, NULL, NULL);
++#endif
+
+ if (ignore_message)
+ *otr_data = NULL;
+@@ -410,13 +607,27 @@ int otr_send(char **msg, const char *bud
+
+ if (ctx->msgstate == OTRL_MSGSTATE_PLAINTEXT)
+ err = otrl_message_sending(userstate, &ops, NULL, ctx->accountname,
++#ifdef HAVE_LIBOTR3
+ ctx->protocol, ctx->username, *msg, NULL,
+ &newmessage, NULL, NULL);
++#else
++ // INSTAG XXX
++ ctx->protocol, ctx->username, OTRL_INSTAG_BEST,
++ *msg, NULL, &newmessage, OTRL_FRAGMENT_SEND_SKIP,
++ NULL, NULL, NULL);
++#endif
+ else {
+ htmlmsg = html_escape(*msg);
+ err = otrl_message_sending(userstate, &ops, NULL, ctx->accountname,
++#ifdef HAVE_LIBOTR3
+ ctx->protocol, ctx->username, htmlmsg, NULL,
+ &newmessage, NULL, NULL);
++#else
++ // INSTAG XXX
++ ctx->protocol, ctx->username, OTRL_INSTAG_BEST,
++ htmlmsg, NULL, &newmessage, OTRL_FRAGMENT_SEND_SKIP,
++ NULL, NULL, NULL);
++#endif
+ g_free(htmlmsg);
+ }
+
+@@ -648,6 +859,59 @@ static void cb_inject_message(void *opda
+ LM_MESSAGE_SUB_TYPE_NOT_SET, NULL);
+ }
+
++/* When the list of ConnContexts changes (including a change in
++ * state), this is called so the UI can be updated. */
++static void cb_update_context_list(void *opdata)
++{
++ /*maybe introduce new status characters for mcabber,
++ * then use this function (?!)*/
++}
++
++/* A new fingerprint for the given user has been received. */
++static void cb_new_fingerprint(void *opdata, OtrlUserState us,
++ const char *accountname, const char *protocol,
++ const char *username,
++ unsigned char fingerprint[20])
++{
++ char *sbuf = NULL;
++ char readable[45];
++
++ otrl_privkey_hash_to_human(readable, fingerprint);
++ sbuf = g_strdup_printf("OTR: new fingerprint: %s", readable);
++ scr_WriteIncomingMessage(username, sbuf, 0, HBB_PREFIX_INFO, 0);
++ g_free(sbuf);
++}
++
++/* The list of known fingerprints has changed. Write them to disk. */
++static void cb_write_fingerprints(void *opdata)
++{
++ otrl_privkey_write_fingerprints(userstate, fprfile);
++}
++
++/* A ConnContext has entered a secure state. */
++static void cb_gone_secure(void *opdata, ConnContext *context)
++{
++ scr_WriteIncomingMessage(context->username, "OTR: channel established", 0,
++ HBB_PREFIX_INFO, 0);
++}
++
++/* A ConnContext has left a secure state. */
++static void cb_gone_insecure(void *opdata, ConnContext *context)
++{
++ scr_WriteIncomingMessage(context->username, "OTR: channel closed", 0,
++ HBB_PREFIX_INFO, 0);
++}
++
++/* We have completed an authentication, using the D-H keys we
++ * already knew. is_reply indicates whether we initiated the AKE. */
++static void cb_still_secure(void *opdata, ConnContext *context, int is_reply)
++{
++ scr_WriteIncomingMessage(context->username, "OTR: channel reestablished", 0,
++ HBB_PREFIX_INFO, 0);
++}
++
++#ifdef HAVE_LIBOTR3
++
+ /* Display a notification message for a particular
+ * accountname / protocol / username conversation. */
+ static void cb_notify(void *opdata, OtrlNotifyLevel level,
+@@ -684,14 +948,6 @@ static int cb_display_otr_message(void *
+ return 0;
+ }
+
+-/* When the list of ConnContexts changes (including a change in
+- * state), this is called so the UI can be updated. */
+-static void cb_update_context_list(void *opdata)
+-{
+- /*maybe introduce new status characters for mcabber,
+- * then use this function (?!)*/
+-}
+-
+ /* Return a newly allocated string containing a human-friendly name
+ * for the given protocol id */
+ static const char *cb_protocol_name(void *opdata, const char *protocol)
+@@ -705,54 +961,40 @@ static void cb_protocol_name_free (void
+ /* We didn't allocated memory, so we don't have to free anything :p */
+ }
+
+-/* A new fingerprint for the given user has been received. */
+-static void cb_new_fingerprint(void *opdata, OtrlUserState us,
+- const char *accountname, const char *protocol,
+- const char *username,
+- unsigned char fingerprint[20])
++/* Log a message. The passed message will end in "\n". */
++static void cb_log_message(void *opdata, const char *message)
+ {
+- char *sbuf = NULL;
+- char readable[45];
+-
+- otrl_privkey_hash_to_human(readable, fingerprint);
+- sbuf = g_strdup_printf("OTR: new fingerprint: %s", readable);
+- scr_WriteIncomingMessage(username, sbuf, 0, HBB_PREFIX_INFO, 0);
+- g_free(sbuf);
++ scr_LogPrint(LPRINT_DEBUG, "OTR: %s", message);
+ }
+
+-/* The list of known fingerprints has changed. Write them to disk. */
+-static void cb_write_fingerprints(void *opdata)
+-{
+- otrl_privkey_write_fingerprints(userstate, fprfile);
+-}
++#else /* HAVE_LIBOTR3 */
+
+-/* A ConnContext has entered a secure state. */
+-static void cb_gone_secure(void *opdata, ConnContext *context)
++/* Generate unique instance tag for account. */
++static void cb_create_instag(void *opdata, const char *accountname,
++ const char *protocol)
+ {
+- scr_WriteIncomingMessage(context->username, "OTR: channel established", 0,
+- HBB_PREFIX_INFO, 0);
++ if (otrl_instag_generate(userstate, tagfile, accountname, protocol)) {
++ scr_LogPrint(LPRINT_LOGNORM, "OTR instance tag generation failed!");
++ }
+ }
+
+-/* A ConnContext has left a secure state. */
+-static void cb_gone_insecure(void *opdata, ConnContext *context)
++static gboolean otr_timer_cb(gpointer userdata)
+ {
+- scr_WriteIncomingMessage(context->username, "OTR: channel closed", 0,
+- HBB_PREFIX_INFO, 0);
++ otrl_message_poll(userstate, &ops, userdata);
++ return TRUE;
+ }
+
+-/* We have completed an authentication, using the D-H keys we
+- * already knew. is_reply indicates whether we initiated the AKE. */
+-static void cb_still_secure(void *opdata, ConnContext *context, int is_reply)
++static void cb_timer_control(void *opdata, unsigned int interval)
+ {
+- scr_WriteIncomingMessage(context->username, "OTR: channel reestablished", 0,
+- HBB_PREFIX_INFO, 0);
++ if (otr_timer_source > 0) {
++ g_source_remove(otr_timer_source);
++ otr_timer_source = 0;
++ }
++ if (interval > 0)
++ otr_timer_source = g_timeout_add_seconds(interval, otr_timer_cb, opdata);
+ }
+
+-/* Log a message. The passed message will end in "\n". */
+-static void cb_log_message(void *opdata, const char *message)
+-{
+- scr_LogPrint(LPRINT_DEBUG, "OTR: %s", message);
+-}
++#endif /* HAVE_LIBOTR3 */
+
+ /* Find the maximum message size supported by this protocol. */
+ static int cb_max_message_size(void *opdata, ConnContext *context)
diff --git a/chat/mcabber/patches/patch-mcabber_otr.h b/chat/mcabber/patches/patch-mcabber_otr.h
new file mode 100644
index 00000000000..144cf80e950
--- /dev/null
+++ b/chat/mcabber/patches/patch-mcabber_otr.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-mcabber_otr.h,v 1.1 2014/01/10 09:50:42 wiz Exp $
+
+Fix libotr>=4 build.
+
+--- mcabber/otr.h.orig 2012-12-02 13:27:32.000000000 +0000
++++ mcabber/otr.h
+@@ -5,6 +5,9 @@
+
+ #ifdef HAVE_LIBOTR
+
++#ifndef HAVE_LIBOTR3
++# include <libotr/instag.h>
++#endif
+ #include <libotr/proto.h>
+ #include <libotr/message.h>
+ #include <libotr/privkey.h>