Tkabber

Check-in [6ac686f9b0]
Login

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

Overview
Comment:Got rid of [eval] calls. Do not add -castore and -certfile options if they are empty strings. Defined /etc/ssl/certs as a default value for the loginconf(cacertstore) on unix systems.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6ac686f9b05bfdfcda72f2c6eace654bf859c0bb
User & Date: sgolovan 2016-02-04 15:48:11
Context
2016-02-07
10:12
Don't show the conference's roster notes in the occupant's user info window. check-in: dbfe9ae6b5 user: sgolovan tags: trunk
2016-02-04
15:48
Got rid of [eval] calls. Do not add -castore and -certfile options if they are empty strings. Defined /etc/ssl/certs as a default value for the loginconf(cacertstore) on unix systems. check-in: 6ac686f9b0 user: sgolovan tags: trunk
15:44
Cleaned up the code, removed all kinds of commands for getting idle time except for the [tk inactive]. check-in: 811798a24b 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
12
13
14
15
16
2016-02-04  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/pep/user_avatar.tcl: Renamed user_avatar_notification_hook
	  to user_avatar_pep_notification_hook to prevent clashing with the
	  avatarcache plugin in contrib.

	* plugins/general/autoaway.tcl, plugins/iq/last.tcl: Cleaned up the
	  code, removed all kinds of commands for getting idle time except
	  for the [tk inactive].





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

	* plugins/general/gpgme.tcl: Don't draw the signed/encrypted message
	  icon for outgoing messages in groupchats because only drawing
	  incoming messages makes sense there.










>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2016-02-04  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/pep/user_avatar.tcl: Renamed user_avatar_notification_hook
	  to user_avatar_pep_notification_hook to prevent clashing with the
	  avatarcache plugin in contrib.

	* plugins/general/autoaway.tcl, plugins/iq/last.tcl: Cleaned up the
	  code, removed all kinds of commands for getting idle time except
	  for the [tk inactive].

	* login.tcl: Got rid of [eval] calls. Do not add -castore and -certfile
	  options if they are empty strings. Defined /etc/ssl/certs as a
	  default value for the loginconf(cacertstore) on unix systems.

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

	* plugins/general/gpgme.tcl: Don't draw the signed/encrypted message
	  icon for outgoing messages in groupchats because only drawing
	  incoming messages makes sense there.

Changes to login.tcl.

112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
}

if {$use_tls} {
    custom::defvar loginconf(sslcertfile) "" \
        [::msgcat::mc "SSL client certificate file bundled with private\
                       key (optional)."] \
        -group Login -type file
    custom::defvar loginconf(sslcacertstore) "" \

        [::msgcat::mc "SSL certification authority file or\
                       directory (optional)."] \
        -group Login -type file
}

custom::defvar loginconf(usealtserver) 0 \
    [::msgcat::mc "Use explicitly-specified server address and port."] \







|
>







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
}

if {$use_tls} {
    custom::defvar loginconf(sslcertfile) "" \
        [::msgcat::mc "SSL client certificate file bundled with private\
                       key (optional)."] \
        -group Login -type file
    custom::defvar loginconf(sslcacertstore) \
        [expr {$tcl_platform(platform) eq "unix"? "/etc/ssl/certs" : ""}] \
        [::msgcat::mc "SSL certification authority file or\
                       directory (optional)."] \
        -group Login -type file
}

