[Pkg-privacy-commits] [irssi-plugin-otr] 60/267: No need for a buffer in incoming privmsgs.
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:28 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 6073a51c12637768c928423ba3a6fa7d89cd3117
Author: Uli Meis <a.sporto+bee at gmail.com>
Date: Tue Feb 10 11:57:44 2009 +0100
No need for a buffer in incoming privmsgs.
---
weechat/weechat_otr.c | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/weechat/weechat_otr.c b/weechat/weechat_otr.c
index 30532cf..b4e9e3f 100644
--- a/weechat/weechat_otr.c
+++ b/weechat/weechat_otr.c
@@ -135,8 +135,6 @@ char *wc_modifier_privmsg_in(void *data, const char *modifier,
char nick[256];
char *newmsg,*msg;
IRC_CTX ircctx;
- struct t_gui_buffer *buffer;
- char bname[256];
char cmsg[512];
string = strdup(string);
@@ -156,15 +154,7 @@ char *wc_modifier_privmsg_in(void *data, const char *modifier,
#endif
ircctx.address = server;
- sprintf(bname,"%s.%s",ircctx.address,nick);
- buffer = weechat_buffer_search("irc",bname);
- if (!buffer) {
- weechat_printf(NULL,"OTR receive: no buffer found for %s",bname);
- //TODO: create query window on demand
- goto done;
- }
-
- ircctx.nick = (char*)weechat_buffer_get_string(buffer,"localvar_nick");
+ ircctx.nick = argv[2];
msg = argv_eol[3]+1;
wc_debug(&ircctx,nick,"otr receive own %s, server %s, nick %s, msg %s",
@@ -180,18 +170,11 @@ char *wc_modifier_privmsg_in(void *data, const char *modifier,
goto done;
}
-/* weechat_printf_tags(buffer,
- irc_protocol_tags("privmsg", "notify_private"),
- "%s%s",
- irc_nick_as_prefix(NULL,nick,IRC_COLOR_CHAT_NICK_OTHER),
- "?");*/
-
- sprintf(cmsg,"%s\t%s",nick,newmsg);
- weechat_printf(buffer,cmsg);
+ snprintf(cmsg, 511, "%s %s %s :%s",argv[0],argv[1],argv[2],newmsg);
otrl_message_free(newmsg);
- string = strdup("");
+ string = strdup(cmsg);
done:
free(server);
weechat_string_free_exploded(argv);
@@ -240,6 +223,7 @@ char *wc_modifier_privmsg_out(void *data, const char *modifier,
goto done;
}
ircctx.nick = (char*)weechat_buffer_get_string(buffer,"localvar_nick");
+
wc_debug(&ircctx,argv[1],"otr send own %s, server %s, nick %s, msg %s",
ircctx.nick,ircctx.address,argv[1],msg);
otrmsg = otr_send(&ircctx,msg,argv[1]);
--
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