[Pkg-privacy-commits] [irssi-plugin-otr] 18/267: finish when query is destroyed.
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:12 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 7849e516bd232579e0416cbec682b8a6f76be865
Author: Uli Meis <a.sporto+bee at gmail.com>
Date: Tue Jun 10 15:13:36 2008 +0200
finish when query is destroyed.
Also some build related changes.
---
CMakeLists.txt | 4 +---
HOWTO_PACKAGE | 4 ++--
Packaging-DEB.cmake | 3 +++
Packaging-RPM.cmake | 3 +++
Packaging.cmake | 15 ++++++++++++---
formats.txt | 2 +-
otr.c | 13 ++++++++++++-
otr.h | 2 +-
otrutil.c | 11 +++++++----
9 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d0ec5f..593f645 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -174,11 +174,9 @@ ADD_CSCOPE_TARGET("${CSANDHS}" "${IRSSIOTR_INCLUDE_DIRS}")
# Install / CPack
IF(CMAKE_BUILD_TYPE MATCHES "package-.*")
- SET(CMAKE_INSTALL_PREFIX "/usr/irssi/lib/")
INCLUDE(Packaging.cmake)
- INSTALL(TARGETS otr DESTINATION irssi/lib/modules)
- INSTALL(FILES README DESTINATION share/doc/${CMAKE_PROJECT_NAME}-${IRSSIOTR_VERSION})
ELSE(CMAKE_BUILD_TYPE MATCHES "package-.*")
INSTALL(SCRIPT cmake-extensions/InstallAsUser.cmake)
INSTALL(TARGETS otr DESTINATION modules/)
+ INSTALL(FILES README LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}-${IRSSIOTR_VERSION})
ENDIF(CMAKE_BUILD_TYPE MATCHES "package-.*")
diff --git a/HOWTO_PACKAGE b/HOWTO_PACKAGE
index 441efb2..382748f 100644
--- a/HOWTO_PACKAGE
+++ b/HOWTO_PACKAGE
@@ -2,10 +2,10 @@ Thanks for helping me with packaging.
You'll need cmake >= 2.6. In theory, all you should have to do is:
- $ cmake -DCMAKE_BUILD_TYPE=packaging-DEB /path/to/src
+ $ cmake -DCMAKE_BUILD_TYPE=package-deb /path/to/src
$ sudo make package
-For an RPM it should be packaging-RPM and for TGZ...you can imagine.
+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
diff --git a/Packaging-DEB.cmake b/Packaging-DEB.cmake
index c79cb87..1578ea6 100644
--- a/Packaging-DEB.cmake
+++ b/Packaging-DEB.cmake
@@ -1,3 +1,6 @@
+INSTALL(TARGETS otr DESTINATION lib/irssi/modules)
+INSTALL(FILES README LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}-${IRSSIOTR_VERSION})
+
SET(CPACK_GENERATOR DEB)
#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
SET(CPACK_DEBIAN_PACKAGE_SECTION "net")
diff --git a/Packaging-RPM.cmake b/Packaging-RPM.cmake
index d3928f6..7186046 100644
--- a/Packaging-RPM.cmake
+++ b/Packaging-RPM.cmake
@@ -1,3 +1,6 @@
+INSTALL(TARGETS otr DESTINATION lib/irssi/modules)
+INSTALL(FILES README DESTINATION share/doc/${CMAKE_PROJECT_NAME}-${IRSSIOTR_VERSION})
+
SET(CPACK_GENERATOR RPM)
SET(CPACK_RPM_PACKAGE_DEBUG)
SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
diff --git a/Packaging.cmake b/Packaging.cmake
index af72bec..28f10b6 100644
--- a/Packaging.cmake
+++ b/Packaging.cmake
@@ -17,11 +17,20 @@ SET(CPACK_PACKAGE_VERSION ${IRSSIOTR_VERSION})
IF(CMAKE_BUILD_TYPE STREQUAL "package-rpm")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(Packaging-RPM.cmake)
-ENDIF(CMAKE_BUILD_TYPE STREQUAL "package-rpm")
-IF(CMAKE_BUILD_TYPE STREQUAL "package-deb")
+ELSEIF(CMAKE_BUILD_TYPE STREQUAL "package-deb")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(Packaging-DEB.cmake)
-ENDIF(CMAKE_BUILD_TYPE STREQUAL "package-deb")
+ELSEIF(CMAKE_BUILD_TYPE STREQUAL "package-tgz")
+ INSTALL(TARGETS otr DESTINATION irssi/lib/modules)
+ INSTALL(FILES README LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}-${IRSSIOTR_VERSION})
+ELSE(CMAKE_BUILD_TYPE STREQUAL "package-rpm")
+ MESSAGE(FATAL_ERROR "Unknown build type '${CMAKE_BUILD_TYPE}'")
+ENDIF(CMAKE_BUILD_TYPE STREQUAL "package-rpm")
+
+
+
+#ENDIF(CMAKE_BUILD_TYPE STREQUAL "package-tgz")
+#ENDIF(CMAKE_BUILD_TYPE STREQUAL "package-deb")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/README)
#SET(CPACK_PACKAGE_VERSION_MAJOR "0")
diff --git a/formats.txt b/formats.txt
index b1d65ba..fae1b38 100644
--- a/formats.txt
+++ b/formats.txt
@@ -70,7 +70,7 @@ cmd_debug_on Debug mode is on
cmd_debug_off Debug mode is off
cmd_finish Finished conversation with %s
cmd_version This is irssi-otr version %s
-peer_finished %s has finished the OTR conversation
+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.
Nickignore
nickignore xmlconsole[0-9]*
Statusbar
diff --git a/otr.c b/otr.c
index 19cb28a..00ece98 100644
--- a/otr.c
+++ b/otr.c
@@ -70,6 +70,15 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
}
/*
+ * 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,FALSE);
+ }
+}
+
+/*
* /otr
*/
static void cmd_otr(const char *data,void *server,WI_ITEM_REC *item)
@@ -88,7 +97,7 @@ static void cmd_finish(const char *data, void *server, WI_ITEM_REC *item)
{
QUERY_REC *query = QUERY(item);
if (query&&query->server&&query->server->connrec) {
- otr_finish(query->server,query->name);
+ otr_finish(query->server,query->name,TRUE);
statusbar_items_redraw("otr");
}
else
@@ -227,6 +236,7 @@ void otr_init(void)
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("otr debug", NULL, (SIGNAL_FUNC) cmd_debug);
@@ -256,6 +266,7 @@ void otr_deinit(void)
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("otr debug", (SIGNAL_FUNC) cmd_debug);
diff --git a/otr.h b/otr.h
index 685d67f..b81c92d 100644
--- a/otr.h
+++ b/otr.h
@@ -99,7 +99,7 @@ ConnContext *otr_getcontext(const char *accname,const char *nick,int create,void
/* user interaction */
void otr_trust(SERVER_REC *server, char *nick);
-void otr_finish(SERVER_REC *server, char *nick);
+void otr_finish(SERVER_REC *server, char *nick,int inquery);
void otr_auth(SERVER_REC *server, char *nick, const char *secret);
void otr_authabort(SERVER_REC *server, char *nick);
char *otr_contexts();
diff --git a/otrutil.c b/otrutil.c
index 5e955e6..2b07c8e 100644
--- a/otrutil.c
+++ b/otrutil.c
@@ -271,7 +271,7 @@ int otr_getstatus(char *mynick, char *nick, char *server)
/*
* Finish the conversation.
*/
-void otr_finish(SERVER_REC *server, char *nick)
+void otr_finish(SERVER_REC *server, char *nick, int inquery)
{
ConnContext *co;
char accname[128];
@@ -279,15 +279,18 @@ void otr_finish(SERVER_REC *server, char *nick)
sprintf(accname, "%s@%s", server->nick, server->connrec->address);
if (!(co = otr_getcontext(accname,nick,FALSE,NULL))) {
- otr_noticest(TXT_CTX_NOT_FOUND,
- accname,nick);
+ if (inquery)
+ otr_noticest(TXT_CTX_NOT_FOUND,
+ accname,nick);
return;
}
otrl_message_disconnect(otr_state,&otr_ops,NULL,accname,
PROTOCOLID,nick);
- otr_notice(server,nick,TXT_CMD_FINISH,nick);
+ otr_notice(inquery ? server : NULL,
+ inquery ? nick : NULL,
+ TXT_CMD_FINISH,nick);
}
/*
--
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