Tkabber

Check-in [266da6a961]
Login

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

Overview
Comment:Fixed behavior of the dialog with conference participants to encrypt to if there's none of them. Also, removed unnecessary catch guards. Add the checkbox dialog title to the dialog window content as well.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 266da6a961ddc80621bbb83127817340a8f726a5
User & Date: sgolovan 2016-01-14 09:49:11
Context
2016-01-14
17:29
Started implementing user avatar (XEP-0084) specification. Currently only uploading avatar works. check-in: 28af72a735 user: sgolovan tags: trunk
09:49
Fixed behavior of the dialog with conference participants to encrypt to if there's none of them. Also, removed unnecessary catch guards. Add the checkbox dialog title to the dialog window content as well. check-in: 266da6a961 user: sgolovan tags: trunk
2016-01-13
13:15
Clarified a bit information on the ispell plugin options. check-in: 1e4a40fbfe user: sgolovan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.










1
2
3
4
5
6
7









2016-01-13  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/chat/logger.tcl: Fixed bug with names of temporary arrays
	  clash.

	* tk/bwidget.tcl: Made the 'current' subcommand for a combobox a
	  synonym for 'getvalue' ('current' is taken from ttk::combobox).
>
>
>
>
>
>
>
>
>







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

	* plugins/general/gpgme.tcl: Fixed behavior of the dialog with
	  conference participants to encrypt to if there's none of them.
	  Also, removed unnecessary catch guards.

	* utils.tcl: Add the checkbox dialog title to the dialog window
	  content as well.

2016-01-13  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/chat/logger.tcl: Fixed bug with names of temporary arrays
	  clash.

	* tk/bwidget.tcl: Made the 'current' subcommand for a combobox a
	  synonym for 'getvalue' ('current' is taken from ttk::combobox).

Changes to plugins/general/gpgme.tcl.

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
          [list unchanged       [::msgcat::mc "not actually changed"] \
                new_key         [::msgcat::mc "entirely new key"] \
                new_uids        [::msgcat::mc "new user IDs"] \
                new_sigs        [::msgcat::mc "new signatures"] \
                new_subkeys     [::msgcat::mc "new subkeys"] \
                new_private_key [::msgcat::mc "contains private key"]]

    catch {unset warnings}
    array set warnings {}

    variable signedid 0
}


proc ::ssj::once_only {xlib} {







|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
          [list unchanged       [::msgcat::mc "not actually changed"] \
                new_key         [::msgcat::mc "entirely new key"] \
                new_uids        [::msgcat::mc "new user IDs"] \
                new_sigs        [::msgcat::mc "new signatures"] \
                new_subkeys     [::msgcat::mc "new subkeys"] \
                new_private_key [::msgcat::mc "contains private key"]]

    unset -nocomplain warnings
    array set warnings {}

    variable signedid 0
}


proc ::ssj::once_only {xlib} {
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
    foreach key [array names selectkey[psuffix $xlib]] {
        if {[set selectkey[psuffix $xlib]($key)]} {
            lappend keys $key
        }
    }

    destroy $dw
    unset selectkey[psuffix $xlib]

    if {[llength $keys] > 0} {
        e4meP $xlib $keys
    }
}









|







314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
    foreach key [array names selectkey[psuffix $xlib]] {
        if {[set selectkey[psuffix $xlib]($key)]} {
            lappend keys $key
        }
    }

    destroy $dw
    unset -nocomplain selectkey[psuffix $xlib]

    if {[llength $keys] > 0} {
        e4meP $xlib $keys
    }
}


