TclXMPP

Check-in [81e700f03f]
Login

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

Overview
Comment:Fixed the ::xmpp::roster::send routine to send only one item in jabber:iq:roster query (and actually send it). Bumped the xmpp::roster package version to 0.2.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:81e700f03faf63cf3c38cf02c2928508dd3dc7fc
User & Date: sgolovan 2015-12-21 16:35:17
Context
2015-12-29
04:20
Added -tls1.1 and -tls1.2 options to support TLS1.1 and TLS1.2 protocols and enabled them by default. Disabled SSLv3 by default. Disabled SSLv3 and enabled TLS1.1 and TLS1.2 protocols if available. check-in: fa4c7eb607 user: sgolovan tags: trunk
2015-12-21
16:35
Fixed the ::xmpp::roster::send routine to send only one item in jabber:iq:roster query (and actually send it). Bumped the xmpp::roster package version to 0.2. check-in: 81e700f03f user: sgolovan tags: trunk
2015-12-20
19:45
Always add the id attribute to outgoing IQ get or set stanzas. check-in: b43a753b78 user: sgolovan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






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

	* xmpp/xmpp.tcl: Always add the id attribute to outgoing IQ get or set
	  stanzas.

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

>
>
>
>
>
>







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

	* xmpp/pkgIndex.tcl, xmpp/roster.tcl: Fixed the ::xmpp::roster::send
	  routine to send only one item in jabber:iq:roster query (and actually
	  send it). Bumped the xmpp::roster package version to 0.2.

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

	* xmpp/xmpp.tcl: Always add the id attribute to outgoing IQ get or set
	  stanzas.

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

Changes to xmpp/pkgIndex.tcl.

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package ifneeded xmpp::pep 0.1                  [list source [file join $dir pep.tcl]]
package ifneeded xmpp::ping 0.1                 [list source [file join $dir ping.tcl]]
package ifneeded xmpp::presence 0.1             [list source [file join $dir presence.tcl]]
package ifneeded xmpp::privacy 0.1              [list source [file join $dir privacy.tcl]]
package ifneeded xmpp::private 0.1              [list source [file join $dir private.tcl]]
package ifneeded xmpp::pubsub 0.1               [list source [file join $dir pubsub.tcl]]
package ifneeded xmpp::register 0.1             [list source [file join $dir register.tcl]]
package ifneeded xmpp::roster 0.1               [list source [file join $dir roster.tcl]]
package ifneeded xmpp::roster::annotations 0.1  [list source [file join $dir annotations.tcl]]
package ifneeded xmpp::roster::bookmarks 0.1    [list source [file join $dir bookmarks.tcl]]
package ifneeded xmpp::roster::delimiter 0.1    [list source [file join $dir delimiter.tcl]]
package ifneeded xmpp::roster::metacontacts 0.1 [list source [file join $dir metacontacts.tcl]]
package ifneeded xmpp::sasl 0.2                 [list source [file join $dir sasl.tcl]]
package ifneeded xmpp::search 0.1               [list source [file join $dir search.tcl]]
package ifneeded xmpp::sm 0.1                   [list source [file join $dir sm.tcl]]
................................................................................
    package require xmpp::disco 0.1
    package require xmpp::dns 0.1
    package require xmpp::hints 0.1
    package require xmpp::muc 0.1
    package require xmpp::pep 0.1
    package require xmpp::ping 0.1
    package require xmpp::privacy 0.1
    package require xmpp::roster 0.1
    package require xmpp::roster::annotations 0.1
    package require xmpp::roster::bookmarks 0.1
    package require xmpp::roster::delimiter 0.1
    package require xmpp::roster::metacontacts 0.1
    package require xmpp::sasl 0.2
    package require xmpp::starttls 0.1
    package require xmpp::transport::bosh 0.2







|







 







|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package ifneeded xmpp::pep 0.1                  [list source [file join $dir pep.tcl]]
package ifneeded xmpp::ping 0.1                 [list source [file join $dir ping.tcl]]
package ifneeded xmpp::presence 0.1             [list source [file join $dir presence.tcl]]
package ifneeded xmpp::privacy 0.1              [list source [file join $dir privacy.tcl]]
package ifneeded xmpp::private 0.1              [list source [file join $dir private.tcl]]
package ifneeded xmpp::pubsub 0.1               [list source [file join $dir pubsub.tcl]]
package ifneeded xmpp::register 0.1             [list source [file join $dir register.tcl]]
package ifneeded xmpp::roster 0.2               [list source [file join $dir roster.tcl]]
package ifneeded xmpp::roster::annotations 0.1  [list source [file join $dir annotations.tcl]]
package ifneeded xmpp::roster::bookmarks 0.1    [list source [file join $dir bookmarks.tcl]]
package ifneeded xmpp::roster::delimiter 0.1    [list source [file join $dir delimiter.tcl]]
package ifneeded xmpp::roster::metacontacts 0.1 [list source [file join $dir metacontacts.tcl]]
package ifneeded xmpp::sasl 0.2                 [list source [file join $dir sasl.tcl]]
package ifneeded xmpp::search 0.1               [list source [file join $dir search.tcl]]
package ifneeded xmpp::sm 0.1                   [list source [file join $dir sm.tcl]]
................................................................................
    package require xmpp::disco 0.1
    package require xmpp::dns 0.1
    package require xmpp::hints 0.1
    package require xmpp::muc 0.1
    package require xmpp::pep 0.1
    package require xmpp::ping 0.1
    package require xmpp::privacy 0.1
    package require xmpp::roster 0.2
    package require xmpp::roster::annotations 0.1
    package require xmpp::roster::bookmarks 0.1
    package require xmpp::roster::delimiter 0.1
    package require xmpp::roster::metacontacts 0.1
    package require xmpp::sasl 0.2
    package require xmpp::starttls 0.1
    package require xmpp::transport::bosh 0.2

