Tkabber

Check-in [a757414821]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added an optional parameter which makes some of the choices in checkbox dialogs disabled. Replaced the group encrypt menu by a dialog. Fixed fetching missing key.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a757414821c3a25954ec1c2280c553b10a55438d
User & Date: sgolovan 2015-12-29 20:32:54
Context
2015-12-31
19:42
Mitigated race condition with unset variable connected with the roster item nickname. Closes ticket [5f4781f0b9]. check-in: 181a01095e user: sergei tags: trunk
2015-12-29
20:32
Added an optional parameter which makes some of the choices in checkbox dialogs disabled. Replaced the group encrypt menu by a dialog. Fixed fetching missing key. check-in: a757414821 user: sgolovan tags: trunk
04:22
Enabled TLS1.1 and TLS1.2 protocols if they are available. check-in: 4e5b407895 user: sgolovan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3
4






5
6
7
8
9
10
11
2015-12-29  Sergei Golovan  <sgolovan@nes.ru>

	* login.tcl, proxy.tcl: Enabled TLS1.1 and TLS1.2 protocols if they
	  are available.







2015-12-27  Sergei Golovan  <sgolovan@nes.ru>

	* ifacetk/iface.tcl, ifacetk/roster.tcl: Use grid instead of pack for
	  the roster and roster filter because it works better when the main
	  window is being resized.





>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2015-12-29  Sergei Golovan  <sgolovan@nes.ru>

	* login.tcl, proxy.tcl: Enabled TLS1.1 and TLS1.2 protocols if they
	  are available.

	* utils.tcl: Added an optional parameter which makes some of the
	  choices in checkbox dialogs disabled.

	* plugins/general/gpgme.tcl: Replaced the group encrypt menu by a
	  dialog. Fixed fetching missing key.

2015-12-27  Sergei Golovan  <sgolovan@nes.ru>

	* ifacetk/iface.tcl, ifacetk/roster.tcl: Use grid instead of pack for
	  the roster and roster filter because it works better when the main
	  window is being resized.

Changes to plugins/general/gpgme.tcl.

