TclXMPP

Check-in [78613325ae]
Login

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

Overview
Comment:Implemented creating and parsing message processing hints (XEP-0334). Updated copyright years.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:78613325aec1f75203a393b36be631a49e7728af
User & Date: sgolovan 2015-12-11 12:23:47
Context
2015-12-20
19:45
Always add the id attribute to outgoing IQ get or set stanzas. check-in: b43a753b78 user: sgolovan tags: trunk
2015-12-11
12:23
Implemented creating and parsing message processing hints (XEP-0334). Updated copyright years. check-in: 78613325ae user: sgolovan tags: trunk
2015-11-15
17:31
Added the project directory to auto_path to make sure the examples are working in-place. check-in: 9e1ec94a42 user: sgolovan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.








1
2
3
4
5
6
7







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

	* examples/chessbot.tcl, examples/echo.tcl, examples/jsend.tcl,
	  examples/rssbot.tcl: Added the project directory to auto_path to
	  make sure the examples are working in-place.

2015-06-03  Sergei Golovan  <sgolovan@nes.ru>
>
>
>
>
>
>
>







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

	* xmpp/hints.tcl, xmpp/pkgIndex.tcl: Implemented creating and parsing
	  message processing hints (XEP-0334).

	* license.terms: Updated copyright years.

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

	* examples/chessbot.tcl, examples/echo.tcl, examples/jsend.tcl,
	  examples/rssbot.tcl: Added the project directory to auto_path to
	  make sure the examples are working in-place.

2015-06-03  Sergei Golovan  <sgolovan@nes.ru>

Changes to license.terms.

1
2
3
4
5
6
7
8
Copyright (c) 2008-2014 Sergei Golovan <sgolovan@nes.ru>

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

|







1
2
3
4
5
6
7
8
Copyright (c) 2008-2015 Sergei Golovan <sgolovan@nes.ru>

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

Added xmpp/hints.tcl.







































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# hints.tcl --
#
#       This file is part of the XMPP library. It implements interface to
#       Message Processing Hints (XEP-0334)
#
# Copyright (c) 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 provide xmpp::hints 0.1

package require xmpp::xml 0.1

namespace eval ::xmpp::hints {}

# ::xmpp::hints::parse --
#
#       Find hint elements in a list and parse them.
#
# Arguments:
#       xmlElements         XML elements list.
#
# Result:
#       If there are any hints in the given list then the result is a
#       list of hints {store no-store no-permanent-store no-copy}.
#       Otherwise an empty list is returned.
#
# Side effects:
#       None.

proc ::xmpp::hints::parse {xmlElements} {
    set res {}

    foreach element $xmlElements {
        ::xmpp::xml::split $element tag xmlns attrs cdata subels

        switch -- $xmlns {
            urn:xmpp:hints {
                lappend res $tag
            }
        }
    }

    return $res
}

# ::xmpp::hints::create --
#
#       Create a list of hint elements using XEP-0334 rules.
#
# Arguments:
#       hints       A list of desired hints. May contain values from the
#                   following list: {store no-store no-permanent-store no-copy}
#
# Results:
#       A list with XML elements from XEP-0334 is created.
#
# Side effects:
#       None.

proc ::xmpp::hints::create {hints} {
    set res {}

    foreach hint [lsort -unique $hints] {
        switch -- $hint {
            no-copy -
            no-store -
            no-permanent-store -
            store {
                lappend res [::xmpp::xml::create $hint -xmlns urn:xmpp:hints]
            }
            default {
                return -code error \
                       "Unknown message processing hint: \"$hint\""
            }
        }
    }

    return $res
}

# vim:ts=8:sw=4:sts=4:et

Changes to xmpp/pkgIndex.tcl.

17
18
19
20
21
22
23

24
25
26
27
28
29
30
..
59
60
61
62
63
64
65

66
67
68
69
70
71
72
package ifneeded xmpp::bob 0.1                  [list source [file join $dir bob.tcl]]
package ifneeded xmpp::component 0.2            [list source [file join $dir component.tcl]]
package ifneeded xmpp::compress 0.1             [list source [file join $dir compress.tcl]]
package ifneeded xmpp::data 0.1                 [list source [file join $dir data.tcl]]
package ifneeded xmpp::delay 0.1                [list source [file join $dir delay.tcl]]
package ifneeded xmpp::disco 0.1                [list source [file join $dir disco.tcl]]
package ifneeded xmpp::dns 0.1                  [list source [file join $dir dns.tcl]]

package ifneeded xmpp::iq 0.1                   [list source [file join $dir iq.tcl]]
package ifneeded xmpp::jid 0.1                  [list source [file join $dir jid.tcl]]
package ifneeded xmpp::muc 0.1                  [list source [file join $dir muc.tcl]]
package ifneeded xmpp::negotiate 0.1            [list source [file join $dir negotiate.tcl]]
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 require xmpp::auth 0.2
    package require xmpp::bob 0.1
    package require xmpp::component 0.2
    package require xmpp::compress 0.1
    package require xmpp::delay 0.1
    package require xmpp::disco 0.1
    package require xmpp::dns 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







>







 







>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package ifneeded xmpp::bob 0.1                  [list source [file join $dir bob.tcl]]
package ifneeded xmpp::component 0.2            [list source [file join $dir component.tcl]]
package ifneeded xmpp::compress 0.1             [list source [file join $dir compress.tcl]]
package ifneeded xmpp::data 0.1                 [list source [file join $dir data.tcl]]
package ifneeded xmpp::delay 0.1                [list source [file join $dir delay.tcl]]
package ifneeded xmpp::disco 0.1                [list source [file join $dir disco.tcl]]
package ifneeded xmpp::dns 0.1                  [list source [file join $dir dns.tcl]]
package ifneeded xmpp::hints 0.1                [list source [file join $dir hints.tcl]]
package ifneeded xmpp::iq 0.1                   [list source [file join $dir iq.tcl]]
package ifneeded xmpp::jid 0.1                  [list source [file join $dir jid.tcl]]
package ifneeded xmpp::muc 0.1                  [list source [file join $dir muc.tcl]]
package ifneeded xmpp::negotiate 0.1            [list source [file join $dir negotiate.tcl]]
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 require xmpp::auth 0.2
    package require xmpp::bob 0.1
    package require xmpp::component 0.2
    package require xmpp::compress 0.1
    package require xmpp::delay 0.1
    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