custom::defvar loginconf(usealtserver) 0 \
    [::msgcat::mc "Use explicitly-specified server address and port."] \
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
                     -timeout   $lc(boshtimeout) \
                     -wait      $lc(boshwait) \
                     -hold      $lc(boshhold) \
                     -url       $url \
                     -usekeys   $lc(useboshkeys) \
                     -numkeys   $lc(numberofboshkeys) \

        eval [list ::xmpp::connect $xlib \
                                   -command [list login_connect_result $xlib \
                                                  {} $logindata $args]] \
                                   $args
    } elseif {$have_http_poll && $lc(usehttppoll)} {
        if {$lc(pollurl) != ""} {
            set url $lc(pollurl)
        } else {
            # TODO: Asynchronous DNS resolution
            if {[catch {::xmpp::dns::resolveHTTPPoll $ascii_server} urls]} {
                set urls {}







<
|
|
|







573
574
575
576
577
578
579

580
581
582
583
584
585
586
587
588
589
                     -timeout   $lc(boshtimeout) \
                     -wait      $lc(boshwait) \
                     -hold      $lc(boshhold) \
                     -url       $url \
                     -usekeys   $lc(useboshkeys) \
                     -numkeys   $lc(numberofboshkeys) \


        ::xmpp::connect $xlib -command [list login_connect_result $xlib \
                                             {} $logindata $args] \
                        {*}$args
    } elseif {$have_http_poll && $lc(usehttppoll)} {
        if {$lc(pollurl) != ""} {
            set url $lc(pollurl)
        } else {
            # TODO: Asynchronous DNS resolution
            if {[catch {::xmpp::dns::resolveHTTPPoll $ascii_server} urls]} {
                set urls {}
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
                     -int       $lc(pollmin) \
                     -min       $lc(pollmin) \
                     -max       $lc(pollmax) \
                     -url       $url \
                     -usekeys   $lc(usepollkeys) \
                     -numkeys   $lc(numberofpollkeys) \

        eval [list ::xmpp::connect $xlib \
                                   -command [list login_connect_result $xlib \
                                                  {} $logindata $args]] \
                                   $args
    } else {
        if {$lc(usealtserver)} {
            set hosts {}
        } else {
            # TODO: Asynchronous DNS resolution
            if {[catch {::xmpp::dns::resolveXMPPClient $ascii_server} hosts]} {
                set hosts {}







<
|
|
|







601
602
603
604
605
606
607

608
609
610
611
612
613
614
615
616
617
                     -int       $lc(pollmin) \
                     -min       $lc(pollmin) \
                     -max       $lc(pollmax) \
                     -url       $url \
                     -usekeys   $lc(usepollkeys) \
                     -numkeys   $lc(numberofpollkeys) \


        ::xmpp::connect $xlib -command [list login_connect_result $xlib \
                                             {} $logindata $args] \
                        {*}$args
    } else {
        if {$lc(usealtserver)} {
            set hosts {}
        } else {
            # TODO: Asynchronous DNS resolution
            if {[catch {::xmpp::dns::resolveXMPPClient $ascii_server} hosts]} {
                set hosts {}
635
636
637
638
639
640
641

642

643
644


645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
            set hosts $hosts1
            if {![catch ::tls::ciphers tls1.1]} {
                lappend args -tls1.1 1
            }
            if {![catch ::tls::ciphers tls1.2]} {
                lappend args -tls1.2 1
            }

            lappend args -tls1          1 \

                         -certfile      $lc(sslcertfile) \
                         -castore       $lc(sslcacertstore) \


                         -verifycommand [list client:tls_callback $xlib] \
                         -infocommand   [list update_tls_info $xlib]
        }

        lappend args -transport $transport

        if {$lc(usealtserver)} {
            set hosts [list [list [idna::domain_toascii $lc(altserver)] \
                            $lc(altport)]]
        }

        set hosts [lassign $hosts hp]
        lassign $hp host port

        global xmppTransport
        set xmppTransport($xlib) $transport

        eval [list ::xmpp::connect $xlib $host $port \
                                   -command [list login_connect_result $xlib \
                                                  $hosts $logindata $args]] \
                                   $args
    }
}

proc login_connect_result {xlib hosts logindata args status msg} {
    if {$status == "ok" || $status == "abort" || [llength $hosts] == 0} {
        login_connected $xlib $logindata $status $msg
    } else {
        set hosts [lassign $hosts hp]
        lassign $hp host port

        eval [list ::xmpp::connect $xlib $host $port \
                                   -command [list login_connect_result $xlib \
                                                  $hosts $logindata $args]] \
                                   $args
    }
}

########################################################################

proc login_login {xlib logindata} {
    global use_tls have_compress have_sasl







>
|
>
|
|
>
>

















|
|
|
|










|
|
|
|







634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
            set hosts $hosts1
            if {![catch ::tls::ciphers tls1.1]} {
                lappend args -tls1.1 1
            }
            if {![catch ::tls::ciphers tls1.2]} {
                lappend args -tls1.2 1
            }
            if {$lc(sslcertfile) ne ""} {
                lappend args -certfile $lc(sslcertfile)
            }
            if {$lc(sslcacertstore) ne ""} {
                lappend args -castore $lc(sslcacertstore)
            }
            lappend args -tls1          1 \
                         -verifycommand [list client:tls_callback $xlib] \
                         -infocommand   [list update_tls_info $xlib]
        }

        lappend args -transport $transport

        if {$lc(usealtserver)} {
            set hosts [list [list [idna::domain_toascii $lc(altserver)] \
                            $lc(altport)]]
        }

        set hosts [lassign $hosts hp]
        lassign $hp host port

        global xmppTransport
        set xmppTransport($xlib) $transport

        ::xmpp::connect $xlib $host $port \
                        -command [list login_connect_result $xlib \
                                       $hosts $logindata $args] \
                        {*}$args
    }
}

proc login_connect_result {xlib hosts logindata args status msg} {
    if {$status == "ok" || $status == "abort" || [llength $hosts] == 0} {
        login_connected $xlib $logindata $status $msg
    } else {
        set hosts [lassign $hosts hp]
        lassign $hp host port

        ::xmpp::connect $xlib $host $port \
                        -command [list login_connect_result $xlib \
                                       $hosts $logindata $args] \
                        {*}$args
    }
}

########################################################################

proc login_login {xlib logindata} {
    global use_tls have_compress have_sasl
720
721
722
723
724
725
726






727
728
729
730
731
732
733
734
735
736
737
738
        set opts {}
        if {![catch ::tls::ciphers tls1.1]} {
            lappend opts -tls1.1 1
        }
        if {![catch ::tls::ciphers tls1.2]} {
            lappend opts -tls1.2 1
        }






        ::xmpp::starttls::starttls $xlib {*}$opts \
                        -command       [list login_login2 $xlib $logindata] \
                        -tls1          1 \
                        -certfile      $lc(sslcertfile) \
                        -castore       $lc(sslcacertstore) \
                        -verifycommand [list client:tls_callback $xlib] \
                        -infocommand   [list update_tls_info $xlib]
    } elseif {!$lc(usebosh) && !$lc(usehttppoll) && \
            $have_compress && $lc(stream_options) == "compressed"} {
        ::xmpp::compress::compress $xlib \
                        -command     [list login_login2 $xlib $logindata]
    } else {







>
>
>
>
>
>



<
<







723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738


739
740
741
742
743
744
745
        set opts {}
        if {![catch ::tls::ciphers tls1.1]} {
            lappend opts -tls1.1 1
        }
        if {![catch ::tls::ciphers tls1.2]} {
            lappend opts -tls1.2 1
        }
        if {$lc(sslcertfile) ne ""} {
            lappend opts -certfile $lc(sslcertfile)
        }
        if {$lc(sslcacertstore) ne ""} {
            lappend opts -castore $lc(sslcacertstore)
        }
        ::xmpp::starttls::starttls $xlib {*}$opts \
                        -command       [list login_login2 $xlib $logindata] \
                        -tls1          1 \


                        -verifycommand [list client:tls_callback $xlib] \
                        -infocommand   [list update_tls_info $xlib]
    } elseif {!$lc(usebosh) && !$lc(usehttppoll) && \
            $have_compress && $lc(stream_options) == "compressed"} {
        ::xmpp::compress::compress $xlib \
                        -command     [list login_login2 $xlib $logindata]
    } else {