Commit 62aa59a8 authored by Konstantin Khomoutov's avatar Konstantin Khomoutov

Imported commit 'upstream/0.11.1'

parents 196b7ab6 a4c8fa6a
2008-10-15 Sergei Golovan <sgolovan@nes.ru>
* quotelastmsg/*, singularity/*, stripes/*: Added three new plugins
(thanks to Konstantin Khomoutov).
2008-08-26 Sergei Golovan <sgolovan@nes.ru>
* whiteboard/whiteboard.tcl: Converted draw actions back to radio
buttons (it's too inefficient to use popup menu for them). Transform
and remove actions are left in the popup menu.
* whiteboard/msgs/ru.msg: Updated Russian translation.
* README: Added description fo receipts and unixkeys plugins, cleared
description for ctcomp plugins (thanks to Konstantin Khomoutov).
* whiteboard/whiteboard.tcl: Fixed width of tools radiobuttons.
* whiteboard/msgs/de.msg: Updated German translation (thanks to Roger
Sondermann).
2008-08-08 Sergei Golovan <sgolovan@nes.ru>
* checkers/checkers.tcl, chess/chess.tcl, renju/renju.tcl,
reversi/reversi.tcl: Don't warn user about not received move replies
on disconnect.
* chess/chess.tcl: Added draw by repetition.
* chess/msgs/ru.msg: Updated Russian translation.
* chess/chess.tcl: Fixed bug with forbidden castling in case when
pieces has moved.
* chess/chess.tcl: Added possibility of castling and capture en passant
to position code when counting repetitions.
2008-07-12 Sergei Golovan <sgolovan@nes.ru>
* whiteboard/whiteboard.tcl: Fixed typo.
2008-07-09 Sergei Golovan <sgolovan@nes.ru>
* whiteboard/msgs/de.msg: Updated German translation (thanks to Roger
Sondermann).
2008-07-08 Sergei Golovan <sgolovan@nes.ru>
* whiteboard/svgrender.tcl: Fixed rotation transform. Changed id
canvas tags from id$id to [list id $id] form.
* whiteboard/whiteboard.tcl: Added several object transformations.
2008-07-07 Sergei Golovan <sgolovan@nes.ru>
* whiteboard/msgs/de.msg: Updated German translation (thanks to Roger
Sondermann).
2008-07-06 Sergei Golovan <sgolovan@nes.ru>
* whiteboard/svgrender.tcl: Reworked SVG rendering, made all existing
shapes transformable (except text), implemented all transformations,
added several new attributes (stroke-linecap, stroke-linejoin etc.).
Broken compatibility (the default outline color is empty now and not
black).
* whiteboard/whiteboard.tcl: Use svgrender for all elements rendering.
Added a new rectangular shape. Moved all actions to a popup menu
instead of radiobuttons. Added very preliminary (without user
interface yet) tranformation support.
2008-06-18 Sergei Golovan <sgolovan@nes.ru>
* cyrillize/cyrillize.tcl: Added cyrillize bindings to all text and
entry widgets.
2008-06-08 Sergei Golovan <sgolovan@nes.ru>
* unixkeys/README, unixkeys/TODO, unixkeys/unixkeys.tcl: Added
......
# $Id: Makefile 1458 2008-06-08 13:46:46Z sergei $
# $Id: Makefile 1513 2008-10-15 17:39:41Z sergei $
PREFIX = /usr/local
TKABBERPLUGINSDIR = $(PREFIX)/share/tkabber-plugins
......@@ -26,11 +26,14 @@ SUBDIRS = aniemoticons \
osd \
presencecmd \
quiz \
quotelastmsg \
receipts \
renju \
reversi \
singularity \
socials \
spy \
stripes \
tclchat \
tkabber-khim \
traffic \
......
......@@ -43,7 +43,9 @@ chess
ctcomp
Plugin adds support for "text completion" in Tkabber's chat
input windows. The source of completed words is a chat log window.
input windows which works like the similar features of the Vim and
Emacs text editors. The matching words are picked from the
corresponding chat log and input windows.
custom-urls
Provides regexp-based mechanism to convert strings with numbers to URLs
......@@ -101,6 +103,14 @@ presencecmd
quiz
Adaptation of He3hauka (a russian quiz game for IRC).
quotelastmsg
Quote the very last message in a chat window.
receipts
Implements XEP-0184 "Message receipts": in one-to-one chat sessions
it is able to request confirmations of reception of outgoing
messages and reply to such requests coming from remote party.
renju
Gomoku and Renju (in fact, renju is not implemented yet) game for two
players. When installed, you can send an invitation to your contact
......@@ -114,6 +124,9 @@ reversi
other player has also Tkabber and the plugin installed, he will
recieve the invitation. If he accepts, a window will open on both.
singularity
Keep conversation with one user in one window/tab.
socials
Adds many 'social' commands like /dance. Includes english and russian
files.
......@@ -122,6 +135,9 @@ spy
Logs your contacts presence changes to a window or to a file. Allows
to setup alert window for certain contacts.
stripes
Colorises chat window background for odd and even messages differently.
tclchat
Plugin, which makes chatting in Tclers' chat (tcl@tach.tclers.tk) easier.
It recognises a bot, which connects Jabber room with IRC channel, and maps
......@@ -137,6 +153,10 @@ traffic
is used. But even if the absolute values are incorrect, it still allows
to find which remote JID consumes the highest traffic amount.
unixkeys
Adds support for "Unix-style" (in fact, GNU Readline and GNU bash -style)
keyboard shortcuts for text editing to all text entry widgets in Tkabber.
whiteboard
Shared whiteboard, allows two contacts or a whole chatroom to draw
collaboratively.
......
# $Id: checkers.tcl 1354 2008-01-28 17:39:01Z sergei $
# $Id: checkers.tcl 1481 2008-08-08 10:48:29Z sergei $
package require msgcat
......@@ -1127,7 +1127,7 @@ proc checkers::send_move {gid move} {
}
proc checkers::send_result {gid res child} {
if {$res != "OK"} {
if {$res == "ERR"} {
attention_message $gid \
[format [::msgcat::mc "\n\n Opponent rejected move:\n %s\n\n"] \
[error_to_string $child]]
......
# $Id: chess.tcl 1354 2008-01-28 17:39:01Z sergei $
# $Id: chess.tcl 1486 2008-08-08 16:31:36Z sergei $
package require msgcat
......@@ -296,6 +296,8 @@ proc chess::make_default_position {gid} {
set flags(position,draw) 0
set flags(position,halfmove) 0
set flags(position,history) {}
set flags(position,repetitions) [list [code_position $gid] 1]
}
proc chess::save_position {gid} {
......@@ -316,6 +318,56 @@ proc chess::restore_position {gid} {
find_legal_moves $gid $flags(position,turn)
}
proc chess::code_position {gid} {
variable $gid
upvar 0 $gid flags
set code ""
for {set c 0} {$c < 8} {incr c} {
for {set r 0} {$r < 8} {incr r} {
switch -- $flags(position,$c,$r) {
wk {append code K}
wq {append code Q}
wr {append code R}
wb {append code B}
wn {append code N}
wp {append code P}
bk {append code k}
bq {append code q}
br {append code r}
bb {append code b}
bn {append code n}
bp {append code p}
default {append code .}
}
}
}
append code $flags(position,wk,kcastling)
append code $flags(position,wk,qcastling)
append code $flags(position,bk,kcastling)
append code $flags(position,bk,qcastling)
if {[llength $flags(position,enpassant)] > 0} {
lassign $flags(position,enpassant) c r
set cp1 [expr {$c + 1}]
set cm1 [expr {$c - 1}]
if {$r == 2} {
if {($cp1 < 8 && $flags(position,$cp1,3) == "bp") || \
($cm1 >= 0 && $flags(position,$cm1,3) == "bp")} {
append code $c$r
}
} elseif {$r == 5} {
if {($cp1 < 8 && $flags(position,$cp1,4) == "wp") || \
($cm1 >= 0 && $flags(position,$cm1,4) == "wp")} {
append code $c$r
}
}
}
return $code
}
proc chess::make_gid {jid id} {
jid_to_tag [concat $jid $id]
}
......@@ -926,14 +978,14 @@ proc chess::do_move {gid cf rf ct rt prom draw} {
if {$rt == (7 - $r)} {
if {$ct == 0} {
set flags(position,${opp},qcastling) 0
set flags(position,${opp}k,qcastling) 0
} elseif {$ct == 7} {
set flags(position,${opp},kcastling) 0
set flags(position,${opp}k,kcastling) 0
}
}
if {$flags(position,$ct,$rt) == "${p}k"} {
set flags(position,${p},kcastling) 0
set flags(position,${p},qcastling) 0
set flags(position,${p}k,kcastling) 0
set flags(position,${p}k,qcastling) 0
if {($ct - $cf) == 2} {
set opts {0-0}
set flags(position,5,$r) "${p}r"
......@@ -945,9 +997,9 @@ proc chess::do_move {gid cf rf ct rt prom draw} {
}
} elseif {$flags(position,$ct,$rt) == "${p}r"} {
if {($cf == 0) && ($rf == $r)} {
set flags(position,${p},qcastling) 0
set flags(position,${p}k,qcastling) 0
} elseif {($cf == 7) && ($rf == $r)} {
set flags(position,${p},kcastling) 0
set flags(position,${p}k,kcastling) 0
}
}
......@@ -1023,6 +1075,9 @@ proc chess::do_move {gid cf rf ct rt prom draw} {
}
lappend opts $prm $suffix
add_move_to_history $gid $cf $rf $ct $rt $f $opts
set repetitions [add_to_repetitions $gid]
if {$draw && !$my_move} {
attention_message $gid \
[::msgcat::mc "\n\n Opponent proposes a draw\n\n"]
......@@ -1033,8 +1088,11 @@ proc chess::do_move {gid cf rf ct rt prom draw} {
}
if {$stalemate} {
# Draw
# Draw by stalemate
end_game $gid 0.5 [::msgcat::mc "Draw (Stalemate)"]
} elseif {$repetitions >= 3} {
# Draw by repetition
end_game $gid 0.5 [::msgcat::mc "Draw (Repetition)"]
} elseif {$checkmate} {
if {$my_move} {
# I win
......@@ -1186,7 +1244,7 @@ proc chess::send_move {gid cf rf ct rt prom} {
}
proc chess::send_result {gid res child} {
if {$res != "OK"} {
if {$res == "ERR"} {
attention_message $gid \
[format [::msgcat::mc "\n\n Opponent rejected move:\n %s\n\n"] \
[error_to_string $child]]
......@@ -1206,6 +1264,21 @@ proc chess::make_move_tag {gid cf rf ct rt prom} {
}
}
proc chess::add_to_repetitions {gid} {
variable $gid
upvar 0 $gid flags
array set repetitions $flags(position,repetitions)
set code [code_position $gid]
if {[info exists repetitions($code)]} {
incr repetitions($code)
} else {
set repetitions($code) 1
}
set flags(position,repetitions) [array get repetitions]
return $repetitions($code)
}
proc chess::add_move_to_history {gid cf rf ct rt f opts} {
variable piece_name
variable $gid
......
......@@ -44,6 +44,7 @@
::msgcat::mcset ru "Opponent wins (You resigned)" "Оппонент выиграл (Вы сдались)"
::msgcat::mcset ru "You win (Opponent resigned)" "Вы выиграли (Оппонент сдался)"
::msgcat::mcset ru "Draw (Stalemate)" "Ничья (Пат)"
::msgcat::mcset ru "Draw (Repetition)" "Ничья (Повторение позиции)"
::msgcat::mcset ru "Draw (You accepted)" "Ничья (Вы приняли)"
::msgcat::mcset ru "Draw (Opponent accepted)" "Ничья (Оппонент принял)"
::msgcat::mcset ru "Press button and make move if you want propose draw" "Нажмите кнопку и сделайте ход, если хотите предложить ничью"
......
# $Id: cyrillize.tcl 869 2007-01-11 17:58:39Z sergei $
# $Id: cyrillize.tcl 1463 2008-06-18 11:29:09Z sergei $
namespace eval cyrillize {
}
......@@ -40,37 +40,65 @@ proc cyrillize::do {s from to} {
#puts [cyrillize::do Ghbdtn]
proc cyrillize::word {iw from to} {
set ins [lindex [split [$iw index insert] .] 1]
set line [$iw get "insert linestart" "insert lineend"]
set wordstart [string wordstart $line [expr $ins - 1]]
set wordend [clength [string trimright \
[crange $line 0 [expr $wordstart - 1]]]]
set word [crange $line $wordstart [expr $ins - 1]]
proc cyrillize::wordInText {w from to} {
if {[$w cget -state] != "normal"} return
set ins [lindex [split [$w index insert] .] 1]
set line [$w get "insert linestart" "insert lineend"]
set wordstart [string wordstart $line [expr {$ins-1}]]
set wordend [string length \
[string trimright \
[string range $line 0 [expr {$wordstart-1}]]]]
set word [string range $line $wordstart [expr {$ins-1}]]
set newword [do $word $from $to]
$iw delete "insert linestart +$wordstart chars" insert
$iw insert insert $newword
$w delete "insert linestart +$wordstart chars" insert
$w insert insert $newword
$iw mark set insert "insert linestart +$wordend chars"
$w mark set insert "insert linestart +$wordend chars"
}
event add <<Cyrillize-Eng-Rus>> <Control-quoteright>
event add <<Cyrillize-Eng-Rus>> <Control-yacute>
event add <<Cyrillize-Rus-Eng>> <Control-quotedbl>
event add <<Cyrillize-Rus-Eng>> <Control-Yacute>
proc cyrillize::wordInEntry {w from to} {
if {[$w cget -state] != "normal"} return
proc cyrillize::setup_bindings {chatid type} {
variable history
set ins [$w index insert]
set line [$w get]
set wordstart [string wordstart $line [expr {$ins-1}]]
set wordend [string length \
[string trimright \
[string range $line 0 [expr {$wordstart-1}]]]]
set word [string range $line $wordstart [expr {$ins-1}]]
set iw [chat::input_win $chatid]
bind $iw <<Cyrillize-Eng-Rus>> [list [namespace current]::word $iw eng rus]
bind $iw <<Cyrillize-Eng-Rus>> +break
bind $iw <<Cyrillize-Rus-Eng>> [list [namespace current]::word $iw rus eng]
bind $iw <<Cyrillize-Rus-Eng>> +break
}
set newword [do $word $from $to]
$w delete $wordstart insert
$w insert insert $newword
hook::add open_chat_post_hook [namespace current]::cyrillize::setup_bindings
$w icursor $wordend
}
event add <<Cyrillize-Eng-Rus>> <Control-quoteright>
event add <<Cyrillize-Eng-Rus>> <Control-yacute>
event add <<Cyrillize-Rus-Eng>> <Control-quotedbl>
event add <<Cyrillize-Rus-Eng>> <Control-Yacute>
bind Text <<Cyrillize-Eng-Rus>> \
[list [namespace current]::cyrillize::wordInText %W eng rus]
bind Text <<Cyrillize-Eng-Rus>> +break
bind Text <<Cyrillize-Rus-Eng>> \
[list [namespace current]::cyrillize::wordInText %W rus eng]
bind Text <<Cyrillize-Rus-Eng>> +break
bind Entry <<Cyrillize-Eng-Rus>> \
[list [namespace current]::cyrillize::wordInEntry %W eng rus]
bind Entry <<Cyrillize-Eng-Rus>> +break
bind Entry <<Cyrillize-Rus-Eng>> \
[list [namespace current]::cyrillize::wordInEntry %W rus eng]
bind Entry <<Cyrillize-Rus-Eng>> +break
bind BwEntry <<Cyrillize-Eng-Rus>> \
[list [namespace current]::cyrillize::wordInEntry %W eng rus]
bind BwEntry <<Cyrillize-Eng-Rus>> +break
bind BwEntry <<Cyrillize-Rus-Eng>> \
[list [namespace current]::cyrillize::wordInEntry %W rus eng]
bind BwEntry <<Cyrillize-Rus-Eng>> +break
Konstantin Khomoutov <flatworm@users.sourceforge.com>
As usually, copy this directory under the ~/.tkabber/plugins directory
so that you get a hierarchy like this:
~/.tkabber/plugins
~/.tkabber/plugins/quotelastmsg/
~/.tkabber/plugins/quotelastmsg/quotelastmsg.tcl
Restart Tkabber, to get the plugin loaded.
Consult the README file for the details about using this plugin.
$Id: README 1513 2008-10-15 17:39:41Z sergei $
"Quote last message" -- chat plugin for Tkabber.
I. The idea
This plugin provides a way to "quote" the message located at the
very bottom of the conversation log of a chat window -- that is,
to copy such message into the input box of the same chat window
with some decorations added (by default the ">> " string is
prepeneded to the message). By default, quoting is done using
the <Alt-q> keyboard shortcut.
The functionality provided by this plugin might come in handy
when you want to refer to someone else's (or your own) message
appeared in the course of the conversation.
II. Configuration
You can configure two parameters affecting the operation of this
plugin: actions triggering the quotation of the last message
and the format string used to decorate the message being quoted.
Message quoting action is bound to a Tk virtual event named
<<QuoteLastMessage>>. By default, it's bound to <Alt-q> (also to
<Meta-q> to accound for certain Unix systems).
To change the binding you will have to add appropriate
command(s) to the Tkabber configuration file. For instance, to
unbind this action from <Alt-q> and bind it to <Ctrl-Shift-m>
write this into your condig.tcl:
event delete <<QuoteLastMessage>> <Alt-q>
event delete <<QuoteLastMessage>> <Meta-q>
event add <<QuoteLastMessage>> <Control-Shift-m>
Full details about the "event" command can be found in [1].
Note that you can use any event specifier, not just keyboard
shortcuts. Refer to [2] for full details.
The format string used to decorate the message being quoted can
be changed using the Customize interface in the "Plugins ->
Quote Last Message" group of settings (also reachable as
"Chat -> Quote Last Message").
The actual setting is named
::plugins::quotelastmsg::options(format)
and it defaults to the string ">> %m".
In the format string the format specifier "%m" is substituted by
the whole message as seen in the conversation log window, and
the specifier "%%" is replaced by a single character "%".
III. Bugs and limitations
* There's currently no way to separately refer to the parts of
the message being quoted (such as its timestamp, poster's
nickname and the message body) in the format string.
* It's impossible to embed "special chanracters" into the format
string (such as \n or \t).
IV. References
1. http://www.tcl.tk/man/tcl8.5/TkCmd/event.htm
2. http://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm
vim:et:ts=4:sw=4:tw=64
Copyright (c) 2008 Konstantin Khomoutov <flatworm@users.sourceforge.net>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
# $Id: quotelastmsg.tcl 1513 2008-10-15 17:39:41Z sergei $
# "Quote last message" chat plugin for Tkabber --
# Allows to copy message located at the bottom of the
# conversation log in the chat window to the input box
# of that chat window.
#
# Written by Konstantin Khomoutov <flatworm@users.sourceforge.net>
# See license.terms for the terms of distribution.
# See README for usage details.
event add <<QuoteLastMessage>> <Alt-q>
event add <<QuoteLastMessage>> <Meta-q>
namespace eval quotelastmsg {
variable state
variable options
::msgcat::mcload [file join [file dirname [info script]] msgs]
custom::defgroup Plugins [::msgcat::mc "Plugins options."] -group Tkabber
custom::defgroup {Quote Last Message} \
[::msgcat::mc "Quote Last Message plugin options.\
This plugin provides a way to copy a message located\
at the bottom of a chat window conversation log\
to the input box of that chat window."] \
-group Plugins \
-group Chat
custom::defvar options(format) {>> %m} \
[::msgcat::mc "Format string used to quote the message.\
Format specifer \"%m\" is replaced by the whole message\
being quoted. Format specifier \"%%\" is replaced by\
a single character \"%\"."] \
-group {Quote Last Message} \
-type string
hook::add open_chat_post_hook \
[namespace current]::setup_chat_window
hook::add draw_message_post_hook \
[namespace current]::on_message_drawn
}
proc quotelastmsg::setup_chat_window {chatid type} {
variable state
set iw [::chat::input_win $chatid]
bind $iw <<QuoteLastMessage>> [list [namespace current]::quote $chatid]
set cw [::chat::chat_win $chatid]
set state($cw,last) 1.0
bind $cw <Destroy> +[list [namespace current]::cleanup $cw %W]
}
proc quotelastmsg::cleanup {w1 w2} {
if {![string equal $w1 $w2]} return
variable state
unset state($w1,last)
}
proc quotelastmsg::on_message_drawn {chatid from type body x} {
if {![chat::is_opened $chatid]} return
set cw [::chat::chat_win $chatid]
variable state
upvar 0 state($cw,last) last
set now [$cw index {end - 1 char}]
if {[$cw compare $last < $now]} {
$cw tag delete lastmsg
$cw tag add lastmsg $last $now
}
set last $now
}
proc quotelastmsg::quote chatid {
variable options
set cw [::chat::chat_win $chatid]
set iw [::chat::input_win $chatid]
set range [$cw tag prevrange lastmsg end]
if {$range == ""} return
lassign $range x y
$iw insert end [string map \
[list %% % %m [$cw get $x $y]] $options(format)]
$iw see end
}
# vim:ts=8:sw=4:sts=4:noet
# $Id: renju.tcl 1400 2008-04-16 13:26:14Z sergei $
# $Id: renju.tcl 1481 2008-08-08 10:48:29Z sergei $
package require msgcat
......@@ -988,7 +988,7 @@ proc renju::send_move {gid ct rt} {
}
proc renju::send_result {gid res child} {
if {$res != "OK"} {
if {$res == "ERR"} {
attention_message $gid \
[format [::msgcat::mc "\n\n Opponent rejected move:\n %s\n\n"] \
[error_to_string $child]]
......
# $Id: reversi.tcl 1354 2008-01-28 17:39:01Z sergei $
# $Id: reversi.tcl 1481 2008-08-08 10:48:29Z sergei $
package require msgcat
......@@ -960,7 +960,7 @@ proc reversi::send_move {gid ct rt} {
}
proc reversi::send_result {gid res child} {
if {$res != "OK"} {
if {$res == "ERR"} {
attention_message $gid \
[format [::msgcat::mc "\n\n Opponent rejected move:\n %s\n\n"] \
[error_to_string $child]]
......
Konstantin Khomoutov <flatworm@users.sourceforge.com>
As usually, copy this directory under the ~/.tkabber/plugins directory
so that you get a hierarchy like this:
~/.tkabber/plugins
~/.tkabber/plugins/singularity/
~/.tkabber/plugins/singularity/singularity.tcl
Restart Tkabber, to get the plugin loaded.
Consult the README file for the details about using this plugin.
$Id: README 1513 2008-10-15 17:39:41Z sergei $
"Singularity" -- main interface plugin for Tkabber.
I. The Idea
When you chat with someone in Tkabber, the corresponding chat
window is opened for the full JID of that person (it is a JID
with the resource part: node@server/resource). Since your peers
can normally log into their XMPP accounts several times at once
(with a different resource each time) Tkabber maintains clear
distinction between these full JIDs.
On the other hand, most people seldom chat from several
connections to their account at once -- quite more often they
move between two or more XMPP clients located in places which
are geographically quite apart, such as their home and office.
In this case it may be convenient to maintain just one chat
window open for each person you're chatting with -- for
instance, you start chatting whith your peer when he/she is at
home, then your peer moves to their office and sends a message
from the new location; at this point it might be convenient not
to have two chat windows -- old and new -- open, but just the
new one.
This plugin implements the described functionality: when the new
window for a one-on-one chat is about to be opened the plugin
checks whether there are any active chat sessions with the same
bare JID (that is, without the "/resource" part) as that of the
new chat. If there are, they are closed with their conversation
log and input history preserved, the new chat window is opened
and then the saved data is inserted into the new window.
So effectively this plugin makes Tkabber keep just one chat
window per bare JID open.
The plugin does not touch MUC private chats because in them
resource part of the room JID is used to designate participants'
nicknames.
II. Usage
Just install this plugin as usually and restart Tkabber.
Currently there's no UI to control the plugin's behaviour.
III. Bugs and limitations
* Tkabber is currently unable to actually "switch" a chat window
from one JID to another, so this plugin works by closing the
existing window(s) and opening the new one. While in tabbed
mode this looks mostly OK, in windowed mode this may be
annoying because the new window will most probably not appear
at the same location and layer as the closed window.
* For some unknown reason the first line of the input history is
lost when the chat state is transferred to the newly opened
window.
* If there are several chat windows to be closed when the new
one is about to be opened, the order in which their
conversation logs and input history records are collected
is undefined.
# vim:tw=64:noet
Copyright (c) 2008 Konstantin Khomoutov <flatworm@users.sourceforge.net>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
# $Id: singularity.tcl 1513 2008-10-15 17:39:41Z sergei $
# When a new chat window is about to be opened this plugin
# checks whether any chats with other resources of this chat peer
# are currently opened and closes them all, if any.
# In other words, it ensures that only one chat window per bare
# JID is opened at any given time.