Changes to xmpp/roster.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187

188
189
190
191
192
193

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209



210
211
212
213
214
215
216
217
218
# roster.tcl --
#
#       This file is a part of the XMPP library. It implements basic
#       roster routines (RFC-3921 and RFC-6121).
#
# Copyright (c) 2008-2014 Sergei Golovan <sgolovan@nes.ru>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAMER OF ALL WARRANTIES.

package require xmpp

package provide xmpp::roster 0.1

namespace eval ::xmpp::roster {}

# ::xmpp::roster::features --
#
#       Return roster features list it can be empty or include 'ver' string
#       which means that roster versioning is supported (XEP-0237 and later
................................................................................
proc ::xmpp::roster::send {token args} {
    variable $token
    upvar 0 $token state
    set xlib $state(xlib)

    set timeout 0
    set cmd {}
    set item {}
    set subels {}

    foreach {key val} $args {
        switch -- $key {
            -timeout {
                set timeout $val
            }
            -command {
                set cmd [list -command $val]
            }
            -jid {
                if {[llength $item] > 0} {
                    lappend subels [eval $item]
                }
                set item [list ::xmpp::xml::create item -attrs [list jid $val]]
            }
            -name {
                lappend item -attrs [list name $val]

            }
            -subscription {
                lappend item -attrs [list subscription $val]
            }
            -ask {
                lappend item -attrs [list ask $val]

            }
            -groups {
                set groups {}
                foreach group $val {
                    lappend groups [::xmpp::xml::create group -cdata $group]
                }
                lappend item -subelements $groups
            }
            default {
                return -code error \
                       [::msgcat::mc "Illegal option \"%s\"" $key]
            }
        }
    }

    set query [::xmpp::xml::create query -xmlns jabber:iq:roster \



                                         -subelements $subels]

    eval [list ::xmpp::sendIQ $xlib set \
                              -query $query \
                              -timeout $timeout] $cmd
}

# ::xmpp::roster::get --






|






|







 







|
|










|
<
|
<
<

<
>


|


<
>


<



<








|
>
>
>
|
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181

182


183

184
185
186
187
188
189

190
191
192

193
194
195

196
197
198
199
200
201
202
203
204
205
206
207
208

209
210
211
212
213
214
215
# roster.tcl --
#
#       This file is a part of the XMPP library. It implements basic
#       roster routines (RFC-3921 and RFC-6121).
#
# Copyright (c) 2008-2015 Sergei Golovan <sgolovan@nes.ru>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAMER OF ALL WARRANTIES.

package require xmpp

package provide xmpp::roster 0.2

namespace eval ::xmpp::roster {}

# ::xmpp::roster::features --
#
#       Return roster features list it can be empty or include 'ver' string
#       which means that roster versioning is supported (XEP-0237 and later
................................................................................
proc ::xmpp::roster::send {token args} {
    variable $token
    upvar 0 $token state
    set xlib $state(xlib)

    set timeout 0
    set cmd {}
    set attrs {}
    set groups {}

    foreach {key val} $args {
        switch -- $key {
            -timeout {
                set timeout $val
            }
            -command {
                set cmd [list -command $val]
            }
            -jid {
                lappend attrs jid $val

            }


            -name {

                lappend attrs name $val
            }
            -subscription {
                lappend attrs subscription $val
            }
            -ask {

                lappend attrs ask $val
            }
            -groups {

                foreach group $val {
                    lappend groups [::xmpp::xml::create group -cdata $group]
                }

            }
            default {
                return -code error \
                       [::msgcat::mc "Illegal option \"%s\"" $key]
            }
        }
    }

    set query [::xmpp::xml::create query \
                    -xmlns jabber:iq:roster \
                    -subelements [list [::xmpp::xml::create item \
                                                -attrs $attrs \
                                                -subelements $groups]]]

    eval [list ::xmpp::sendIQ $xlib set \
                              -query $query \
                              -timeout $timeout] $cmd
}

# ::xmpp::roster::get --