448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
    debugmsg ssj "VERIFY: $xlib $from ($data); $result"

    array set params $result
    set result $params(status)

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

        if {[info exists sparams(key)]} {
            set sparams(key) [$ctx($xlib) info-key -key $sparams(key)]
            foreach {k v} $sparams(key) {
                switch -- $k {
                    keyid {
                        set j2k($from) $v
                        break
                    }
                    subkeys {
                        foreach subkey $v {
                            catch {unset kparams}
                            array set kparams $subkey
                            if {[info exists kparams(keyid)]} {
                                set j2k($from) $kparams(keyid)
                                break
                            }
                        }
                    }
                }
            }
        }

        lappend signatures [array get sparams]
    }
    catch {unset params}
    array set params [list signatures $signatures]

    if {$result ne "good"} {
        if {[info exists s2e($result)]} {
            set result $s2e($result)
        }
        set params(reason) $result







|












|













|







448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
    debugmsg ssj "VERIFY: $xlib $from ($data); $result"

    array set params $result
    set result $params(status)

    set signatures {}
    foreach signature $params(signatures) {
        unset -nocomplain sparams
        array set sparams $signature

        if {[info exists sparams(key)]} {
            set sparams(key) [$ctx($xlib) info-key -key $sparams(key)]
            foreach {k v} $sparams(key) {
                switch -- $k {
                    keyid {
                        set j2k($from) $v
                        break
                    }
                    subkeys {
                        foreach subkey $v {
                            unset -nocomplain kparams
                            array set kparams $subkey
                            if {[info exists kparams(keyid)]} {
                                set j2k($from) $kparams(keyid)
                                break
                            }
                        }
                    }
                }
            }
        }

        lappend signatures [array get sparams]
    }
    unset -nocomplain params
    array set params [list signatures $signatures]

    if {$result ne "good"} {
        if {[info exists s2e($result)]} {
            set result $s2e($result)
        }
        set params(reason) $result
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
            switch -- $k {
                key {
                    foreach {k v} $v {
                        if {$k ne "subkeys"} {
                            continue
                        }
                        foreach subkey $v {
                            catch {unset sparams}
                            array set sparams $subkey
                            if {[info exists sparams(email)]} {
                                append addrs $s $sparams(email)
                                set s "\n     "
                            }
                        }
                    }







|







603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
            switch -- $k {
                key {
                    foreach {k v} $v {
                        if {$k ne "subkeys"} {
                            continue
                        }
                        foreach subkey $v {
                            unset -nocomplain sparams
                            array set sparams $subkey
                            if {[info exists sparams(email)]} {
                                append addrs $s $sparams(email)
                                set s "\n     "
                            }
                        }
                    }
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
            switch -- $k {
                key {
                    foreach {k v} $v {
                        if {$k ne "subkeys"} {
                            continue
                        }
                        foreach subkey $v {
                            catch {unset sparams}
                            array set sparams $subkey
                            if {[info exists sparams(email)]} {
                                lappend emails $sparams(email)
                            }
                        }
                    }
                }







|







665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
            switch -- $k {
                key {
                    foreach {k v} $v {
                        if {$k ne "subkeys"} {
                            continue
                        }
                        foreach subkey $v {
                            unset -nocomplain sparams
                            array set sparams $subkey
                            if {[info exists sparams(email)]} {
                                lappend emails $sparams(email)
                            }
                        }
                    }
                }
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
proc ::ssj::fetchkeys {xlib pinfo} {
    variable ctx

    array set params $pinfo

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

        if {[info exists sparams(keyid)]} {
            lappend keyids $sparams(keyid)
        }
    }








|







760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
proc ::ssj::fetchkeys {xlib pinfo} {
    variable ctx

    array set params $pinfo

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

        if {[info exists sparams(keyid)]} {
            lappend keyids $sparams(keyid)
        }
    }

1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
proc ::ssj::check_signature {xlib from type x args} {
    variable NS
    variable signed

    switch -- $type {
        unavailable -
        available {
            catch {unset signed($xlib,$from)}

            set signature ""
            foreach xs $x {
                ::xmpp::xml::split $xs tag xmlns attrs cdata subels
                if {$xmlns eq $NS(signed)} {
                    set signature $cdata
                    break







|







1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
proc ::ssj::check_signature {xlib from type x args} {
    variable NS
    variable signed

    switch -- $type {
        unavailable -
        available {
            unset -nocomplain signed($xlib,$from)

            set signature ""
            foreach xs $x {
                ::xmpp::xml::split $xs tag xmlns attrs cdata subels
                if {$xmlns eq $NS(signed)} {
                    set signature $cdata
                    break
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
    if {[llength $jids] > 0} {
        set presenceinfo [$tab insert end presenceinfo \
                              -text [::msgcat::mc "Presence"]]
        set i 0
        foreach j $jids {
            regexp {[^,]*,(.*)} $j -> fjid
            set x [userinfo::pack_frame $presenceinfo.presence_$i $fjid]
            catch {array unset params}
            array set params $signed($j)

            set kv {}
            set addrs ""
            set s ""
            foreach signature $params(signatures) {
                foreach {k v} $signature {
                    switch -- $k {
                        key {
                            foreach {k v} $v {
                                if {$k ne "subkeys"} continue

                                foreach subkey $v {
                                    catch {unset sparams}
                                    array set sparams $subkey
                                    if {[info exists sparams(email)]} {
                                        append addrs $s $sparams(email)
                                        set s ", "
                                    }
                                }
                            }







|













|







1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
    if {[llength $jids] > 0} {
        set presenceinfo [$tab insert end presenceinfo \
                              -text [::msgcat::mc "Presence"]]
        set i 0
        foreach j $jids {
            regexp {[^,]*,(.*)} $j -> fjid
            set x [userinfo::pack_frame $presenceinfo.presence_$i $fjid]
            unset -nocomplain params
            array set params $signed($j)

            set kv {}
            set addrs ""
            set s ""
            foreach signature $params(signatures) {
                foreach {k v} $signature {
                    switch -- $k {
                        key {
                            foreach {k v} $v {
                                if {$k ne "subkeys"} continue

                                foreach subkey $v {
                                    unset -nocomplain sparams
                                    array set sparams $subkey
                                    if {[info exists sparams(email)]} {
                                        append addrs $s $sparams(email)
                                        set s ", "
                                    }
                                }
                            }
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
        }
        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







|







1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
        }
        if {[set groupencrypt[prefix $xlib]($nick)]} {
            set groupchat_encrypt($idx) 1
        }
    }

    destroy $dw
    unset -nocomplain 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.

342
343
344
345
346
347
348



349
350
351
352
353
354
355
                 -anchor e \
                 -default 0 \
                 -cancel [expr {[llength $buttons]/2 - 1}]

    foreach {but com} $buttons {
        $path add -text $but -command $com
    }




    set sw [ScrolledWindow [$path getframe].sw]
    set sf [ScrollableFrame $sw.sf -constrainedwidth yes]
    pack $sw -expand yes -fill both
    $sw setwidget $sf
    set sff [$sf getframe]








>
>
>







342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
                 -anchor e \
                 -default 0 \
                 -cancel [expr {[llength $buttons]/2 - 1}]

    foreach {but com} $buttons {
        $path add -text $but -command $com
    }

    set m [Message [$path getframe].title -aspect 50000 -text $title]
    pack $m -expand no -fill x

    set sw [ScrolledWindow [$path getframe].sw]
    set sf [ScrollableFrame $sw.sf -constrainedwidth yes]
    pack $sw -expand yes -fill both
    $sw setwidget $sf
    set sff [$sf getframe]