743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
    array set params $pinfo

    set keyids {}
    foreach signature $params(signatures) {
        catch {unset sparams}
        array set sparams $signature

        if {[info exists sparams(fingerprint)]} {
            lappend keyids [string range $sparams(fingerprint) end-7 end]
        }
    }

    incr gpg_error_id
    if {[catch {exec gpg --recv-keys {*}$keyids 2>@1} output]} {
        NonmodalMessageDlg .keyfetch_error$gpg_error_id \
            -aspect 50000 -icon error \







|
|







743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
    array set params $pinfo

    set keyids {}
    foreach signature $params(signatures) {
        catch {unset sparams}
        array set sparams $signature

        if {[info exists sparams(keyid)]} {
            lappend keyids [string range $sparams(keyid) end-7 end]
        }
    }

    incr gpg_error_id
    if {[catch {exec gpg --recv-keys {*}$keyids 2>@1} output]} {
        NonmodalMessageDlg .keyfetch_error$gpg_error_id \
            -aspect 50000 -icon error \
1599
1600
1601
1602
1603
1604
1605





1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
    set xlib [chat::get_xlib $chatid]
    set jid [chat::get_jid $chatid]
    set cw [chat::winid $chatid]

    set w $cw.status.encrypted

    if {$type eq "chat"} {





        Button $w \
               -relief link \
               -image [encrypted:icon $xlib $jid] \
               -helptype balloon \
               -helptext [::msgcat::mc "Toggle encryption"] \
               -command [list ::ssj::encrypt:toggleP $xlib $jid]
    } else {
        set m $w.menu
        MenuToolbutton $w \
                -image [encrypted:icon $xlib $jid] \
                -menu $m
        menu $m -tearoff 0 \
                -postcommand [list ::ssj::groupchat_encrypt_menu $xlib $jid $m]
        DynamicHelp::add $w -type balloon \
                            -text [::msgcat::mc "Toggle encryption"]
        set options(encrypt,$xlib,$jid) 0
    }

    encrypted:trace \
        "$w configure -image \[::ssj::encrypted:icon $xlib $jid\]" $xlib $jid
    pack $w -side left -before $cw.status.mb

    foreach nick [::muc::roster $chatid] {
        set user_jid [::xmpp::jid::replaceResource $jid $nick]







>
>
>
>
>
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<







1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616











1617
1618
1619
1620
1621
1622
1623
    set xlib [chat::get_xlib $chatid]
    set jid [chat::get_jid $chatid]
    set cw [chat::winid $chatid]

    set w $cw.status.encrypted

    if {$type eq "chat"} {
        set command [list ::ssj::encrypt:toggleP $xlib $jid]
    } else {
        set command [list ::ssj::groupchat_encrypt_dialog $xlib $jid]
        set options(encrypt,$xlib,$jid) 0
    }
    Button $w \
           -relief link \
           -image [encrypted:icon $xlib $jid] \
           -helptype balloon \
           -helptext [::msgcat::mc "Toggle encryption"] \
           -command $command












    encrypted:trace \
        "$w configure -image \[::ssj::encrypted:icon $xlib $jid\]" $xlib $jid
    pack $w -side left -before $cw.status.mb

    foreach nick [::muc::roster $chatid] {
        set user_jid [::xmpp::jid::replaceResource $jid $nick]
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661


1662
1663
1664
1665
1666
1667



























1668
1669
1670
1671
1672


1673
1674
1675
1676
1677
1678

1679
1680
1681
1682
1683
1684
1685

    array unset groupchat_encrypt [list $xlib $jid *]
    set options(encrypt,$xlib,$jid) 0
}

hook::add close_chat_post_hook ::ssj::on_close_chat

proc ::ssj::groupchat_encrypt_menu {xlib jid m} {
    variable groupchat_encrypt
    variable signed

    set chatid [chat::chatid $xlib $jid]

    $m delete 0 end



    foreach nick [lsort -dictionary [::muc::roster $chatid]] {
        set user_jid [::xmpp::jid::replaceResource $jid $nick]

        if {![info exists signed($xlib,$user_jid)]} continue




























        set idx [list $xlib $jid $nick]

        if {![info exists groupchat_encrypt($idx)]} {
            set groupchat_encrypt($idx) 0
        }



        $m add checkbutton -label $nick \
                -variable [namespace current]::groupchat_encrypt($idx)
    }

    return $m

}

proc ::ssj::aggregate_encrypt {name1 name2 op} {
    variable options
    variable groupchat_encrypt

    # Node and server can't contain a comma







|





|
>
>






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





>
>
|
<
<


|
>







1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698


1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709

    array unset groupchat_encrypt [list $xlib $jid *]
    set options(encrypt,$xlib,$jid) 0
}

hook::add close_chat_post_hook ::ssj::on_close_chat

proc ::ssj::groupchat_encrypt_dialog {xlib jid} {
    variable groupchat_encrypt
    variable signed

    set chatid [chat::chatid $xlib $jid]

    set nicks {}
    set balloons {}
    set disabled {}

    foreach nick [lsort -dictionary [::muc::roster $chatid]] {
        set user_jid [::xmpp::jid::replaceResource $jid $nick]

        if {![info exists signed($xlib,$user_jid)]} continue

        lappend nicks $nick $nick
        lappend balloons $nick [signed:info $signed($xlib,$user_jid)]
        unset -nocomplain params
        array set params $signed($xlib,$user_jid)
        if {[info exists params(reason)]} {
            lappend disabled $nick 1
        }
    }

    set dw .groupencrypt[psuffix $xlib]
    if {[winfo exists $dw]} {
        destroy $dw
    }

    CbDialog $dw [::msgcat::mc "Select room %s participants for encrypting\
                                traffic to" $jid] \
        [list [::msgcat::mc "OK"] [list ::ssj::save_groupchat_encrypt $dw $xlib $jid] \
              [::msgcat::mc "Cancel"] [list destroy $dw]] \
        ::ssj::groupencrypt[psuffix $xlib] $nicks $balloons \
        -disabled $disabled -modal local
}

proc ::ssj::save_groupchat_encrypt {dw xlib jid} {
    variable groupchat_encrypt
    variable groupencrypt[psuffix $xlib]

    foreach nick [array names groupencrypt[psuffix $xlib]] {
        set idx [list $xlib $jid $nick]

        if {![info exists groupchat_encrypt($idx)]} {
            set groupchat_encrypt($idx) 0
        }
        if {[set groupencrypt[prefix $xlib]($nick)]} {
            set groupchat_encrypt($idx) 1
        }


    }

    destroy $dw
    unset groupencrypt[psuffix $xlib]
}

proc ::ssj::aggregate_encrypt {name1 name2 op} {
    variable options
    variable groupchat_encrypt

    # Node and server can't contain a comma

Changes to utils.tcl.

327
328
329
330
331
332
333

334
335
336
337
338
339
340

    set modal none
    set radio 0
    foreach {opt val} $args {
        switch -- $opt {
            -type { set radio [string equal $val radio] }
            -modal { set modal $val }

        }
    }

    set len [llength $buttons]

    Dialog $path -title $title \
                 -modal $modal \







>







327
328
329
330
331
332
333
334
335
336
337
338
339
340
341

    set modal none
    set radio 0
    foreach {opt val} $args {
        switch -- $opt {
            -type { set radio [string equal $val radio] }
            -modal { set modal $val }
            -disabled { array set disabled $val }
        }
    }

    set len [llength $buttons]

    Dialog $path -title $title \
                 -modal $modal \
378
379
380
381
382
383
384



385
386
387
388
389
390
391
            if {$i == 0} {
                set result $idx
            }
        } else {
            set result($idx) 0
            set cb [Checkbutton $sff.cb$i -variable ${var}($idx) \
                                          -text $names($idx)]



        }
        bind $cb <Return> [list [double% $path] invoke 0]
        bind $cb <Return> +break
        bind $cb <1> [list focus %W]
        bindscroll $cb $sf
        if {[info exists balloons($idx)]} {
            balloon::setup $cb -text $balloons($idx)







>
>
>







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
            if {$i == 0} {
                set result $idx
            }
        } else {
            set result($idx) 0
            set cb [Checkbutton $sff.cb$i -variable ${var}($idx) \
                                          -text $names($idx)]
        }
        if {[info exists disabled($idx)] && $disabled($idx)} {
            $sff.cb$i configure -state disabled
        }
        bind $cb <Return> [list [double% $path] invoke 0]
        bind $cb <Return> +break
        bind $cb <1> [list focus %W]
        bindscroll $cb $sf
        if {[info exists balloons($idx)]} {
            balloon::setup $cb -text $balloons($idx)