JabChapter 9

From WikiContent

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 +
[http://prisonbreakmania.com/galeria/albums/userpics/10003/topic-579.htm norey] [http://drusillasbooks.com/images/inventory/pics/article151.html luxor writing instruments pvt. ltd] [http://canidra.org/img/bg/thumbs/article585.html jin rapping video] [http://westcoastbias.com/wp-content/uploads/2009/00/index.html index] [http://blogshoster.com/clientarea/downloads/media/topic1428.htm available bondage custom model video] [http://creating.com.ve/correo/data/files/article1364.htm sxga notebooks] [http://paroquiasaosimao.org/images/comunidades/pics/article619.html of mp3 mp3s music mp3] [http://naruto-chronicles.net/images/thumbs/index.html http] [http://silverglaze.com/wp-content/uploads/2009/06/news-480-2009-07-26.html scuba diving centers] [http://hamphauercanes.com/fax/files/article176.html add link manager movie reciprocal] [http://miteyriders.com/dev/wordpress/wp-content/images/news-2715-20090720.html coors field] [http://provobreastsurgeon.com/wp-content/gallery/breast/index.htm url] [http://www.bibliopolio.gr/images/banners/mini/topic-1088.htm the scooter store] [http://cleanairmakemore.com/orig/uploads/thumbs/topic-876.html adult laotian video] [http://cottagepirouette.com/director_test/css/news-1610-20090719.html splinter cell chaos theory co op video] [http://oliderdossonhos.com/wp-content/uploads/2009/02/news-1449.html help with troubled teen] [http://dragonballorigins.com/wordpress/wp-content/uploads/2009/comment-1508.html aol isp information] [http://evangelicalsformitt.org/mt/themes/styles/article-82.htm pinnacle pctv stereo serial] [http://abanganden.co.cc/wp-content/uploads/2008/11/article-1707.htm 100 1987 billboard top] [http://spnschoolchicago.org/emailforms/use/form/page-2067.html professional video cameras uk] [http://canidra.org/img/bg/thumbs/article2439.html tiny black tits] [http://www.juliensuvalde.com/skin1/pages/files/article916.html laura movie nubiles] [http://beeone4.co.cc/admin/areas/files/topic-1556.htm teacup puppy] [http://giiblog.com.br/wp-content/uploads/2008/09/text-1543.htm lady sonya movies] [http://paroquiasaosimao.org/images/comunidades/pics/article82.html aoxppr 2.42 serial] [http://nycity-hits.com/banners/small/comment-214.html nude women in showers] [http://kurosakiways.com/images/icons/article344.html cortislim] [http://elusivemoose.com/ssp_director/albums/album-25/page1616.html arthritis drug lawyer] [http://www.nature-museum.org/about/images10/article1756.html mine again lyrics mariah] [http://www.passiondates.com/Tips_and_Advice/Lifestyle/images/comment-1274.html hilton sisters] [http://dvfreelancer.com/forum/images/avatars/pics/2428.html kelly online r tape video] [http://www.bottlesandcans.com/uploads/images/resource-829.html taxes,laws,guide] [http://www.passiondates.com/Tips_and_Advice/Lifestyle/images/comment-904.html 13 year old nude] [http://thesmileshack.com/store/pub/files/sabugelq.htm opo3] [http://thesmileshack.com/store/pub/files/pasrolla.htm arizona home owners insurance] [http://gsazahar.org/ficheros/uploads/media/article1144.htm circuitcity.com] [http://dnsline.com/soporte/attachments/media/comment-644.html oscar nominated movie reviews] [http://kantutabolivia.net/grup/abdon/mp3/eltsar1513.htm aljazeera english version] [http://blognoviny.cz/images/pixels/239.html lake taho] [http://www.bottlesandcans.com/uploads/images/resource-1517.html champion shuffleboard manual] [http://dvfreelancer.com/forum/images/avatars/pics/558.html rucker park] [http://gurianinstruments.com/images/specials/thumbs/news-648-20090726.html outlaw josey wales movie quotes] [http://oliderdossonhos.com/wp-content/uploads/2009/02/news-1081.html online pharmacy tech course] [http://luxutah.com/wp-content/uploads/2009/02/article-1756.htm colombian models] [http://cbhr.com/dmdocuments/docs/article1478.html paris clip art] [http://cyberserg.com/e107_plugins/log/logs/cache/topic-1400.htm pliweb] [http://griffiths.com/blog/wp-content/uploads/2007/news-333-2009-07-25.html school teacher videos] [http://miteyriders.com/dev/wordpress/wp-content/images/sitemap.html links] [http://pihlweb.com/shopping/thumbs/news-1613-2009-07-18.html x man cartoon for sale] [http://vagoslatinamerica.com/site/slideshow/pics/article2431.html internet multicast video delivery]
[http://page.freett.com/nihuber/dover-education.html nutrition education games for elementary school] [http://wijossel.finito.fc2.com/zelrelfiw.html movie review spirit water] [http://wijossel.finito.fc2.com/eltreba.html the firm body sculpting system 3 review] [http://lahassel.finito.fc2.com/lonely-russian.html lonely russian woman] [http://page.freett.com/maalvey/topic-1314.html counter strike 1.6 maps to download] [http://lumuene.finito.fc2.com/britten-pears-school.html green hills school new jersey] [http://rohutson.finito.fc2.com/topic-45.html island marathon result tybee] [http://rohutson.finito-web.com/inter-tv-ukraine.html http] [http://divollme.myspace1.nazca.co.jp/991.html ohio pug rescue] [http://bajones.myspace1.nazca.co.jp/799.html new york blackout 1965] [http://hestaton.finito-web.com/1203.html turnaround management firms] [http://panyaj.netrend.jp/topic-384.html tego calderon lyrics we dont love them hoes] [http://rurambo.finito-web.com/38.html pelham school wimbledon] [http://wijossel.finito-web.com/eau-claire-express.html colfax iowa history] [http://s1.shard.jp/srwn2/123.html broadband optimizers] [http://page.freett.com/nihuber/central-council.html central council for education and training in social work] [http://deljaraa.strefa.pl/kobugrole.html georgia gymnastics academy lawrenceville] [http://s1.shard.jp/flaweddoll/topic-450.html belltech business card designer pro 1.0] [http://wifolkge.strefa.pl/alabama-girl-in.html texas ford dealership] [http://eleplro.strefa.pl/topic-104.html louisiana representative districts] [http://lahassel.finito.fc2.com/is-siberia-part.html is siberia part of russia] [http://bajones.myspace1.nazca.co.jp/1727.html new york state natural heritage trust] [http://s1.shard.jp/murasakineko/topic-412.html buy email link name phentermine.html soma.orxc.com] [http://bugvoufe.strefa.pl/henzarsi.html depot home improvement store] [http://wijossel.finito-web.com/whitefish-cell.html fillmore poster ties] [http://jmarina.netrend.jp/paul-smith-money.html amount of money spent on fast food] [http://wijossel.finito.fc2.com/mexbasc.html pny 6800gt review] [http://deljaraa.strefa.pl/golououca.html texas renegade] [http://lahassel.finito.fc2.com/crowne-plaza.html russian trilobites] [http://emrichar.myspace1.nazca.co.jp/topic-1131.html illinois historic site] [http://page.freett.com/mcholson/1718.html charlatte migennes france] [http://beadcock.finito.fc2.com/topic-3.html rock thr] [http://stbeals.myspace1.nazca.co.jp/topic-1341.html indiana jones music score] [http://shrochel.finito-web.com/system-of-a-down.html system of a down legend of zelda song] [http://hestaton.finito-web.com/267.html computer will not turn on] [http://rohutson.finito-web.com/cartoonnetworkcom.html links] [http://page.freett.com/hacapdow/1882.html baby cat phat star way] [http://eleplro.strefa.pl/topic-988.html ohio reptile rescue] [http://page.freett.com/headkin/159.html national personnel records center military personnel records] [http://rohutson.finito.fc2.com/topic-1897.html page] [http://bamcrae.myspace1.nazca.co.jp/323.html kansas city rap] [http://eleplro.strefa.pl/topic-766.html georgia job university] [http://s1.shard.jp/bigtyma/equity-bank.html governers job bank texas] [http://dashanno.finito-web.com/topic-302.html algarve travel] [http://mimannbe.myspace1.nazca.co.jp/dronbocb.html hawaii airline] [http://lumuene.finito.fc2.com/ballet-dance.html shiner high school] [http://rohutson.finito-web.com/inter-tv-ukraine.html index] [http://cryred.netrend.jp/375.html council of legal education victoria] [http://bamcrae.myspace1.nazca.co.jp/1847.html kansas city honda motorcycle] [http://page.freett.com/nihuber/educational-benchmarking.html education elementary resource school]
[http://page.freett.com/nihuber/dover-education.html nutrition education games for elementary school] [http://wijossel.finito.fc2.com/zelrelfiw.html movie review spirit water] [http://wijossel.finito.fc2.com/eltreba.html the firm body sculpting system 3 review] [http://lahassel.finito.fc2.com/lonely-russian.html lonely russian woman] [http://page.freett.com/maalvey/topic-1314.html counter strike 1.6 maps to download] [http://lumuene.finito.fc2.com/britten-pears-school.html green hills school new jersey] [http://rohutson.finito.fc2.com/topic-45.html island marathon result tybee] [http://rohutson.finito-web.com/inter-tv-ukraine.html http] [http://divollme.myspace1.nazca.co.jp/991.html ohio pug rescue] [http://bajones.myspace1.nazca.co.jp/799.html new york blackout 1965] [http://hestaton.finito-web.com/1203.html turnaround management firms] [http://panyaj.netrend.jp/topic-384.html tego calderon lyrics we dont love them hoes] [http://rurambo.finito-web.com/38.html pelham school wimbledon] [http://wijossel.finito-web.com/eau-claire-express.html colfax iowa history] [http://s1.shard.jp/srwn2/123.html broadband optimizers] [http://page.freett.com/nihuber/central-council.html central council for education and training in social work] [http://deljaraa.strefa.pl/kobugrole.html georgia gymnastics academy lawrenceville] [http://s1.shard.jp/flaweddoll/topic-450.html belltech business card designer pro 1.0] [http://wifolkge.strefa.pl/alabama-girl-in.html texas ford dealership] [http://eleplro.strefa.pl/topic-104.html louisiana representative districts] [http://lahassel.finito.fc2.com/is-siberia-part.html is siberia part of russia] [http://bajones.myspace1.nazca.co.jp/1727.html new york state natural heritage trust] [http://s1.shard.jp/murasakineko/topic-412.html buy email link name phentermine.html soma.orxc.com] [http://bugvoufe.strefa.pl/henzarsi.html depot home improvement store] [http://wijossel.finito-web.com/whitefish-cell.html fillmore poster ties] [http://jmarina.netrend.jp/paul-smith-money.html amount of money spent on fast food] [http://wijossel.finito.fc2.com/mexbasc.html pny 6800gt review] [http://deljaraa.strefa.pl/golououca.html texas renegade] [http://lahassel.finito.fc2.com/crowne-plaza.html russian trilobites] [http://emrichar.myspace1.nazca.co.jp/topic-1131.html illinois historic site] [http://page.freett.com/mcholson/1718.html charlatte migennes france] [http://beadcock.finito.fc2.com/topic-3.html rock thr] [http://stbeals.myspace1.nazca.co.jp/topic-1341.html indiana jones music score] [http://shrochel.finito-web.com/system-of-a-down.html system of a down legend of zelda song] [http://hestaton.finito-web.com/267.html computer will not turn on] [http://rohutson.finito-web.com/cartoonnetworkcom.html links] [http://page.freett.com/hacapdow/1882.html baby cat phat star way] [http://eleplro.strefa.pl/topic-988.html ohio reptile rescue] [http://page.freett.com/headkin/159.html national personnel records center military personnel records] [http://rohutson.finito.fc2.com/topic-1897.html page] [http://bamcrae.myspace1.nazca.co.jp/323.html kansas city rap] [http://eleplro.strefa.pl/topic-766.html georgia job university] [http://s1.shard.jp/bigtyma/equity-bank.html governers job bank texas] [http://dashanno.finito-web.com/topic-302.html algarve travel] [http://mimannbe.myspace1.nazca.co.jp/dronbocb.html hawaii airline] [http://lumuene.finito.fc2.com/ballet-dance.html shiner high school] [http://rohutson.finito-web.com/inter-tv-ukraine.html index] [http://cryred.netrend.jp/375.html council of legal education victoria] [http://bamcrae.myspace1.nazca.co.jp/1847.html kansas city honda motorcycle] [http://page.freett.com/nihuber/educational-benchmarking.html education elementary resource school]
[http://aquisechatea.com/galeria/albums/userpics/10002/page115.html silent movie theater on fairfax] [http://woningpagina.com/pics/flash/comment-1097.html american express money wire] [http://appleturnover.tv/about/images/news-638-20090704.html las vegas poker tournaments february] [http://carpentercarpenter.ca/_doubletuttle/images/comment-1231.html printed sweatshirts] [http://aarh.net/generator/assets/gallery3/topic-61.html gazebo designs] [http://techwebcast.info/forum/attachments/files/page-347.html wwe diva stacy keibler.] [http://ackcsc.org/club.bak/media/flash/bascfu.htm razzle] [http://aarh.net/generator/assets/gallery3/index.html map] [http://tatlin.com/gallery/wp-content/uploads/2008/topic-17.htm iowa city entertainment] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-2047.htm walley fishing manitoba] [http://tatlin.com/gallery/wp-content/uploads/2008/index.htm site] [http://casv.ca/secondary/class/install/1376.html indecent proposal video clip] [http://techwebcast.info/forum/attachments/files/page-1205.html free gd55 mobile panasonic ringtone] [http://beachcki.org/officers/wpThumbnails/pics/topic519.htm moms movies.com] [http://rvpark4u.com/weblog/skins/rsd/files/page181.html a perfect circle music video downloads] [http://carpentercarpenter.ca/_doubletuttle/images/comment-1169.html amateur submitted movies] [http://aarh.net/generator/assets/gallery3/topic-925.html auto nationwide watch.com] [http://techwebcast.info/forum/attachments/files/page-395.html marisa miller video] [http://aarh.net/generator/assets/gallery3/topic-1595.html free mobile panasonic ringtone] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-1203.htm movie schedule tinseltown] [http://rubyarts.org/images/icons/news-486.html sponges phylum] [http://juliemorstad.com/contactform/forms/images/article1130.htm popup blockers] [http://brixhost.net/my/attachments/media/news-228-2009-07-02.html russian mature movies] [http://pixsoulmedia.com/dev/images/thumbs/article422.html secretely] [http://casv.ca/secondary/class/install/2418.html music roger video zapp] [http://cavaliersonline.com/photos/icons/text1385.htm nude madonna] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-53.htm dan post boots] [http://beachcki.org/officers/wpThumbnails/pics/sitemap.html sitemap] [http://appleturnover.tv/about/images/news-2163-20090630.html annie lennox ringtone] [http://beachcki.org/officers/wpThumbnails/pics/topic777.htm framed photos] [http://pixsoulmedia.com/dev/images/thumbs/article2357.html movie clip heather graham] [http://ackcsc.org/club.bak/media/flash/index.htm link] [http://aquisechatea.com/galeria/albums/userpics/10002/page214.html mass transit magazines] [http://castlekeepcavaliers.com/generator/assets/files/page9.html coach replica] [http://appleturnover.tv/about/images/news-1467-20090629.html amr ringtones free download] [http://appleturnover.tv/about/images/news-955-20090622.html english to german] [http://thewholesaler.co.uk/newsletter/data/images/article1692.html masterbate clit] [http://aquisechatea.com/galeria/albums/userpics/10002/page1211.html electric burr grinder] [http://pixsoulmedia.com/dev/images/thumbs/article1923.html pharmacy] [http://pixsoulmedia.com/dev/images/thumbs/article946.html ethnic video] [http://rubyarts.org/images/icons/news-1767.html sexual intercourse photos] [http://cavalierpedigrees.com/XOOPS/images/text1216.htm deer hunting] [http://rvpark4u.com/weblog/skins/rsd/files/page21.html igrice video] [http://cavaliersonline.com/photos/icons/text1365.htm microsoft open license site] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-2253.htm nostalgiques stickers] [http://rvpark4u.com/weblog/skins/rsd/files/page1677.html russian movie download] [http://thewholesaler.co.uk/newsletter/data/images/article792.html movie icon avatars] [http://capstonerealty.ph/gallery/Farm_Lots/mini/resource-1179.html anna ohura videos] [http://rubyarts.org/images/icons/news-60.html phentermine pharmacy biz] [http://cavalierpedigrees.com/XOOPS/images/text1532.htm wet nurses]
[http://aquisechatea.com/galeria/albums/userpics/10002/page115.html silent movie theater on fairfax] [http://woningpagina.com/pics/flash/comment-1097.html american express money wire] [http://appleturnover.tv/about/images/news-638-20090704.html las vegas poker tournaments february] [http://carpentercarpenter.ca/_doubletuttle/images/comment-1231.html printed sweatshirts] [http://aarh.net/generator/assets/gallery3/topic-61.html gazebo designs] [http://techwebcast.info/forum/attachments/files/page-347.html wwe diva stacy keibler.] [http://ackcsc.org/club.bak/media/flash/bascfu.htm razzle] [http://aarh.net/generator/assets/gallery3/index.html map] [http://tatlin.com/gallery/wp-content/uploads/2008/topic-17.htm iowa city entertainment] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-2047.htm walley fishing manitoba] [http://tatlin.com/gallery/wp-content/uploads/2008/index.htm site] [http://casv.ca/secondary/class/install/1376.html indecent proposal video clip] [http://techwebcast.info/forum/attachments/files/page-1205.html free gd55 mobile panasonic ringtone] [http://beachcki.org/officers/wpThumbnails/pics/topic519.htm moms movies.com] [http://rvpark4u.com/weblog/skins/rsd/files/page181.html a perfect circle music video downloads] [http://carpentercarpenter.ca/_doubletuttle/images/comment-1169.html amateur submitted movies] [http://aarh.net/generator/assets/gallery3/topic-925.html auto nationwide watch.com] [http://techwebcast.info/forum/attachments/files/page-395.html marisa miller video] [http://aarh.net/generator/assets/gallery3/topic-1595.html free mobile panasonic ringtone] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-1203.htm movie schedule tinseltown] [http://rubyarts.org/images/icons/news-486.html sponges phylum] [http://juliemorstad.com/contactform/forms/images/article1130.htm popup blockers] [http://brixhost.net/my/attachments/media/news-228-2009-07-02.html russian mature movies] [http://pixsoulmedia.com/dev/images/thumbs/article422.html secretely] [http://casv.ca/secondary/class/install/2418.html music roger video zapp] [http://cavaliersonline.com/photos/icons/text1385.htm nude madonna] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-53.htm dan post boots] [http://beachcki.org/officers/wpThumbnails/pics/sitemap.html sitemap] [http://appleturnover.tv/about/images/news-2163-20090630.html annie lennox ringtone] [http://beachcki.org/officers/wpThumbnails/pics/topic777.htm framed photos] [http://pixsoulmedia.com/dev/images/thumbs/article2357.html movie clip heather graham] [http://ackcsc.org/club.bak/media/flash/index.htm link] [http://aquisechatea.com/galeria/albums/userpics/10002/page214.html mass transit magazines] [http://castlekeepcavaliers.com/generator/assets/files/page9.html coach replica] [http://appleturnover.tv/about/images/news-1467-20090629.html amr ringtones free download] [http://appleturnover.tv/about/images/news-955-20090622.html english to german] [http://thewholesaler.co.uk/newsletter/data/images/article1692.html masterbate clit] [http://aquisechatea.com/galeria/albums/userpics/10002/page1211.html electric burr grinder] [http://pixsoulmedia.com/dev/images/thumbs/article1923.html pharmacy] [http://pixsoulmedia.com/dev/images/thumbs/article946.html ethnic video] [http://rubyarts.org/images/icons/news-1767.html sexual intercourse photos] [http://cavalierpedigrees.com/XOOPS/images/text1216.htm deer hunting] [http://rvpark4u.com/weblog/skins/rsd/files/page21.html igrice video] [http://cavaliersonline.com/photos/icons/text1365.htm microsoft open license site] [http://caypkiwanis.org/main/wp-content/uploads/2007/09/article-2253.htm nostalgiques stickers] [http://rvpark4u.com/weblog/skins/rsd/files/page1677.html russian movie download] [http://thewholesaler.co.uk/newsletter/data/images/article792.html movie icon avatars] [http://capstonerealty.ph/gallery/Farm_Lots/mini/resource-1179.html anna ohura videos] [http://rubyarts.org/images/icons/news-60.html phentermine pharmacy biz] [http://cavalierpedigrees.com/XOOPS/images/text1532.htm wet nurses]
Line 13: Line 14:
conference room and alerts us to words and phrases that we want it to
conference room and alerts us to words and phrases that we want it to
listen for. There are two popular conference protocols, as mentioned in
listen for. There are two popular conference protocols, as mentioned in
-
Section 6.2.6—the presence-based Groupchat protocol, and the
+
Section 6.2.6—the presence-based Groupchat protocol, and the
<tt>jabber:iq:conference</tt>-based Conference protocol. The assistant
<tt>jabber:iq:conference</tt>-based Conference protocol. The assistant
recipe, a foray into the world of 'bots, takes a look at the original
recipe, a foray into the world of 'bots, takes a look at the original
Line 23: Line 24:
where this melding needs to happen. The first is a homage to the Trojan
where this melding needs to happen. The first is a homage to the Trojan
Room Coffee Machine (http://www.cl.cam.ac.uk/coffee/coffee.html), where
Room Coffee Machine (http://www.cl.cam.ac.uk/coffee/coffee.html), where
-
we give life, or at least presence, to a coffeepot, using LEGO®
+
we give life, or at least presence, to a coffeepot, using LEGO®
-
MINDSTORMS™. The second is a Tk-based RSS headline viewer. Both the
+
MINDSTORMS™. The second is a Tk-based RSS headline viewer. Both the
coffeepot and the Tk programming library have event loops of their own.
coffeepot and the Tk programming library have event loops of their own.
With the coffeepot, we need to have a loop that polls the coffeepot's
With the coffeepot, we need to have a loop that polls the coffeepot's
Line 48: Line 49:
between programming a client and programming a component in this chapter
between programming a client and programming a component in this chapter
and build a complete component that can be queried and interacted with
and build a complete component that can be queried and interacted with
-
using the third of Jabber's building blocks—the <tt>&lt;iq/&gt;</tt>
+
using the third of Jabber's building blocks—the <tt>&lt;iq/&gt;</tt>
element.
element.
Line 91: Line 92:
becoming a conference user identified by a nickname that is chosen upon
becoming a conference user identified by a nickname that is chosen upon
entering that room. Nicknames are generally used in conference rooms to
entering that room. Nicknames are generally used in conference rooms to
-
provide a modicum of privacy—it is assumed that by default you don't
+
provide a modicum of privacy—it is assumed that by default you don't
want to let the other conference room members know your real JID.
want to let the other conference room members know your real JID.
Line 97: Line 98:
interaction: a simple one that provides basic features and a more
interaction: a simple one that provides basic features and a more
complex one that provides the basic features plus facilities such as
complex one that provides the basic features plus facilities such as
-
password-protected rooms and room descriptions—Groupchat and Conference.
+
password-protected rooms and room descriptions—Groupchat and Conference.
Line 247: Line 248:
: <tt>error</tt> and comes from the artificial JID constructed in the
: <tt>error</tt> and comes from the artificial JID constructed in the
: room entry attempt. The element is addressed to <tt>qmacro</tt>'s real
: room entry attempt. The element is addressed to <tt>qmacro</tt>'s real
-
: JID, of course—<tt>qmacro@jabber.com/jarltk</tt>—as otherwise it
+
: JID, of course—<tt>qmacro@jabber.com/jarltk</tt>—as otherwise it
: wouldn't reach him. : The error code 409 and text "Conflict" tells
: wouldn't reach him. : The error code 409 and text "Conflict" tells
: <tt>qmacro</tt> that the nickname conflicted with one already in the
: <tt>qmacro</tt> that the nickname conflicted with one already in the
Line 261: Line 262:
</code>
</code>
-
: This time, there is no conflict—no other user is in the room "cellar"
+
: This time, there is no conflictâÃÃÃ�
-
: with that nickname—and the conference component registers the entry.
+
-
: It does this by sending <tt>qmacro</tt> the presence of all the room
+
-
: occupants, including that of himself:
+
-
<code>RECV: &lt;presence to='qmacro@jabber.com/jarltk'
+
-
from='cellar@conf.merlix.dyndns.org/flash'/&gt;
+
-
 
+
-
RECV: &lt;presence to='qmacro@jabber.com/jarltk'
+
-
from='cellar@conf.merlix.dyndns.org/roscoe'/&gt;
+
-
 
+
-
RECV: &lt;presence to='qmacro@jabber.com/jarltk'
+
-
from='cellar@conf.merlix.dyndns.org/deejay'/&gt;
+
-
 
+
-
</code>
+
-
: These presence elements are also sent to the other room occupants so
+
-
: they know that <tt>deejay</tt> is present.
+
-
; Conference component-generated notification
+
-
: In addition to the presence elements sent for each room occupant, a
+
-
: general roomwide message noting that someone with the nickname
+
-
: <tt>deejay</tt> just entered the room is sent out by the component as
+
-
: a <tt>type='groupchat'</tt> message to all the room occupants:
+
-
<code>RECV: &lt;message to='qmacro@jabber.com/jarltk' type='groupchat'
+
-
from='cellar@conf.merlix.dyndns.org'&gt; &lt;body&gt;deejay has become
+
-
available&lt;/body&gt; &lt;/message&gt;
+
-
 
+
-
</code>
+
-
: The text "has become available" used in the body of the message is
+
-
: taken directly from the ''Action Notices'' definitions, part of the
+
-
: Conferencing component instance configuration described in Section
+
-
: 4.10.3. Note that the identity of the room itself is simply a generic
+
-
: version of the JID that the room occupants use to enter:
+
-
<code>cellar@conf.merlix.dyndns.org
+
-
 
+
-
</code>
+
-
 
+
-
; Roomwide chat
+
-
: Once the user with the nickname <tt>roscoe</tt> sees someone enter the
+
-
: room, he sends a greeting, and <tt>qmacro</tt> waves back:
+
-
<code>RECV: &lt;message to='qmacro@jabber.com/jarltk'
+
-
from='cellar@conf.merlix.dyndns.org/roscoe' type='groupchat' cnu=''&gt;
+
-
&lt;body&gt;hi qmacro&lt;/body&gt; &lt;/message&gt;
+
-
 
+
-
SEND: &lt;message to='cellar@conf.merlix.dyndns.org'
+
-
type='groupchat'&gt; &lt;body&gt;/me waves to everyone&lt;/body&gt;
+
-
&lt;/message&gt;
+
-
 
+
-
</code>
+
-
: As with the notification message, each message is a
+
-
: <tt>groupchat</tt>-type message. The one received appears to come from
+
-
: <tt>cellar@conf.merlix.dyndns.org/roscoe</tt>, which is the JID
+
-
: representing the user in the room with the nickname <tt>roscoe</tt>.
+
-
: This way, <tt>roscoe</tt>'s real JID is never sent to <tt>qmacro</tt>.
+
-
: The message <tt>deejay</tt> sends is addressed to the room's identity
+
-
: <tt>cellar@conf.merlix.dyndns.org</tt>, and contains a message that
+
-
: starts with <tt>/me</tt>. This is simply a convention that is
+
-
: understood by clients that support conferencing, meant to represent an
+
-
: action and displayed thus:
+
-
<code>* deejay waves to everyone
+
-
 
+
-
</code>
+
-
 
+
-
{{Note|Ignore the <tt>cnu</tt> attribute; it's put there and used by the
+
-
component and should never make it out to the client endpoints. The
+
-
attribute name is a short name for the conference user and refers to the
+
-
internal structure that represents a conference room occupant within the
+
-
component.
+
-
 
+
-
</code>
+
-
 
+
-
; One-on-one chat
+
-
: The Conferencing component also supports a one-on-one chat mode, which
+
-
: is just like normal chat mode (where messages with the type
+
-
: <tt>chat</tt> are exchanged) except that the routing goes through the
+
-
: component. The intended recipient of a conference-routed chat message
+
-
: is identified by his room JID. So in this example:
+
-
<code>RECV: &lt;message to='qmacro@jabber.com/jarltk'
+
-
from='cellar@conf.merlix.dyndns.org/flash' type='chat'&gt;
+
-
&lt;body&gt;Is that you, qmacro?&lt;/body&gt;
+
-
&lt;thread&gt;jarl1998911094&lt;/thread&gt; &lt;/message&gt;
+
-
 
+
-
</code>
+
-
: the user nicknamed <tt>flash</tt> actually addressed the chat message
+
-
: to the JID:
+
-
<code>cellar@conf.merlix.dyndns.org/deejay
+
-
</code>
+
-
: which arrived at the Conferencing component (because of the hostname,
+
-
: <tt>conf.merlix.dyndns.org</tt> causes the <tt>&lt;message/&gt;</tt>
+
-
: element to be routed there), which then looked up internally who
+
-
: <tt>deejay</tt> really was (<tt>qmacro@jabber.com/jarltk</tt>) and
+
-
: sent it on. This way, the recipient of a conference-routed message
+
-
: never discovers the real JID of the sender. In all other ways, the
+
-
: actual <tt>&lt;message/&gt;</tt> element is like any other
+
-
: <tt>&lt;message/&gt;</tt> element—in this case, it contains a message
+
-
: <tt>&lt;body/&gt;</tt> and a chat <tt>&lt;thread/&gt;</tt>. (See
+
-
: Section 5.4.1 for details on the <tt>&lt;message/&gt;</tt> element.)
+
-
; Leaving the room
+
-
: In the same way that room entrance is effected by sending an
+
-
: <tt>available</tt> presence (remember, a <tt>&lt;presence/&gt;</tt>
+
-
: element without an explicit <tt>type</tt> attribute is understood to
+
-
: represent <tt>type="available'</tt>), leaving a room is achieved by
+
-
: doing the opposite:
+
-
<code>RECV: &lt;presence to='qmacro@jabber.com/jarltk'
+
-
type='unavailable' from='cellar@conf.merlix.dyndns.org/roscoe'/&gt;
+
-
 
+
-
</code>
+
-
: The people in the conference room are sent a message that
+
-
: <tt>roscoe</tt> has left the room by the <tt>unavailable</tt> presence
+
-
: packet. This is by and large for the benefit of each user's client, so
+
-
: that the room occupant list can be updated. The component also sends
+
-
: out a verbal notification, in the same way as it sends a verbal
+
-
: notification out when someone joins:
+
-
<code>RECV: &lt;message to='qmacro@jabber.com/jarltk' type='groupchat'
+
-
from='cellar@conf.merlix.dyndns.org'&gt; &lt;body&gt;roscoe has
+
-
left&lt;/body&gt; &lt;/message&gt;
+
-
 
+
-
</code>
+
-
: Like the join notification, the text for the leave notification ("has
+
-
: left") comes directly from the component instance configuration
+
-
: described in Section 4.10.3.
+
-
<br>
+
-
=== The Script's Scope ===
+
-
<br>The Keyword Assistant (''keyassist'') script
+
-
will be written in Python using the <tt>Jabberpy</tt> library. As
+
-
mentioned earlier, the script will perform the following tasks:
+
-
 
+
-
* Connect to a predetermined Jabber server
+
-
* Join a predetermined conference room
+
-
* Sit there quietly, listening to the conversation
+
-
* Take simple commands from people to watch for, or stop watching for, particular words or phrases uttered in the room
+
-
* Relay the context of those words or phrases to whomever requested them, if heard In addition
+
-
to setting the identity of the Jabber server and the conference room in variables, we'll also need to keep track of which users ask the assistant for words and phrases.
+
-
<br>We'll use a ''dictionary'' (''hash'' in
+
-
Perl terms), as shown in Example 9-3, because we want to manage the data
+
-
in there by key, the JID of those users that the script will be
+
-
assisting. Having a look at what this dictionary will look like during
+
-
the lifetime of this script will help us to visualize what we're trying
+
-
to achieve.
+
-
 
+
-
 
+
-
''Typical contents of the Keyword Assistant's dictionary''
+
-
 
+
-
<code>{ 'dj@gnu.pipetree.com/home': { 'http:': 1, 'ftp:': 1
+
-
},
+
-
 
+
-
'piers@jabber.org/work': { 'Perl': 1, 'Java': 1, 'SAP
+
-
R/3': 1
+
-
},
+
-
 
+
-
'cellar@conf.merlix.dyndns.org/roscoe': { 'dialback': 1
+
-
}
+
-
}
+
-
 
+
-
</code>
+
-
We can see from the contents of the dictionary in Example 9-3 that three
+
-
people have asked the script to look out for words and phrases. Two of
+
-
those people—<tt>dj</tt> and <tt>piers</tt>—have interacted with the
+
-
script directly by sending a ''normal'' (or <tt>chat</tt>)
+
-
<tt>&lt;message/&gt;</tt>. The other person, with the conference
+
-
nickname <tt>roscoe</tt>, is in the "cellar" room and has sent the
+
-
script a message routed through the Conference component in the same way
+
-
that <tt>flash</tt> sent <tt>qmacro</tt> a private message in Example
+
-
9-2: the JID of the sender belongs to (has the hostname set to) the
+
-
conference component. Technically, there's nothing to distinguish the
+
-
three JIDs here; it's just that we know from the name that
+
-
<tt>conf.merlix.dyndns.org</tt> is the name that identifies such a
+
-
component.
+
-
 
+
-
If we dissect the dictionary, we can see that:
+
-
 
+
-
* <tt>dj</tt> wants to be notified if any web or FTP URLs are mentioned.
+
-
* <tt>piers</tt> is interested in references to two of his favorite
+
-
languages and his favorite business software solution.
+
-
* <tt>roscoe</tt>
+
-
is interested in any talk about dialback. We said we'd give the script a
+
-
little bit of intelligence. This was a reference to the ability for
+
-
users to interact with the script while it runs, rather than having to
+
-
give the script a static list of words and phrases in a configuration
+
-
file. <tt>dj</tt>, <tt>piers</tt>, and <tt>roscoe</tt> have done this by
+
-
sending the script messages (directly, not within the room) with simple
+
-
keyword commands, such as:
+
-
 
+
-
: dj: "''watch http:''" script: "''ok, watching for http:''" dj:
+
-
: "''watch gopher:''" script: "''ok, watching for gopher:''" dj:
+
-
: "''watch ftp:''" script: "''ok, watching for ftp:''" dj: "''ignore
+
-
: gopher:''" script: "''ok, now ignoring gopher:''"
+
-
...
+
-
 
+
-
: piers: "''list''" script: "''watching for: Perl, Java, SAP R/3''"
+
-
...
+
-
 
+
-
: roscoe: "''stop''" script: "''ok, I've stopped watching''"
+
-
 
+
-
<br>
+
-
=== The keyassist Script ===
+
-
<br>Example 9-4 shows the ''keyassist'' script
+
-
in its entirety. The script is described in detail, step by step, in the
+
-
next section.
+
-
 
+
-
 
+
-
''The keyassist Perl script''
+
-
 
+
-
<code>import jabber from string import split, join, find import sys
+
-
 
+
-
keywords = {}
+
-
 
+
-
def addword(jid, word): if not keywords.has_key(jid): keywords[jid] = {}
+
-
keywords[jid][word] = 1
+
-
 
+
-
def delword(jid, word): if keywords.has_key(jid): if
+
-
keywords[jid].has_key(word): del keywords[jid][word]
+
-
 
+
-
def messageCB(con, msg):
+
-
 
+
-
type = msg.getType() if type == None: type = 'normal'
+
-
 
+
-
# Deal with interaction
+
-
if type == 'chat' or type == 'normal': jid = str(msg.getFrom())
+
-
 
+
-
message = split(msg.getBody(), None, 1); reply = ""
+
-
 
+
-
if message[0] == 'watch': addword(jid, message[1]) reply =
+
-
"Okay, watching for " + message[1]
+
-
 
+
-
if message[0] == 'ignore': delword(jid, message[1]) reply =
+
-
"Okay, now ignoring " + message[1]
+
-
 
+
-
if message[0] == 'list': if keywords.has_key(jid): reply =
+
-
"Watching for: " + join(keywords[jid].keys(), ", ") else: reply
+
-
= "Not watching for any keywords"
+
-
 
+
-
if message[0] == 'stop': if keywords.has_key(jid): del
+
-
keywords[jid] reply = "Okay, I've stopped watching"
+
-
 
+
-
if reply: con.send(msg.build_reply(reply))
+
-
 
+
-
 
+
-
# Scan room talk
+
-
if type == 'groupchat': message = msg.getBody()
+
-
 
+
-
for jid in keywords.keys(): for word in keywords[jid].keys(): if
+
-
find(message, word) &gt;= 0: con.send(jabber.Message(jid, word +
+
-
": " + message))
+
-
 
+
-
 
+
-
def presenceCB(con, prs):
+
-
 
+
-
# Deal with nickname conflict in room
+
-
if str(prs.getFrom()) == roomjid and prs.getType() == 'error':
+
-
prsnode = prs.asNode() error = prsnode.getTag('error') if error: if
+
-
(error.getAttr('code') == '409'): print "Cannot join room -
+
-
conflicting nickname" con.disconnect() sys.exit(0)
+
-
 
+
-
# Remove keyword list for groupchat correspondent
+
-
if prs.getType() == 'unavailable': jid = str(prs.getFrom()) if
+
-
keywords.has_key(jid): del keywords[jid]
+
-
 
+
-
Server = 'gnu.mine.nu' Username = 'kassist' Password = 'pass' Resource
+
-
= 'py'
+
-
 
+
-
Room = 'jdev' ConfServ = 'conference.jabber.org' Nick =
+
-
'kassist'
+
-
 
+
-
con = jabber.Client(host=Server) try: con.connect() except IOError, e:
+
-
print "Couldn't connect: %s" % e sys.exit(0) else: print "Connected"
+
-
 
+
-
if con.auth(Username,Password,Resource): print "Logged in as %s to
+
-
server %s" % ( Username, Server ) else: print "Problems authenticating:
+
-
", con.lastErr, con.lastErrCode sys.exit(1)
+
-
 
+
-
con.setMessageHandler(messageCB) con.setPresenceHandler(presenceCB)
+
-
 
+
-
con.send(jabber.Presence())
+
-
 
+
-
roomjid = Room + '@' + ConfServ + '/' + Nick print "Joining " + Room
+
-
con.send(jabber.Presence(to=roomjid))
+
-
 
+
-
while(1): con.process(5)
+
-
 
+
-
</code>
+
-
 
+
-
<br>
+
-
=== Dissecting the keyassist Script ===
+
-
<br>Taking ''keyassist'' step by
+
-
step, the first section is probably familiar if you've seen the previous
+
-
Python-based scripts in Section 8.1 and Section 8.3, both in Chapter 8.
+
-
 
+
-
 
+
-
<code>import jabber from string import split, join, find import sys
+
-
 
+
-
</code>
+
-
Here, all of the functions and libraries that we'll need are brought in.
+
-
We'll use the <tt>find</tt> function from the <tt>string</tt> library to
+
-
help with the keyword searching.
+
-
 
+
-
Next, we declare the dictionary. This will hold a list of the words that
+
-
the script will look for, as defined by each person, as shown in Example
+
-
9-3.
+
-
 
+
-
 
+
-
<code>keywords = {}
+
-
 
+
-
</code>
+
-
 
+
-
<br>
+
-
==== Maintaining the keyword dictionary ====
+
-
<br>To maintain this
+
-
dictionary, we will use two subroutines to add words to and remove words
+
-
from a user's word list. These subroutines are called when a command
+
-
such as ''watch'' or ''ignore'' is recognized in the callback subroutine
+
-
that handles incoming <tt>&lt;message/&gt;</tt> elements:
+
-
 
+
-
 
+
-
<code>def addword(jid, word): if not keywords.has_key(jid):
+
-
keywords[jid] = {} keywords[jid][word] = 1
+
-
 
+
-
def delword(jid, word): if keywords.has_key(jid): if
+
-
keywords[jid].has_key(word): del keywords[jid][word]
+
-
 
+
-
</code>
+
-
A string representation of the JID (in <tt>jid</tt>) of the
+
-
correspondent giving the command is passed to the subroutines along with
+
-
the word or phrase specified (in <tt>word</tt>) by the user. The
+
-
dictionary has two levels: the first level is keyed by the JID, and the
+
-
second by word or phrase. We use a dictionary, rather than an array, at
+
-
the second level simply to make removal of words and phrases easier.
+
-
 
+
-
 
+
-
<br>
+
-
==== Message callback ====
+
-
<br>Next, we define the callback to handle
+
-
incoming <tt>&lt;message/&gt;</tt> elements:
+
-
 
+
-
 
+
-
<code>def messageCB(con, msg):
+
-
 
+
-
type = msg.getType() if type == None: type = 'normal'
+
-
 
+
-
</code>
+
-
As usual, we're expecting the message callback to be passed the
+
-
connection object (in <tt>con</tt>) and the message object itself
+
-
(<tt>msg</tt>). How this callback is to proceed is determined by the
+
-
''type'' of message received. We determine the type (taken from the
+
-
<tt>&lt;message/&gt;</tt> element's <tt>type</tt> attribute) and store
+
-
it in the variable called <tt>type</tt>. Remember that if no
+
-
<tt>type</tt> attribute is present, a message type of <tt>normal</tt> is
+
-
assumed. (See Section 5.4.1.1 for details of <tt>&lt;message/&gt;</tt>
+
-
attributes.)
+
-
 
+
-
The two types of incoming messages we're expecting this script to
+
-
receive are those conveying the room's conversation—in
+
-
<tt>groupchat</tt>-type messagesâ€ÃÃÃÂ�
+

Revision as of 02:30, 16 August 2009

norey luxor writing instruments pvt. ltd jin rapping video index available bondage custom model video sxga notebooks of mp3 mp3s music mp3 http scuba diving centers add link manager movie reciprocal coors field url the scooter store adult laotian video splinter cell chaos theory co op video help with troubled teen aol isp information pinnacle pctv stereo serial 100 1987 billboard top professional video cameras uk tiny black tits laura movie nubiles teacup puppy lady sonya movies aoxppr 2.42 serial nude women in showers cortislim arthritis drug lawyer mine again lyrics mariah hilton sisters kelly online r tape video taxes,laws,guide 13 year old nude opo3 arizona home owners insurance circuitcity.com oscar nominated movie reviews aljazeera english version lake taho champion shuffleboard manual rucker park outlaw josey wales movie quotes online pharmacy tech course colombian models paris clip art pliweb school teacher videos links x man cartoon for sale internet multicast video delivery nutrition education games for elementary school movie review spirit water the firm body sculpting system 3 review lonely russian woman counter strike 1.6 maps to download green hills school new jersey island marathon result tybee http ohio pug rescue new york blackout 1965 turnaround management firms tego calderon lyrics we dont love them hoes pelham school wimbledon colfax iowa history broadband optimizers central council for education and training in social work georgia gymnastics academy lawrenceville belltech business card designer pro 1.0 texas ford dealership louisiana representative districts is siberia part of russia new york state natural heritage trust buy email link name phentermine.html soma.orxc.com depot home improvement store fillmore poster ties amount of money spent on fast food pny 6800gt review texas renegade russian trilobites illinois historic site charlatte migennes france rock thr indiana jones music score system of a down legend of zelda song computer will not turn on links baby cat phat star way ohio reptile rescue national personnel records center military personnel records page kansas city rap georgia job university governers job bank texas algarve travel hawaii airline shiner high school index council of legal education victoria kansas city honda motorcycle education elementary resource school silent movie theater on fairfax american express money wire las vegas poker tournaments february printed sweatshirts gazebo designs wwe diva stacy keibler. razzle map iowa city entertainment walley fishing manitoba site indecent proposal video clip free gd55 mobile panasonic ringtone moms movies.com a perfect circle music video downloads amateur submitted movies auto nationwide watch.com marisa miller video free mobile panasonic ringtone movie schedule tinseltown sponges phylum popup blockers russian mature movies secretely music roger video zapp nude madonna dan post boots sitemap annie lennox ringtone framed photos movie clip heather graham link mass transit magazines coach replica amr ringtones free download english to german masterbate clit electric burr grinder pharmacy ethnic video sexual intercourse photos deer hunting igrice video microsoft open license site nostalgiques stickers russian movie download movie icon avatars anna ohura videos phentermine pharmacy biz wet nurses white water rafting wales uk playstation3 merman movies ritalin adderall concerta sitemap decadron preview torrent file mpeg4 movie converter asia movie trailer craigs list denver irish drink mix 2005 draft nhl media player movie trailors leonard maltin movie reviews apache mysql php windows installer hohner nik sharpener pro serial index link penneys radiator hose wu-tang clan woman naked lowden guitar serial numbers recurso humanos matthew perry drug addiction kill myself eminem puke video easy producer video aspiration book guest lex on blondes domain oxycontin lil wyte lyrics what is extacy drug pretty ricky video total wine naked photo post adam brody jimmy kimmel best way to lose weight magnum movie p.i infant blood pressure normal plastic license plate blanks allfreegay trackpad powerbook adobe photoshop 8 cs cracked interpreter memphis homes el nino red envolope irene hunt pictures pussy eating gallery free web design template pwl cracker download activation end process product software cell motorola phone razr ringtone showplace 16 coon rapids mn url in nevada pharmacy school sexy seamed stockings sample sex video and movie speculumpages archive video files free ringtones alltel audiovox nastyrat.com marmalade mr review lolita index alive blaine clip david drowned video pioneer press page aurora fox mall valley 2 best camera digital megapixel links eating a balanced diet adultactioncam.com cardizem cd anabolic steroids actos altace robert palmer simply irresistible music video girls messy cheerleader pacific assault no cd crack shemale domination lunchboxes live night rap saturday video karate kata video free ohiolottery rakuen movie 4 inuyasha smoothmag wholesale home tanning bed honda radiator skydiving video clip movie lobby card index environmental sampling supplies valassis ivp care pharmacy pure country movie quotes student housing chicago cubs index pictures of rainbows top suffolk realty agents

Groupchat, : Components, and Event Models


By now, you should have a

good idea of how scripts interact with Jabber and how the core
elements such as <message/> and
<presence/> can be constructed and handled.

This chapter builds upon what we've already seen in Chapter 8 and introduces new concepts. We build a nosy assistant that joins a conference room and alerts us to words and phrases that we want it to listen for. There are two popular conference protocols, as mentioned in Section 6.2.6—the presence-based Groupchat protocol, and the jabber:iq:conference-based Conference protocol. The assistant recipe, a foray into the world of 'bots, takes a look at the original presence-based one.

As we've seen, programming within Jabber's event model is fairly straightforward. But what happens when you want to meld other components with event models of their own? We look at a couple of typical scenarios where this melding needs to happen. The first is a homage to the Trojan Room Coffee Machine (http://www.cl.cam.ac.uk/coffee/coffee.html), where we give life, or at least presence, to a coffeepot, using LEGO® MINDSTORMS™. The second is a Tk-based RSS headline viewer. Both the coffeepot and the Tk programming library have event loops of their own. With the coffeepot, we need to have a loop that polls the coffeepot's status, independently of the polling for incoming packets from the Jabber server. The Tk programming library's event model is similar to those of the Jabber programming libraries that are used in the recipes in this book, in that handlers are set up and a loop is started that listens for UI events. In both cases, we need to get these event loops to work in harmony with the Jabber libraries' event loops.

Building Jabber solutions without event loops is a Sisyphean task. The very nature of Jabber communication is event-based, and it's important to understand how to use the event features of the Jabber programming libraries and also how to be able to mesh those features with similar features in other libraries and systems.

We also look at extending messages and build a mechanism that delivers RSS headlines to clients who register with that mechanism. These headlines are carried using an extended message type. In fact, the RSS Delivery Mechanism is a component. The three recipes in Chapter 8, were Jabber clients, in that they connected to the Jabber network via the Jabber Session Manager (JSM) service. We look at the differences between programming a client and programming a component in this chapter and build a complete component that can be queried and interacted with using the third of Jabber's building blocks—the <iq/> element.

Happy coding!


Keyword Assistant


Many of the Jabber core and peripheral developers hang out in a conference room called jdev hosted by the Conferencing component on the Jabber server running at jabber.org. While a lot of useful information is to be gleaned from listening to what goes on in jdev, it isn't possible to be there all the time. Conversations in jdev are logged to web pages, which can be used to visit after the fact to try to catch up with things; however, this can be a hopeless task. One solution is to build a 'bot that looks for specific keywords and Uniform Resource Locators (URLs) in the conversations in jdev and send those on as Jabber messages.

This script, keyassist, connects to a Jabber server, enters a conference room, and listens to the conversations, looking for certain words and phrases to be uttered. The keyassist script is given a bit of "intelligence" in that it can be interacted with and told, while running, to watch for (or stop watching for), certain words and phrases.

The keyassist script introduces us to programmatic interaction with the Conferencing component. Before looking at the script, however, let's have a brief overview of Conferencing in general.



Conferencing


The Conferencing component at jabber.org is conference.jabber.org. Details of the component instance configuration for such a Conferencing component can be found in Section 4.10, where we see that the component exists as a shared object library connected with the library load component connection method. This component provides general conferencing facilities, oriented around a conference room and conference user model.

A Jabber user can enter (or join) a conference room, thereby becoming a conference user identified by a nickname that is chosen upon entering that room. Nicknames are generally used in conference rooms to provide a modicum of privacy—it is assumed that by default you don't want to let the other conference room members know your real JID.

The Conferencing component supports two protocols for user and room interaction: a simple one that provides basic features and a more complex one that provides the basic features plus facilities such as password-protected rooms and room descriptions—Groupchat and Conference.


{{Note|There is a third protocol, called Experimentaliq:groupchat, which came between the Groupchat and Conference protocols. This reflected an experimental move to add features to the basic Groupchat protocol using IQ elements, the contents of which were qualified by a namespace jabber:iq:groupchat. This protocol has been dropped, and support for it exists only in certain versions of WinJab and JIM.

</code>

Groupchat
The Groupchat protocol is the simpler of the two and provides basic
functions for entering and exiting conference rooms and choosing
nicknames. : This Groupchat protocol is known as the presence-based
protocol, because the protocol is based upon
<presence/> elements used for room entry, exit, and
nickname determination. The Groupchat protocol has a nominal version
number of 1.0.
Conference
The Conference protocol offers more advanced features than the
Groupchat protocol and makes use of two IQ namespaces:
jabber:iq:conference and jabber:iq:browse. It has a
nominal protocol version number of 1.4, which reflects the version of
the Jabber server with which it is delivered. Sometimes this version
number is referred to as 0.4, such as in the downloadable tarball and
in the value returned in response to a "version query" on the
component itself, as shown in Example 9-1. : The version number isn't
that important. The main thing to keep in mind is that the component
that is called conference.so (see the reference to the
shared object library in Section 4.10.4) supports both the
Groupchat protocol and the Conference protocol. If you come across a
shared object library called groupchat.so, this is the
original Conferencing component that was made available with Jabber
server Version 1.0. This library supports only the Groupchat protocol.

Querying the Conferencing component's version

SEND: <iq type='get' to='conference.gnu.mine.nu'> <query xmlns='jabber:iq:version'/> </iq>

RECV: <iq to='dj@gnu.mine.nu/jarl' from='conference.gnu.mine.nu' type='result'> <query xmlns='jabber:iq:version'> <name>conference</name> <version>0.4</version> <os>Linux 2.4.2-2</os> </query> </iq> In this recipe we'll be using the simpler Groupchat protocol. It's widely used and easy to understand. Example 9-2 shows a typical element log from Groupchat-based activity. It shows a user, with the JID qmacro@jabber.com, entering a room called "cellar," hosted on the conference component at conf.merlix.dyndns.org, a room that currently has two other occupants who go by the nicknames flash and roscoe. The elements are from qmacro's perspective, and are all explained following the example.


The Groupchat protocol in action The user qmacro tries to enter the conference room with the nickname flash and fails:


SEND: <presence to='cellar@conf.merlix.dyndns.org/flash'/>

RECV: <presence to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/flash' type='error'> <error code='409'>Conflict</error> </presence>

He tries again, this time with a different nickname, deejay, and is successful:


SEND: <presence to='cellar@conf.merlix.dyndns.org/deejay'/>

RECV: <presence to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/flash'/>

RECV: <presence to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/roscoe'/>

RECV: <presence to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/deejay'/>

RECV: <message to='qmacro@jabber.com/jarltk' type='groupchat' from='cellar@conf.merlix.dyndns.org'> <body>deejay has become available</body> </message>

roscoe says hi, and qmacro waves back:


RECV: <message to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/roscoe' type='groupchat' cnu=> <body>hi</body> </message>

SEND: <message to='cellar@conf.merlix.dyndns.org' type='groupchat'> <body>/me waves to everyone</body> </message>

flash sends a private message to qmacro:


RECV: <message to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/flash' type='chat'> <body>Is that you, qmacro?</body> <thread>jarl1998911094</thread> </message>

Feeling left out of the conversation, roscoe leaves the room:


RECV: <presence to='qmacro@jabber.com/jarltk' type='unavailable' from='cellar@conf.merlix.dyndns.org/roscoe'/>

RECV: <message to='qmacro@jabber.com/jarltk' type='groupchat' from='cellar@conf.merlix.dyndns.org'> <body>roscoe has left</body> </message> Let's take the stages in Example 9-2 one by one.


Failed attempt to enter room
qmacro makes an attempt to enter the room using the Groupchat
protocol. This is done by sending a directed
<presence/> element to a particular JID that represents
the room and the chosen nickname. This JID is constructed as follows:

[room name]@[conference component]/[nickname]

In this example, the conferencing component is identified with the
hostname conf.merlix.dyndns.org. qmacro's choice of
nickname is flash:

cellar@conf.merlix.dyndns.org/flash

Thus the following element is sent:

SEND: <presence to='cellar@conf.merlix.dyndns.org/flash'/>

The conference component determines that there is already someone
present in the room cellar@conf.merlix.dyndns.org with the
nickname flash, so qmacro is notified of this and
receives a directed presence with an <error/> tag:

RECV: <presence to='qmacro@jabber.com/jarltk' from='cellar@conf.merlix.dyndns.org/flash' type='error'> <error code='409'>Conflict</error> </presence>

Note that the <presence/> element has the type
error and comes from the artificial JID constructed in the
room entry attempt. The element is addressed to qmacro's real
JID, of course—qmacro@jabber.com/jarltk—as otherwise it
wouldn't reach him. : The error code 409 and text "Conflict" tells
qmacro that the nickname conflicted with one already in the
room. This is a standard error code/text pair; Table 5-3 shows a
complete set of code/text pairs. : At this stage, qmacro is
not yet in the room.
Successful attempt to enter room
qmacro tries again, this time with a different nickname,
deejay:[1]

SEND: <presence to='cellar@conf.merlix.dyndns.org/deejay'/>

This time, there is no conflictâÃÃÃ�
Personal tools