You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. <!ENTITY ROOMJID "&lt;room@service&gt;">
  6. <!ENTITY OCCUPANTJID "&lt;room@service/nick&gt;">
  7. ]>
  8. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  9. <xep>
  10. <header>
  11. <title>Multi-User Chat</title>
  12. <abstract>This specification defines an XMPP protocol extension for multi-user text chat, whereby multiple XMPP users can exchange messages in the context of a room or channel, similar to Internet Relay Chat (IRC). In addition to standard chatroom features such as room topics and invitations, the protocol defines a strong room control model, including the ability to kick and ban users, to name room moderators and administrators, to require membership or passwords in order to join the room, etc.</abstract>
  13. &LEGALNOTICE;
  14. <number>0045</number>
  15. <status>Draft</status>
  16. <type>Standards Track</type>
  17. <sig>Standards</sig>
  18. <dependencies>
  19. <spec>XMPP Core</spec>
  20. <spec>XMPP IM</spec>
  21. <spec>XEP-0004</spec>
  22. <spec>XEP-0030</spec>
  23. <spec>XEP-0068</spec>
  24. <spec>XEP-0082</spec>
  25. <spec>XEP-0128</spec>
  26. </dependencies>
  27. <supersedes/>
  28. <supersededby/>
  29. <shortname>muc</shortname>
  30. <schemaloc>
  31. <ns>muc</ns>
  32. <url>http://www.xmpp.org/schemas/muc.xsd</url>
  33. </schemaloc>
  34. <schemaloc>
  35. <ns>muc#admin</ns>
  36. <url>http://www.xmpp.org/schemas/muc-admin.xsd</url>
  37. </schemaloc>
  38. <schemaloc>
  39. <ns>muc#owner</ns>
  40. <url>http://www.xmpp.org/schemas/muc-owner.xsd</url>
  41. </schemaloc>
  42. <schemaloc>
  43. <ns>muc#user</ns>
  44. <url>http://www.xmpp.org/schemas/muc-user.xsd</url>
  45. </schemaloc>
  46. <registry/>
  47. &stpeter;
  48. <revision>
  49. <version>1.31.1</version>
  50. <date>2018-03-12</date>
  51. <initials>kis</initials>
  52. <remark>
  53. <p>Fix the wrong JID in an example.</p>
  54. </remark>
  55. </revision>
  56. <revision>
  57. <version>1.31</version>
  58. <date>2018-03-06</date>
  59. <initials>gl</initials>
  60. <remark>
  61. <p>Require the service to maintain the 'id' attribute on message reflections.</p>
  62. </remark>
  63. </revision>
  64. <revision>
  65. <version>1.30</version>
  66. <date>2018-02-23</date>
  67. <initials>jwi</initials>
  68. <remark>
  69. <p>Add 333 status code with OPTIONAL feature.</p>
  70. </remark>
  71. </revision>
  72. <revision>
  73. <version>1.29</version>
  74. <date>2017-09-01</date>
  75. <initials>gl</initials>
  76. <remark>
  77. <p>Clarify wording for a client re-syncing to a MUC</p>
  78. </remark>
  79. </revision>
  80. <revision>
  81. <version>1.28</version>
  82. <date>2017-05-31</date>
  83. <initials>gl</initials>
  84. <remark>
  85. <p>Introduce &lt;x/&gt; tag in MUC-PMs to support better Carbon delivery.</p>
  86. </remark>
  87. </revision>
  88. <revision>
  89. <version>1.27.1</version>
  90. <date>2016-12-03</date>
  91. <initials>XEP Editor: ssw</initials>
  92. <remark>
  93. <p>Editorial typo and whitespace fixes.</p>
  94. </remark>
  95. </revision>
  96. <revision>
  97. <version>1.27</version>
  98. <date>2016-10-29</date>
  99. <initials>XEP Editor: ssw</initials>
  100. <remark>
  101. <ul>
  102. <li>Clarify behavior on MUC join.</li>
  103. </ul>
  104. </remark>
  105. </revision>
  106. <revision>
  107. <version>1.26</version>
  108. <date>2016-05-16</date>
  109. <initials>XEP Editor (ssw)</initials>
  110. <remark>
  111. <ul>
  112. <li>Add status code to self-presence example.</li>
  113. <li>muc#roomconfig_allowpm should be list-single.</li>
  114. <li>muc#roomconfig_allowinvites should be boolean.</li>
  115. <li>Typo: Publish-Subscribe.</li>
  116. <li>15.6.2 Initial Submission: Status code 174 is missing.</li>
  117. <li>muc#role should be list-single</li>
  118. <li>muc#register_faqentry: mixed occurrences of text-single and text-multi</li>
  119. </ul>
  120. </remark>
  121. </revision>
  122. <revision>
  123. <version>1.25</version>
  124. <date>2012-02-08</date>
  125. <initials>psa</initials>
  126. <remark>
  127. <ul>
  128. <li>Clarified the fact that room roles and affiliations are shortcuts to bundles of privileges.</li>
  129. <li>Removed references to service discovery feature for "gc-1.0" since it is now obsolete.</li>
  130. <li>Added security consideration about information leaks related to service discovery.</li>
  131. <li>Corrected some examples of presence and message errors so that the 'from' and 'to' addresses are merely swapped, in accordance with RFC 6120; also added 'by' attribute to show that the room itself generated the error.</li>
  132. <li>Added 'nick' attribute to &lt;actor/&gt; element so that an action can be attributed either to a real JID or to a roomnick.</li>
  133. <li>Clarified the meaning of status code 100.</li>
  134. <li>Corrected delayed delivery text and examples so that the 'from' address is that of the room, and specified optional inclusion of the XEP-0033 'ofrom' address to note original sender.</li>
  135. <li>Added 'id' attributes to most examples, especially message and presence stanzas generated by the room since IDs can be used for tracking purposes and ghost detection.</li>
  136. <li>Added term "Occupant JID" to differentiate between the JID of a &lt;room@service&gt; and the JID of a &lt;room@service/nick&gt;.</li>
  137. <li>Added "muc#maxhistoryfetch" form field.</li>
  138. <li>Loosened handling of room joins when nicks are locked down, so that the service should modify the roomnick instead of returning an error.</li>
  139. <li>Specified that the room must return a room subject, even if the subject is empty.</li>
  140. <li>Removed feature for requesting a unique room name (the client can simply use a UUID).</li>
  141. <li>Removed any mention of fully-anonymous rooms, which are not supported by this specification.</li>
  142. <li>Clarified many small points in the text and examples.</li>
  143. </ul>
  144. </remark>
  145. </revision>
  146. <revision>
  147. <version>1.24</version>
  148. <date>2008-07-16</date>
  149. <initials>psa</initials>
  150. <remark><p>Added more examples of the reason element; removed mention of nick inclusion with regard to ban lists; added denial of service considerations.</p></remark>
  151. </revision>
  152. <revision>
  153. <version>1.23</version>
  154. <date>2008-01-14</date>
  155. <initials>psa</initials>
  156. <remark>
  157. <ul>
  158. <li>Defined getmemberlist room configuration option</li>
  159. <li>Added direct invitation protocol</li>
  160. <li>Corrected logic regarding admission of room owner/admin when room is full</li>
  161. <li>Defined service discovery extension field for associated LDAP group</li>
  162. <li>Specified that room config fields can be listed in extended room information</li>
  163. <li>Specified message format for affiliation change notifications if user is not in the room</li>
  164. <li>Added example showing use of Result Set Management</li>
  165. <li>Recommended inclusion of MUC child element in presence errors</li>
  166. <li>Described use of ThreadID for continuity between one-to-one chat and multi-user chat, including definition of thread attribute for continue element in invitations.</li>
  167. </ul>
  168. </remark>
  169. </revision>
  170. <revision>
  171. <version>1.22</version>
  172. <date>2007-04-10</date>
  173. <initials>psa</initials>
  174. <remark><p>Updated delayed delivery reference to reflect advancement of XEP-0203 to Draft and deprecation of XEP-0091.</p></remark>
  175. </revision>
  176. <revision>
  177. <version>1.21</version>
  178. <date>2006-09-13</date>
  179. <initials>psa</initials>
  180. <remark>
  181. <ul>
  182. <li>Clarified that inclusion of MUC extension in room join/create request triggers Data Forms flow but that absence of MUC extension leads to automatic room creation for backwards compatibility with older groupchat 1.0 protocol.</li>
  183. <li>Specified use of &lt;not-acceptable/&gt; error on nickname change if nicks are locked down.</li>
  184. <li>Required clients to discover room configuration prior to entering room and specified related security considerations, including use of privacy-related status codes 170, 171, 172, 173, and 174.</li>
  185. <li>Specified use of &lt;not-acceptable/&gt; error if room configuration options cannot be processed or violate service policies.</li>
  186. <li>Made explicit that roomnicks must not consist only of spaces.</li>
  187. <li>Moved all service discovery use cases into dedicated section.</li>
  188. <li>Changed urn:xmpp:delay support from SHOULD to MUST.</li>
  189. <li>Clarified that _whois room configuration option specifies room type.</li>
  190. <li>Defined XEP-0128 room information fields for discussion logs, associated pubsub node, and contact JID.</li>
  191. <li>Specified that changing role to moderator upon affiliation change to admin or owner is recommended, not required.</li>
  192. <li>Added internationalization consideration about localization of field labels for various data forms.</li>
  193. <li>Specified that implementations may persist roles across visits and should do so for moderated rooms.</li>
  194. <li>Added protocol and service discovery feature for requesting a unique room name prior to room creation.</li>
  195. <li>Further clarified nature of reserved room nicknames and nickname lockdown.</li>
  196. <li>Defined data forms for requesting voice and approving voice requests.</li>
  197. <li>Added multiple invitee example for XMPP URI.</li>
  198. <li>Clarified order of presence, discussion history, etc.</li>
  199. <li>Added status codes for occupant's own roomnick, service-modified roomnick, and warning that room discussion is publicly logged.</li>
  200. <li>Clarified privacy and anonymity considerations regarding room logging and non-anonymous rooms.</li>
  201. </ul>
  202. </remark>
  203. </revision>
  204. <revision>
  205. <version>1.20</version>
  206. <date>2005-09-08</date>
  207. <initials>psa</initials>
  208. <remark><p>Harmonized ability to kick and ban users, and clarified that a user cannot be kicked or banned by a moderator or admin with a lower affiliation.</p></remark>
  209. </revision>
  210. <revision>
  211. <version>1.19</version>
  212. <date>2005-04-21</date>
  213. <initials>psa</initials>
  214. <remark><p>Specified how to send multiple invitations simultaneously; corrected some errors regarding consistency of affiliation state changes; changed message events prohibition from MUST NOT to SHOULD NOT; corrected error handling related to the #traffic disco node; allowed &lt;password/&gt; as a child of &lt;destroy/&gt;; changed max users error from &notallowed; to &unavailable;; specified that the maxchars attribute counts characters in complete XML stanzas; added disco features for FORM_TYPEs; defined registry for status codes; split Create Instant Room into separate use case for protocol compliance purposes; adjusted XML schemas to reflect the foregoing changes; re-wrote the introduction; clarified small textual matters throughout.</p></remark>
  215. </revision>
  216. <revision>
  217. <version>1.18</version>
  218. <date>2004-11-02</date>
  219. <initials>psa</initials>
  220. <remark><p>Corrected several errors in the affiliation state chart and in the examples (wrong FORM_TYPE values); mentioned /me command.</p></remark>
  221. </revision>
  222. <revision>
  223. <version>1.17</version>
  224. <date>2004-10-04</date>
  225. <initials>psa</initials>
  226. <remark><p>Added text about allowable extension namespaces and related service discovery mechanisms; specified well-known service discovery nodes; added conformance terms to clarify some descriptions; modified affiliation state chart to allow more flexible state changes; per list dicussion, added ability to convert a one-to-one chat into a conference, including sending of history; specified error to use when max users limit is reached; specified form for admin approval of user registration requests and modified FORM_TYPE from http://jabber.org/protocol/muc#user to http://jabber.org/protocol/muc#register; modified FORM_TYPE for room configuration from http://jabber.org/protocol/muc#owner to http://jabber.org/protocol/muc#roomconfig.</p></remark>
  227. </revision>
  228. <revision>
  229. <version>1.16</version>
  230. <date>2004-06-30</date>
  231. <initials>psa</initials>
  232. <remark><p>Added example and registry submission for service discovery extension.</p></remark>
  233. </revision>
  234. <revision>
  235. <version>1.15</version>
  236. <date>2004-06-24</date>
  237. <initials>psa</initials>
  238. <remark><p>Removed jabber:iq:browse references; clarified order of presence stanzas sent to new occupant on entering room; specified format of in-room messages (type='groupchat', from='room@service'); clarified allowable attributes in various list-related operations; made admin/owner revocation text and examples consistent with state chart; clarified ownership revocation conflict scenarios; changed the 'muc#roomconfig_inviteonly' field to 'muc#roomconfig_membersonly'; changed attribute order in examples to match XML canonicalization rules; corrected several errors in the schemas.</p></remark>
  239. </revision>
  240. <revision>
  241. <version>1.14</version>
  242. <date>2004-05-03</date>
  243. <initials>psa</initials>
  244. <remark><p>Corrected discovery of registered roomnicks; added note about error to return if nicks are locked down.</p></remark>
  245. </revision>
  246. <revision>
  247. <version>1.13</version>
  248. <date>2004-03-31</date>
  249. <initials>psa</initials>
  250. <remark><p>Fixed an error in the muc#user schema.</p></remark>
  251. </revision>
  252. <revision>
  253. <version>1.12</version>
  254. <date>2004-03-01</date>
  255. <initials>psa</initials>
  256. <remark><p>Corrected a few errors in the examples; added IQ results in order to clarify workflows.</p></remark>
  257. </revision>
  258. <revision>
  259. <version>1.11</version>
  260. <date>2004-02-05</date>
  261. <initials>psa</initials>
  262. <remark><p>Clarified JID matching rules (same as for privacy lists in XMPP IM).</p></remark>
  263. </revision>
  264. <revision>
  265. <version>1.10</version>
  266. <date>2004-01-07</date>
  267. <initials>psa</initials>
  268. <remark><p>Added XMPP error handling; fully specified all conformance terms.</p></remark>
  269. </revision>
  270. <revision>
  271. <version>1.9</version>
  272. <date>2003-12-14</date>
  273. <initials>psa</initials>
  274. <remark><p>Removed protocol for requesting voice in a moderated room (should be performed using Ad-Hoc Commands).</p></remark>
  275. </revision>
  276. <revision>
  277. <version>1.8</version>
  278. <date>2003-12-04</date>
  279. <initials>psa</initials>
  280. <remark><p>Added protocol for requesting voice in a moderated room; added (informational) mapping of IRC commands to MUC protocols.</p></remark>
  281. </revision>
  282. <revision>
  283. <version>1.7</version>
  284. <date>2003-10-21</date>
  285. <initials>psa</initials>
  286. <remark><p>Added room configuration option for restricting presence broadcast to certain roles.</p></remark>
  287. </revision>
  288. <revision>
  289. <version>1.6</version>
  290. <date>2003-10-03</date>
  291. <initials>psa</initials>
  292. <remark><p>Added history management protocol on entering a room.</p></remark>
  293. </revision>
  294. <revision>
  295. <version>1.5</version>
  296. <date>2003-09-11</date>
  297. <initials>psa</initials>
  298. <remark><p>Specified that ban occurs by JID, not roomnick; allowed privileged users to send messages to the room even if not present in the room; added note that service should remove occupant if a delivery-related stanza error occurs; enabled user to disco the room in order to discover registered roomnick; specified that "banning" by domain or regex is a service-level configuration matter and therefore out of scope for MUC; specified that role should be decremented as appropriate if affiliation is lowered; added some clarifying text to room creation workflow; added implementation note about sending an out-of-band message if a user's affiliation changes while the user is not in the room; fixed stringprep references (room nicks use Resourceprep); clarified relationship between Room ID (i.e., node identifier of Room JID or Occupant JID, which may be opaque) and natural-language Room Name; specified Field Standardization profile per XEP-0068; defined XMPP Registrar submissions; added schema locations.</p></remark>
  299. </revision>
  300. <revision>
  301. <version>1.4</version>
  302. <date>2003-02-16</date>
  303. <initials>psa</initials>
  304. <remark><p>Added XML schemas.</p></remark>
  305. </revision>
  306. <revision>
  307. <version>1.3</version>
  308. <date>2003-02-11</date>
  309. <initials>psa</initials>
  310. <remark><p>Added reference to nodeprep Internet-Draft.</p></remark>
  311. </revision>
  312. <revision>
  313. <version>1.2</version>
  314. <date>2003-01-30</date>
  315. <initials>psa</initials>
  316. <remark><p>Commented out revision history prior to version 1.0 (too long); clarified business rules regarding when nicks, full JIDs, and bare JIDs are used in reference to roles and affiliations; consistently specified that extended presence information in the muc#user namespace must include the full JID as the value of the 'jid' attribute in all cases; cleaned up text and examples throughout; added open issue regarding syntax of room nicknames.</p></remark>
  317. </revision>
  318. <revision>
  319. <version>1.1</version>
  320. <date>2002-12-16</date>
  321. <initials>psa</initials>
  322. <remark><p>Added protocol for declining an invitation; replaced &lt;created/&gt; element with status code 201; modified the destroy room protocol so that &lt;destroy/&gt; is a child of &lt;query/&gt;; clarified usage of 'nick' attribute when adding members; prohibited use of message events.</p></remark>
  323. </revision>
  324. <revision>
  325. <version>1.0</version>
  326. <date>2002-11-21</date>
  327. <initials>psa</initials>
  328. <remark><p>Per a vote of the Jabber Council, revision 0.23 was advanced to Draft on 2002-11-21. (For earlier revision history, refer to XML source.)</p></remark>
  329. </revision>
  330. <revision>
  331. <version>0.23</version>
  332. <date>2002-11-06</date>
  333. <initials>psa</initials>
  334. <remark><p>Added examples for disco#items queries sent to a room; prohibited 'type' attribute on invite messages sent from client to room; added dependencies on browse and disco; changed 'room user' to 'occupant'; fixed many small errors throughout.</p></remark>
  335. </revision>
  336. <revision>
  337. <version>0.22</version>
  338. <date>2002-11-04</date>
  339. <initials>psa</initials>
  340. <remark><p>Added example for disco#items; added support for cancellation of room configuration using type='cancel' from XEP-0004; noted 403 error for invites sent by non-admins in members-only room.</p></remark>
  341. </revision>
  342. <revision>
  343. <version>0.21</version>
  344. <date>2002-11-01</date>
  345. <initials>psa</initials>
  346. <remark><p>Clarified several small ambiguities; made &lt;body/&gt; optional on invites sent from the service to the invitee; added error scenarios for changing nickname and for destroying the room; specified that the service must return the full member list for a members-only room (not only the members in the room); updated the disco examples to track protocol changes.</p></remark>
  347. </revision>
  348. <revision>
  349. <version>0.20</version>
  350. <date>2002-10-29</date>
  351. <initials>psa</initials>
  352. <remark><p>Specified that messages sent to change the room subject must be of type "groupchat"; updated the legal notice to conform to the XSF IPR policy.</p></remark>
  353. </revision>
  354. <revision>
  355. <version>0.19</version>
  356. <date>2002-10-28</date>
  357. <initials>psa</initials>
  358. <remark><p>Added ability to create an instant room within MUC (not by using gc-1.0 protocol); cleaned up disco examples.</p></remark>
  359. </revision>
  360. <revision>
  361. <version>0.18</version>
  362. <date>2002-10-27</date>
  363. <initials>psa</initials>
  364. <remark><p>Added experimental support for disco; added sections for security, IANA, and JANA considerations; corrected typographical errors; cleaned up some DocBook formatting.</p></remark>
  365. </revision>
  366. <revision>
  367. <version>0.17</version>
  368. <date>2002-10-23</date>
  369. <initials>psa</initials>
  370. <remark><p>Added the optional &lt;actor/&gt; element (with 'jid' attribute) to &lt;item/&gt; elements inside presence stanzas of type "unavailable" that are sent to users who are kicked or banned, as well as within IQs for tracking purposes; reverted all list editing use cases (ban, voice, member, moderator, admin, owner) to use of MUC format rather than 'jabber:x:data' namespace; added several guidelines regarding generation and handling of XML stanzas; cleaned up the change room subject use case; changed several ambiguous uses of 'would', 'can', and 'will' to 'should', 'may', or 'must'; fixed several small errors in the text, examples, and DTDs.</p></remark>
  371. </revision>
  372. <revision>
  373. <version>0.16</version>
  374. <date>2002-10-20</date>
  375. <initials>psa</initials>
  376. <remark><p>Added the &lt;item/&gt; element to presence stanzas of type "unavailable" in order to improve the tracking of user states in the room; consolidated &lt;invitee/&gt; and &lt;inviter/&gt; elements into an &lt;invite/&gt; element with 'from' and 'to' attributes; made &lt;reason/&gt; element always a child of &lt;item/&gt; or &lt;invite/&gt; in the muc#user namespace; moved the alternate room location in room destruction to a 'jid' attribute of the &lt;alt/&gt; element; further specified several error messages; disallowed simultaneous modifications of both affiliations and roles by a moderator or admin; added several more rules regarding handling of XML stanzas; added use cases for granting and revoking admin status; adjusted DTD to track all changes.</p></remark>
  377. </revision>
  378. <revision>
  379. <version>0.15</version>
  380. <date>2002-10-18</date>
  381. <initials>psa</initials>
  382. <remark><p>Fully incorporated the change to affiliations + roles; moved a number of admin use cases to a new section for moderator use cases; added participant use case for requesting membership; added admin use cases for adding members, removing members, granting and revoking moderator status, and modifying the moderator list; organized the sections in a more logical manner.</p></remark>
  383. </revision>
  384. <revision>
  385. <version>0.14</version>
  386. <date>2002-10-17</date>
  387. <initials>psa</initials>
  388. <remark><p>Significantly modified the privileges model by distinguishing between in-room "roles" and long-lived "affiliations"; specified the privileges of the various roles and affiliations; included state transition charts for both roles and affiliations; removed use of MUC protocol for editing ban, voice, and admin lists (but not for the actions of banning users and granting/revoking voice); added delivery rule regarding IQ stanzas; changed kick so that the action is based on changing the role to "none".</p></remark>
  389. </revision>
  390. <revision>
  391. <version>0.13</version>
  392. <date>2002-10-16</date>
  393. <initials>psa</initials>
  394. <remark><p>Corrected the change nickname examples (newnick sent on unavailable, no nick sent on available).</p></remark>
  395. </revision>
  396. <revision>
  397. <version>0.12</version>
  398. <date>2002-10-16</date>
  399. <initials>psa</initials>
  400. <remark><p>Removed SHA1 passwords; specified that room shall add passwords on invitations to password-protected rooms (not supplied by inviter).</p></remark>
  401. </revision>
  402. <revision>
  403. <version>0.11</version>
  404. <date>2002-10-16</date>
  405. <initials>psa</initials>
  406. <remark><p>Changed 'participant' to 'room user' and 'discussant' to 'participant'; clarified presence rule about client generation of extended presence information; added role of 'none'.</p></remark>
  407. </revision>
  408. <revision>
  409. <version>0.10</version>
  410. <date>2002-10-15</date>
  411. <initials>psa</initials>
  412. <remark><p>Fixed extended presence on entering or creating a room (plain '...muc' with no fragment); harmonized #user with #admin regarding the use of the &lt;item/&gt; element and associated attributes (jid, nick, etc.), and added 'role' attribute; modified management of voice, ban, admin, and member lists to use &lt;query/&gt; wrapper and new &lt;item/&gt; structure; changed the 'member' role to 'discussant', added 'outcast' role for banned users, and added new 'member' role to enable management of member lists; changed invitation-only rooms to members-only rooms and made appropriate adjustments to apply member lists to both members-only rooms and open rooms; modified nickname change protocol slightly to send the old nickname in the unavailable presence and the new nickname in the available presence; removed prohibition on members-only rooms that are password-protected; removed the &lt;query/&gt; wrapper for the &lt;destroy/&gt; element; updated the DTDs.</p></remark>
  413. </revision>
  414. <revision>
  415. <version>0.9</version>
  416. <date>2002-10-13</date>
  417. <initials>psa</initials>
  418. <remark><p>Added extended presence ('...#user') on entering a room for MUC clients; changed namespace on room creation request to '...#owner'; added a service discovery example using jabber:iq:browse; added information about discussion history; made small fixes to several examples; further defined the presence rules; transferred all implementation notes to a dedicated section; added a Terminology section.</p></remark>
  419. </revision>
  420. <revision>
  421. <version>0.8</version>
  422. <date>2002-10-10</date>
  423. <initials>psa</initials>
  424. <remark><p>Made further changes to the room creation workflow (finally correct); removed feature discovery use case (this needs to be addressed by a real service discovery protocol!); added ability for room owners to edit the admin list; removed &lt;body/&gt; from invitations generated by the service; removed messages sent to kicked and banned users (handled by unavailable presence with status code); added a number of implementation notes; converted all examples to Shakespeare style.</p></remark>
  425. </revision>
  426. <revision>
  427. <version>0.7.6</version>
  428. <date>2002-10-09</date>
  429. <initials>psa</initials>
  430. <remark><p>Fixed the room creation workflow; changed some terminology ("join" to "enter" and "leave" to "exit").</p></remark>
  431. </revision>
  432. <revision>
  433. <version>0.7.5</version>
  434. <date>2002-10-08</date>
  435. <initials>psa</initials>
  436. <remark><p>Specified and improved the handling of invitation-only rooms. In particular, added the ability for room admins to edit the invitation list and added a configuration option that limits the ability to send invitations to room admins only.</p></remark>
  437. </revision>
  438. <revision>
  439. <version>0.7.4</version>
  440. <date>2002-10-07</date>
  441. <initials>psa</initials>
  442. <remark><p>Changed namespaces from http://jabber.org/protocol/muc/owner etc. to http://jabber.org/protocol/muc#owner etc. per Jabber Council discussion.</p></remark>
  443. </revision>
  444. <revision>
  445. <version>0.7.3</version>
  446. <date>2002-10-07</date>
  447. <initials>psa</initials>
  448. <remark><p>Changed namespaces to HTTP URIs; left role handling up to the implementation; further clarified presence rules.</p></remark>
  449. </revision>
  450. <revision>
  451. <version>0.7.2</version>
  452. <date>2002-10-06</date>
  453. <initials>psa</initials>
  454. <remark><p>Disallowed kicking, banning, and revoking voice with respect to room admins and room owners; replaced &lt;x/&gt; with &lt;query/&gt; in the Discovering Room Features and Destroying a Room use cases; corrected some small errors and made many clarifications throughout.</p></remark>
  455. </revision>
  456. <revision>
  457. <version>0.7.1</version>
  458. <date>2002-10-04</date>
  459. <initials>psa</initials>
  460. <remark><p>Removed &lt;whois/&gt; command (unnecessary since participants with appropriate privileges receive the full JID of all participants in presence stanzas); completed many small fixes throughout.</p></remark>
  461. </revision>
  462. <revision>
  463. <version>0.7</version>
  464. <date>2002-10-03</date>
  465. <initials>psa</initials>
  466. <remark><p>More clearly delineated participant roles and defined the hierarchy thereof (owner, admin, member, visitor); replaced &lt;voice/&gt; element in extended presence with &lt;item role='member'/&gt;; changed initial room configuration to use IQ rather than message; adjusted presence rules (especially regarding extended presence information); cleaned up examples throughout; updated DTD to track changes.</p></remark>
  467. </revision>
  468. <revision>
  469. <version>0.6</version>
  470. <date>2002-09-21</date>
  471. <initials>psa</initials>
  472. <remark><p>More clearly defined the scope; removed fully anonymous rooms; changed meaning of semi-anonymous rooms and of non-anonymous rooms; added mechanism for notification of full JIDs in non-anonymous rooms; replaced the &lt;admin/&gt; element in extended presence with a &lt;role/&gt; element (more extensible); changed room passwords to cleartext; added status codes for various messages received from the service; added lists of valid error and status codes associated with the 'http://jabber.org/protocol/muc#user' namespace; added a &lt;reason/&gt; element for invitations; made kick and ban reasons child elements rather than attributes; replaced stopgap feature discovery mechanism with jabber:iq:negotiate; added extended presence element to room creation request and clarified the room creation process; specified presence reflection rules; added method for destroying a room; adjusted DTDs to track all changes.</p></remark>
  473. </revision>
  474. <revision>
  475. <version>0.5.1</version>
  476. <date>2002-09-20</date>
  477. <initials>psa</initials>
  478. <remark><p>Added DTDs; changed feature discovery to use &lt;x/&gt; element rather than query and made service response come in IQ result; fixed reference to JID spec; changed 'grant' to 'add' and 'revoke' to 'remove' for consistency in the item attributes; made several other small changes.</p></remark>
  479. </revision>
  480. <revision>
  481. <version>0.5</version>
  482. <date>2002-09-19</date>
  483. <initials>psa</initials>
  484. <remark><p>Changed the kick, ban, and voice protocols; added a few more configuration options; specified the restrictions for roomnicks; and added a stopgap service discovery protocol.</p></remark>
  485. </revision>
  486. <revision>
  487. <version>0.4</version>
  488. <date>2002-09-18</date>
  489. <initials>psa</initials>
  490. <remark><p>Changed all non-groupchat-1.0 use cases to jabber:gc:* namespaces or jabber:x:data; added use cases for ban list management and room moderation; added protocol for sending notice of admin and voice privileges in presence; cleaned up text and many examples.</p></remark>
  491. </revision>
  492. <revision>
  493. <version>0.3</version>
  494. <date>2002-09-17</date>
  495. <initials>psa</initials>
  496. <remark><p>Changed admin use cases; cleaned up participant and owner use cases.</p></remark>
  497. </revision>
  498. <revision>
  499. <version>0.2</version>
  500. <date>2002-09-12</date>
  501. <initials>psa</initials>
  502. <remark><p>Broke content out into three actors (participant, owner, and admin) and added more detail to owner and admin use cases.</p></remark>
  503. </revision>
  504. <revision>
  505. <version>0.1</version>
  506. <date>2002-09-09</date>
  507. <initials>psa</initials>
  508. <remark><p>Initial version.</p></remark>
  509. </revision>
  510. </header>
  511. <section1 topic='Introduction' anchor='intro'>
  512. <p>Traditionally, instant messaging is thought to consist of one-to-one chat rather than many-to-many chat, which is called variously "groupchat" or "text conferencing". Groupchat functionality is familiar from systems such as Internet Relay Chat (IRC) and the chatroom functionality offered by popular consumer IM services. The Jabber/XMPP community developed and implemented a basic groupchat protocol as long ago as 1999. That "groupchat 1.0" (GC) protocol provided a minimal feature set for chat rooms but was rather limited in scope. This specification (Multi-User Chat or MUC) builds on the older groupchat 1.0 protocol in a backwards-compatible manner but provides advanced features such as invitations, room moderation and administration, and specialized room types.</p>
  513. </section1>
  514. <section1 topic='Scope' anchor='scope'>
  515. <p>This document addresses common requirements related to configuration of, participation in, and administration of individual text-based conference rooms. All of the requirements addressed herein apply at the level of the individual room and are "common" in the sense that they have been widely discussed within the Jabber/XMPP community or are familiar from existing text-based conference environments (e.g., Internet Relay Chat as defined in &rfc1459; and its successors: &rfc2810;, &rfc2811;, &rfc2812;, &rfc2813;).</p>
  516. <p>This document explicitly does <em>not</em> address the following:</p>
  517. <ul>
  518. <li>Relationships between rooms (e.g., hierarchies of rooms)</li>
  519. <li>Management of multi-user chat services (e.g., managing permissions across an entire service or registering a global room nickname); such use cases are specified in &xep0133;</li>
  520. <li>Moderation of individual messages</li>
  521. <li>Encryption of messages sent through a room</li>
  522. <li>Advanced features such as attaching files to a room, integrating whiteboards, and using MUC rooms as a way to manage the signalling for multi-user audio or video conferencing (see &xep0272;)</li>
  523. <li>Interaction between MUC deployments and foreign chat systems (e.g., gateways to IRC or to legacy IM systems)</li>
  524. <li>Mirroring or replication of rooms among multiple MUC deployments</li>
  525. </ul>
  526. <p>This limited scope is not meant to disparage such topics, which are of inherent interest; however, it is meant to focus the discussion in this document and to present a comprehensible protocol that can be implemented by client and service developers alike. Future specifications might address the topics mentioned above.</p>
  527. </section1>
  528. <section1 topic='Requirements' anchor='reqs'>
  529. <p>This document addresses the minimal functionality provided by Jabber-based multi-user chat services that existed in 2002 when development of MUC began. For the sake of backwards-compatibility, this document uses the original groupchat 1.0 protocol for this baseline functionality, with the result that:</p>
  530. <ul>
  531. <li>Each room is identified as a "room JID" &ROOMJID; (e.g., &lt;jdev@conference.jabber.org&gt;), where "room" is the name of the room and "service" is the hostname at which the multi-user chat service is running.</li>
  532. <li>Each occupant in a room is identified as an "occupant JID" &OCCUPANTJID;, where "nick" is the room nickname of the occupant as specified on entering the room or subsequently changed during the occupant's visit.</li>
  533. <li>A user enters a room (i.e., becomes an occupant) by sending directed presence to &OCCUPANTJID;.</li>
  534. <li>An occupant can change his or her room nickname and availability status within the room by sending presence information to &lt;room@service/newnick&gt;.</li>
  535. <li>Messages sent within multi-user chat rooms are of a special type "groupchat" and are addressed to the room itself (room@service), then reflected to all occupants.</li>
  536. <li>An occupant exits a room by sending presence of type "unavailable" to its current &OCCUPANTJID;.</li>
  537. </ul>
  538. <p>The additional features and functionality addressed in MUC include the following:</p>
  539. <ol start='1'>
  540. <li>native conversation logging (no in-room bot required)</li>
  541. <li>enabling users to request membership in a room</li>
  542. <li>enabling occupants to view an occupant's full JID in a non-anonymous room</li>
  543. <li>enabling moderators to view an occupant's full JID in a semi-anonymous room</li>
  544. <li>allowing only moderators to change the room subject</li>
  545. <li>enabling moderators to kick participants and visitors from the room</li>
  546. <li>enabling moderators to grant and revoke voice (i.e., the privilege to speak) in a moderated room, and to manage the voice list</li>
  547. <li>enabling admins to grant and revoke moderator status, and to manage the moderator list</li>
  548. <li>enabling admins to ban users from the room, and to manage the ban list</li>
  549. <li>enabling admins to grant and revoke membership privileges, and to manage the member list for a members-only room</li>
  550. <li>enabling owners to configure various room parameters (e.g., limiting the number of occupants)</li>
  551. <li>enabling owners to specify other owners</li>
  552. <li>enabling owners to grant and revoke admin status, and to manage the admin list</li>
  553. <li>enabling owners to destroy the room</li>
  554. </ol>
  555. <p>In addition, this document provides protocol elements for supporting the following room types:</p>
  556. <ol start='1'>
  557. <li>public vs. hidden</li>
  558. <li>persistent vs. temporary</li>
  559. <li>password-protected vs. unsecured</li>
  560. <li>members-only vs. open</li>
  561. <li>moderated vs. unmoderated</li>
  562. <li>non-anonymous vs. semi-anonymous</li>
  563. </ol>
  564. <p>The extensions needed to implement these requirements are qualified by the 'http://jabber.org/protocol/muc' namespace (and the #owner, #admin, and #user fragments on the main namespace URI).</p>
  565. </section1>
  566. <section1 topic='Terminology' anchor='terms'>
  567. <section2 topic='General Terms' anchor='terms-general'>
  568. <dl>
  569. <di><dt>Affiliation</dt><dd>A long-lived association or connection with a room; the possible affiliations are "owner", "admin", "member", and "outcast" (naturally it is also possible to have no affiliation); affiliation is distinct from role. An affiliation lasts across a user's visits to a room.</dd></di>
  570. <di><dt>Ban</dt><dd>To remove a user from a room such that the user is not allowed to re-enter the room (until and unless the ban has been removed). A banned user has an affiliation of "outcast".</dd></di>
  571. <di><dt>Bare JID</dt><dd>The &lt;user@host&gt; by which a user is identified outside the context of any existing session or resource; contrast with Full JID and Occupant JID.</dd></di>
  572. <di><dt>Full JID</dt><dd>The &lt;user@host/resource&gt; by which an online user is identified outside the context of a room; contrast with Bare JID and Occupant JID.</dd></di>
  573. <di><dt>GC</dt><dd>The minimal "groupchat 1.0" protocol developed within the Jabber community in 1999; MUC is backwards-compatible with GC.</dd></di>
  574. <di><dt>History</dt><dd>A limited number of message stanzas sent to a new occupant to provide the context of current discussion.</dd></di>
  575. <di><dt>Invitation</dt><dd>A special message sent from one user to another asking the recipient to join a room; the invitation can be sent directly (see &xep0249;) or mediated through the room (as described under <link url='#invite'>Inviting Another User to a Room</link>).</dd></di>
  576. <di><dt>IRC</dt><dd>Internet Relay Chat.</dd></di>
  577. <di><dt>Kick</dt><dd>To temporarily remove a participant or visitor from a room; the user is allowed to re-enter the room at any time. A kicked user has a role of "none".</dd></di>
  578. <di><dt>Logging</dt><dd>Storage of discussions that occur within a room for public retrieval outside the context of the room.</dd></di>
  579. <di><dt>Member</dt><dd>A user who is on the "whitelist" for a members-only room or who is registered with an open room. A member has an affiliation of "member".</dd></di>
  580. <di><dt>Moderator</dt><dd>A room role that is usually associated with room admins but that can be granted to non-admins; is allowed to kick users, grant and revoke voice, etc. A moderator has a role of "moderator".</dd></di>
  581. <di><dt>MUC</dt><dd>The multi-user chat protocol for text-based conferencing specified in this document.</dd></di>
  582. <di><dt>Multi-Session Nick</dt><dd>If allowed by the service, a user can associate more than one full JID with the same occupant JID (e.g., the user juliet@capulet.lit is allowed to log in simultaneously as the nick "JuliC" in the characters@chat.shakespeare.lit chatroom from both juliet@capulet.lit/balcony and juliet@capulet.lit/chamber). Multi-session nicks are not currently defined in this document.</dd></di>
  583. <di><dt>Occupant</dt><dd>Any user who is in a room (this is an "abstract class" and does not correspond to any specific role).</dd></di>
  584. <di><dt>Occupant JID</dt><dd>The &lt;room@service/nick&gt; by which an occupant is identified within the context of a room; contrast with Bare JID and Full JID.</dd></di>
  585. <di><dt>Outcast</dt><dd>A user who has been banned from a room. An outcast has an affiliation of "outcast".</dd></di>
  586. <di><dt>Participant</dt><dd>An occupant who does not have admin status; in a moderated room, a participant is further defined as having voice (in contrast to a visitor). A participant has a role of "participant".</dd></di>
  587. <di><dt>Private Message</dt><dd>A message sent from one occupant directly to another's occupant JID (not to the room itself for broadcasting to all occupants).</dd></di>
  588. <di><dt>Role</dt><dd>A temporary position or privilege level within a room, distinct from a user's long-lived affiliation with the room; the possible roles are "moderator", "participant", and "visitor" (it is also possible to have no defined role). A role lasts only for the duration of an occupant's visit to a room.</dd></di>
  589. <di><dt>Room</dt><dd>A virtual space that users figuratively enter in order to participate in real-time, text-based conferencing with other users.</dd></di>
  590. <di><dt>Room Administrator</dt><dd>A user empowered by the room owner to perform administrative functions such as banning users; however, a room administrator is not allowed to change the room configuration or to destroy the room. An admin has an affiliation of "admin".</dd></di>
  591. <di><dt>Room ID</dt><dd>The localpart of a Room JID, which might be opaque and thus lack meaning for human users (see under <link url='#bizrules'>Business Rules</link> for syntax); contrast with Room Name.</dd></di>
  592. <di><dt>Room JID</dt><dd>The &lt;room@service&gt; address of a room.</dd></di>
  593. <di><dt>Room Name</dt><dd>A user-friendly, natural-language name for a room, configured by the room owner and presented in Service Discovery queries; contrast with Room ID.</dd></di>
  594. <di><dt>Room Nickname</dt><dd>The resourcepart of an Occupant JID (see <link url='#bizrules'>Business Rules</link> for syntax); this is the "friendly name" by which an occupant is known in the room.</dd></di>
  595. <di><dt>Room Owner</dt><dd>The user who created the room or a user who has been designated by the room creator or owner as someone with owner status (if allowed); an owner is allowed to change the room configuration and destroy the room, in addition to all admin status. An owner has an affiliation of "owner".</dd></di>
  596. <di><dt>Room Roster</dt><dd>A client's representation of the occupants in a room.</dd></di>
  597. <di><dt>Server</dt><dd>An XMPP server that may or may not have associated with it a text-based conferencing service.</dd></di>
  598. <di><dt>Service</dt><dd>A host that offers text-based conferencing capabilities; often but not necessarily a sub-domain of an XMPP server (e.g., conference.jabber.org).</dd></di>
  599. <di><dt>Subject</dt><dd>A temporary discussion topic within a room.</dd></di>
  600. <di><dt>Visit</dt><dd>A user's "session" in a room, beginning when the user enters the room (i.e., becomes an occupant) and ending when the user exits the room.</dd></di>
  601. <di><dt>Visitor</dt><dd>In a moderated room, an occupant who does not have voice (in contrast to a participant). A visitor has a role of "visitor".</dd></di>
  602. <di><dt>Voice</dt><dd>In a moderated room, the privilege to send messages to all occupants.</dd></di>
  603. </dl>
  604. </section2>
  605. <section2 topic='Room Types' anchor='terms-rooms'>
  606. <dl>
  607. <di><dt>Hidden Room</dt><dd>A room that cannot be found by any user through normal means such as searching and service discovery; antonym: Public Room.</dd></di>
  608. <di><dt>Members-Only Room</dt><dd>A room that a user cannot enter without being on the member list; antonym: Open Room.</dd></di>
  609. <di><dt>Moderated Room</dt><dd>A room in which only those with "voice" are allowed to send messages to all occupants; antonym: Unmoderated Room.</dd></di>
  610. <di><dt>Non-Anonymous Room</dt><dd>A room in which an occupant's full JID is exposed to all other occupants, although the occupant can request any desired room nickname; contrast with Semi-Anonymous Room.</dd></di>
  611. <di><dt>Open Room</dt><dd>A room that non-banned entities are allowed to enter without being on the member list; antonym: Members-Only Room.</dd></di>
  612. <di><dt>Password-Protected Room</dt><dd>A room that a user cannot enter without first providing the correct password; antonym: Unsecured Room.</dd></di>
  613. <di><dt>Persistent Room</dt><dd>A room that is not destroyed if the last occupant exits; antonym: Temporary Room.</dd></di>
  614. <di><dt>Public Room</dt><dd>A room that can be found by any user through normal means such as searching and service discovery; antonym: Hidden Room.</dd></di>
  615. <di><dt>Semi-Anonymous Room</dt><dd>A room in which an occupant's full JID can be discovered by room admins only; contrast with Non-Anonymous Room.</dd></di>
  616. <di><dt>Temporary Room</dt><dd>A room that is destroyed if the last occupant exits; antonym: Persistent Room.</dd></di>
  617. <di><dt>Unmoderated Room</dt><dd>A room in which any occupant is allowed to send messages to all occupants; antonym: Moderated Room.</dd></di>
  618. <di><dt>Unsecured Room</dt><dd>A room that anyone is allowed to enter without first providing the correct password; antonym: Password-Protected Room.</dd></di>
  619. </dl>
  620. </section2>
  621. <section2 topic='Dramatis Personae' anchor='terms-personae'>
  622. <p>Most of the examples in this document use the scenario of the witches' meeting held in a dark cave at the beginning of Act IV, Scene I of Shakespeare's <cite>Macbeth</cite>, represented here as the "coven@chat.shakespeare.lit" chatroom. The characters are as follows:</p>
  623. <table caption='Dramatis Personae'>
  624. <tr>
  625. <th>Room Nickname</th>
  626. <th>Full JID</th>
  627. <th>Affiliation</th>
  628. </tr>
  629. <tr>
  630. <td>firstwitch</td>
  631. <td>crone1@shakespeare.lit/desktop</td>
  632. <td>Owner</td>
  633. </tr>
  634. <tr>
  635. <td>secondwitch</td>
  636. <td>wiccarocks@shakespeare.lit/laptop</td>
  637. <td>Admin</td>
  638. </tr>
  639. <tr>
  640. <td>thirdwitch</td>
  641. <td>hag66@shakespeare.lit/pda</td>
  642. <td>None</td>
  643. </tr>
  644. </table>
  645. </section2>
  646. </section1>
  647. <section1 topic='Roles, Affiliations, and Privileges' anchor='associations'>
  648. <p>A user might be allowed to perform any number of actions in a room, from joining or sending a message to changing configuration options or destroying the room altogether. We call each permitted action a "privilege". There are two ways we might structure privileges:</p>
  649. <ol>
  650. <li><p>Define each privilege atomically and explicitly define each user's particular privileges; this is flexible but can be confusing to manage.</p></li>
  651. <li><p>Define bundles of privileges that are generally applicable and assign a user-friendly "shortcut" to each bundle (e.g., "moderator" or "admin").</p></li>
  652. </ol>
  653. <p>MUC takes the second approach.</p>
  654. <p>MUC also defines two different associations: long-lived affiliations and session-specific roles. These two association types are distinct from each other in MUC, since an affiliation lasts across visits, while a role lasts only for the duration of a visit. In addition, there is no one-to-one correspondence between roles and affiliations; for example, someone who is not affiliated with a room may be a (temporary) moderator, and a member may be a participant or a visitor in a moderated room. These concepts are explained more fully below.</p>
  655. <section2 topic='Roles' anchor='roles'>
  656. <p>The following roles are defined:</p>
  657. <table caption='Roles'>
  658. <tr>
  659. <th>Name</th>
  660. <th>Support</th>
  661. </tr>
  662. <tr>
  663. <td>Moderator</td>
  664. <td>REQUIRED</td>
  665. </tr>
  666. <tr>
  667. <td>None</td>
  668. <td>N/A (the absence of a role)</td>
  669. </tr>
  670. <tr>
  671. <td>Participant</td>
  672. <td>REQUIRED</td>
  673. </tr>
  674. <tr>
  675. <td>Visitor</td>
  676. <td>RECOMMENDED</td>
  677. </tr>
  678. </table>
  679. <p>Roles are temporary in that they do not necessarily persist across a user's visits to the room and MAY change during the course of an occupant's visit to the room. An implementation MAY persist roles across visits and SHOULD do so for moderated rooms (since the distinction between visitor and participant is critical to the functioning of a moderated room).</p>
  680. <p>There is no one-to-one mapping between roles and affiliations (e.g., a member could be a participant or a visitor).</p>
  681. <p>A moderator is the most powerful role within the context of the room, and can to some extent manage other occupants' roles in the room. A participant has fewer privileges than a moderator, although he or she always has the right to speak. A visitor is a more restricted role within the context of a moderated room, since visitors are not allowed to send messages to all occupants (depending on room configuration, it is even possible that visitors' presence will not be broadcasted to the room).</p>
  682. <p>Roles are granted, revoked, and maintained based on the occupant's room nickname or full JID rather than bare JID. The privileges associated with these roles, as well as the actions that trigger changes in roles, are defined below.</p>
  683. <p>Information about roles MUST be sent in all presence stanzas generated or reflected by the room and thus sent to occupants (if the room is configured to broadcast presence for a given role).</p>
  684. <section3 topic='Privileges' anchor='roles-priv'>
  685. <p>For the most part, roles exist in a hierarchy. For instance, a participant can do anything a visitor can do, and a moderator can do anything a participant can do. Each role has all the privileges possessed by the next-lowest role, plus additional privileges; these privileges are specified in the following table as defaults (an implementation MAY provide configuration options that override these defaults).</p>
  686. <table caption='Privileges Associated With Roles'>
  687. <tr>
  688. <th>Privilege</th>
  689. <th>None</th>
  690. <th>Visitor</th>
  691. <th>Participant</th>
  692. <th>Moderator</th>
  693. </tr>
  694. <tr>
  695. <td>Present in Room</td>
  696. <td>No</td>
  697. <td>Yes</td>
  698. <td>Yes</td>
  699. <td>Yes</td>
  700. </tr>
  701. <tr>
  702. <td>Receive Messages</td>
  703. <td>No</td>
  704. <td>Yes</td>
  705. <td>Yes</td>
  706. <td>Yes</td>
  707. </tr>
  708. <tr>
  709. <td>Receive Occupant Presence</td>
  710. <td>No</td>
  711. <td>Yes</td>
  712. <td>Yes</td>
  713. <td>Yes</td>
  714. </tr>
  715. <tr>
  716. <td>Broadcast Presence to All Occupants</td>
  717. <td>No</td>
  718. <td>Yes*</td>
  719. <td>Yes</td>
  720. <td>Yes</td>
  721. </tr>
  722. <tr>
  723. <td>Change Availability Status</td>
  724. <td>No</td>
  725. <td>Yes*</td>
  726. <td>Yes</td>
  727. <td>Yes</td>
  728. </tr>
  729. <tr>
  730. <td>Change Room Nickname</td>
  731. <td>No</td>
  732. <td>Yes*</td>
  733. <td>Yes</td>
  734. <td>Yes</td>
  735. </tr>
  736. <tr>
  737. <td>Send Private Messages</td>
  738. <td>No</td>
  739. <td>Yes*</td>
  740. <td>Yes</td>
  741. <td>Yes</td>
  742. </tr>
  743. <tr>
  744. <td>Invite Other Users</td>
  745. <td>No</td>
  746. <td>Yes*</td>
  747. <td>Yes*</td>
  748. <td>Yes</td>
  749. </tr>
  750. <tr>
  751. <td>Send Messages to All</td>
  752. <td>No</td>
  753. <td>No**</td>
  754. <td>Yes</td>
  755. <td>Yes</td>
  756. </tr>
  757. <tr>
  758. <td>Modify Subject</td>
  759. <td>No</td>
  760. <td>No*</td>
  761. <td>Yes*</td>
  762. <td>Yes</td>
  763. </tr>
  764. <tr>
  765. <td>Kick Participants and Visitors</td>
  766. <td>No</td>
  767. <td>No</td>
  768. <td>No</td>
  769. <td>Yes</td>
  770. </tr>
  771. <tr>
  772. <td>Grant Voice</td>
  773. <td>No</td>
  774. <td>No</td>
  775. <td>No</td>
  776. <td>Yes</td>
  777. </tr>
  778. <tr>
  779. <td>Revoke Voice</td>
  780. <td>No</td>
  781. <td>No</td>
  782. <td>No</td>
  783. <td>Yes***</td>
  784. </tr>
  785. </table>
  786. <p>* Default; configuration settings MAY modify this privilege.</p>
  787. <p>** An implementation MAY grant voice by default to visitors in unmoderated rooms.</p>
  788. <p>*** A moderator MUST NOT be able to revoke voice privileges from an admin or owner.</p>
  789. </section3>
  790. <section3 topic='Default Roles' anchor='roles-default'>
  791. <p>The following table summarizes the initial default roles that a service SHOULD set based on the user's affiliation (there is no role associated with the "outcast" affiliation, since such users are not allowed to enter the room).</p>
  792. <table caption='Initial Role Based on Affiliation'>
  793. <tr>
  794. <th>Room Type</th>
  795. <th>None</th>
  796. <th>Member</th>
  797. <th>Admin</th>
  798. <th>Owner</th>
  799. </tr>
  800. <tr>
  801. <td>Moderated</td>
  802. <td>Visitor</td>
  803. <td>Participant</td>
  804. <td>Moderator</td>
  805. <td>Moderator</td>
  806. </tr>
  807. <tr>
  808. <td>Unmoderated</td>
  809. <td>Participant</td>
  810. <td>Participant</td>
  811. <td>Moderator</td>
  812. <td>Moderator</td>
  813. </tr>
  814. <tr>
  815. <td>Members-Only</td>
  816. <td>N/A *</td>
  817. <td>Participant</td>
  818. <td>Moderator</td>
  819. <td>Moderator</td>
  820. </tr>
  821. <tr>
  822. <td>Open</td>
  823. <td>Participant</td>
  824. <td>Participant</td>
  825. <td>Moderator</td>
  826. <td>Moderator</td>
  827. </tr>
  828. </table>
  829. <p>* Entry is not permitted.</p>
  830. </section3>
  831. <section3 topic='Changing Roles' anchor='roles-change'>
  832. <p>The ways in which an occupant's role changes are well-defined. Sometimes the change results from the occupant's own action (e.g., entering or exiting the room), whereas sometimes the change results from an action taken by a moderator, admin, or owner. If an occupant's role changes, a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants (if the room is configured to broadcast presence from entities with a given role). Role changes and their triggering actions are specified in the following table.</p>
  833. <table caption='Role State Chart'>
  834. <tr>
  835. <th>&gt;</th>
  836. <th>None</th>
  837. <th>Visitor</th>
  838. <th>Participant</th>
  839. <th>Moderator</th>
  840. </tr>
  841. <tr>
  842. <td>None</td>
  843. <td>--</td>
  844. <td>Enter moderated room</td>
  845. <td>Enter unmoderated room</td>
  846. <td>Admin or owner enters room</td>
  847. </tr>
  848. <tr>
  849. <td>Visitor</td>
  850. <td>Exit room or be kicked by a moderator</td>
  851. <td>--</td>
  852. <td>Moderator grants voice</td>
  853. <td>Admin or owner grants moderator status</td>
  854. </tr>
  855. <tr>
  856. <td>Participant</td>
  857. <td>Exit room or be kicked by a moderator</td>
  858. <td>Moderator revokes voice</td>
  859. <td>--</td>
  860. <td>Admin or owner grants moderator status</td>
  861. </tr>
  862. <tr>
  863. <td>Moderator</td>
  864. <td>Exit room or be kicked by an admin or owner *</td>
  865. <td>Admin or owner changes role to visitor *</td>
  866. <td>Admin or owner changes role to participant or revokes moderator status *</td>
  867. <td>--</td>
  868. </tr>
  869. </table>
  870. <p>* A moderator SHOULD NOT be allowed to revoke moderation privileges from someone with a higher affiliation than themselves (i.e., an unaffiliated moderator SHOULD NOT be allowed to revoke moderation privileges from an admin or an owner, and an admin SHOULD NOT be allowed to revoke moderation privileges from an owner).</p>
  871. <p class='box'>Note: Certain roles are typically implicit in certain affiliations. For example, an admin or owner is automatically a moderator, so if an occupant is granted an affiliation of admin then the occupant will by that fact be granted a role of moderator; similarly, when an occupant is granted an affiliation of member in a moderated room, the occupant automatically has a role of participant. However, the loss of the admin affiliation does not necessarily mean that the occupant no longer has a role of moderator (since a "mere" occupant can be a moderator). Therefore, the role that is gained when an occupant is granted a certain affiliation is stable, whereas the role that is lost when an occupant loses a certain affilitation is not hardcoded and is left up to the implementation.</p>
  872. </section3>
  873. </section2>
  874. <section2 topic='Affiliations' anchor='affil'>
  875. <p>The following affiliations are defined:</p>
  876. <ol start='1'>
  877. <li>Owner</li>
  878. <li>Admin</li>
  879. <li>Member</li>
  880. <li>Outcast</li>
  881. <li>None (the absence of an affiliation)</li>
  882. </ol>
  883. <p>Support for the owner affiliation is REQUIRED. Support for the admin, member, and outcast affiliations is RECOMMENDED. (The "None" affiliation is the absence of an affiliation.)</p>
  884. <p>These affiliations are long-lived in that they persist across a user's visits to the room and are not affected by happenings in the room. In addition, there is no one-to-one mapping between these affiliations and an occupant's role within the room. Affiliations are granted, revoked, and maintained based on the user's bare JID, not the nick as with roles.</p>
  885. <p>If a user without a defined affiliation enters a room, the user's affiliation is defined as "none"; however, this affiliation does not persist across visits (i.e., a service does not maintain a "none list" across visits).</p>
  886. <p>The member affiliation provides a way for a room owner or admin to specify a "whitelist" of users who are allowed to enter a members-only room. When a member enters a members-only room, his or her affiliation does not change, no matter what his or her role is. The member affiliation also provides a way for users to register with an open room and thus be lastingly associated with that room in some way (one result might be that the service could reserve the user's nickname in the room).</p>
  887. <p>An outcast is a user who has been banned from a room and who is not allowed to enter the room.</p>
  888. <p>Information about affiliations MUST be sent in all presence stanzas generated or reflected by the room and sent to occupants (if the room is configured to broadcast presence from entities with a given role).</p>
  889. <section3 topic='Privileges' anchor='affil-priv'>
  890. <p>For the most part, affiliations exist in a hierarchy. For instance, an owner can do anything an admin can do, and an admin can do anything a member can do. Each affiliation has all the privileges possessed by the next-lowest affiliation, plus additional privileges; these privileges are specified in the following table.</p>
  891. <table caption='Privileges Associated With Affiliations'>
  892. <tr>
  893. <th>Privilege</th>
  894. <th>Outcast</th>
  895. <th>None</th>
  896. <th>Member</th>
  897. <th>Admin</th>
  898. <th>Owner</th>
  899. </tr>
  900. <tr>
  901. <td>Enter Open Room</td>
  902. <td>No</td>
  903. <td>Yes*</td>
  904. <td>Yes</td>
  905. <td>Yes</td>
  906. <td>Yes</td>
  907. </tr>
  908. <tr>
  909. <td>Register with Open Room</td>
  910. <td>No</td>
  911. <td>Yes</td>
  912. <td>N/A</td>
  913. <td>N/A</td>
  914. <td>N/A</td>
  915. </tr>
  916. <tr>
  917. <td>Retrieve Member List</td>
  918. <td>No</td>
  919. <td>No</td>
  920. <td>Yes</td>
  921. <td>Yes</td>
  922. <td>Yes</td>
  923. </tr>
  924. <tr>
  925. <td>Enter Members-Only Room</td>
  926. <td>No</td>
  927. <td>No</td>
  928. <td>Yes*</td>
  929. <td>Yes</td>
  930. <td>Yes</td>
  931. </tr>
  932. <tr>
  933. <td>Ban Members and Unaffiliated Users</td>
  934. <td>No</td>
  935. <td>No</td>
  936. <td>No</td>
  937. <td>Yes</td>
  938. <td>Yes</td>
  939. </tr>
  940. <tr>
  941. <td>Edit Member List</td>
  942. <td>No</td>
  943. <td>No</td>
  944. <td>No</td>
  945. <td>Yes</td>
  946. <td>Yes</td>
  947. </tr>
  948. <tr>
  949. <td>Assign and Remove Moderator Role</td>
  950. <td>No</td>
  951. <td>No</td>
  952. <td>No</td>
  953. <td>Yes**</td>
  954. <td>Yes**</td>
  955. </tr>
  956. <tr>
  957. <td>Edit Admin List</td>
  958. <td>No</td>
  959. <td>No</td>
  960. <td>No</td>
  961. <td>No</td>
  962. <td>Yes</td>
  963. </tr>
  964. <tr>
  965. <td>Edit Owner List</td>
  966. <td>No</td>
  967. <td>No</td>
  968. <td>No</td>
  969. <td>No</td>
  970. <td>Yes</td>
  971. </tr>
  972. <tr>
  973. <td>Change Room Configuration</td>
  974. <td>No</td>
  975. <td>No</td>
  976. <td>No</td>
  977. <td>No</td>
  978. <td>Yes</td>
  979. </tr>
  980. <tr>
  981. <td>Destroy Room</td>
  982. <td>No</td>
  983. <td>No</td>
  984. <td>No</td>
  985. <td>No</td>
  986. <td>Yes</td>
  987. </tr>
  988. </table>
  989. <p>* As a default, an unaffiliated user enters a moderated room as a visitor, and enters an open room as a participant. A member enters a room as a participant. An admin or owner enters a room as a moderator.</p>
  990. <p>** As noted, a moderator SHOULD NOT be allowed to revoke moderation privileges from someone with a higher affiliation than themselves (i.e., an unaffiliated moderator SHOULD NOT be allowed to revoke moderation privileges from an admin or an owner, and an admin SHOULD NOT be allowed to revoke moderation privileges from an owner).</p>
  991. </section3>
  992. <section3 topic='Changing Affiliations' anchor='affil-change'>
  993. <p>The ways in which a user's affiliation changes are well-defined. Sometimes the change results from the user's own action (e.g., registering as a member of the room), whereas sometimes the change results from an action taken by an admin or owner. If a user's affiliation changes, a MUC service implementation MUST change the user's affiliation to reflect the change and communicate that to all occupants (if the room is configured to broadcast presence from entities with a given role). Affiliation changes and their triggering actions are specified in the following table.</p>
  994. <table caption='Affiliation State Chart'>
  995. <tr>
  996. <th>&gt;</th>
  997. <th>Outcast</th>
  998. <th>None</th>
  999. <th>Member</th>
  1000. <th>Admin</th>
  1001. <th>Owner</th>
  1002. </tr>
  1003. <tr>
  1004. <td>Outcast</td>
  1005. <td>--</td>
  1006. <td>Admin or owner removes ban</td>
  1007. <td>Admin or owner adds user to member list</td>
  1008. <td>Owner adds user to admin list</td>
  1009. <td>Owner adds user to owner list</td>
  1010. </tr>
  1011. <tr>
  1012. <td>None</td>
  1013. <td>Admin or owner applies ban</td>
  1014. <td>--</td>
  1015. <td>Admin or owner adds user to member list, or user registers as member (if allowed)</td>
  1016. <td>Owner adds user to admin list</td>
  1017. <td>Owner adds user to owner list</td>
  1018. </tr>
  1019. <tr>
  1020. <td>Member</td>
  1021. <td>Admin or owner applies ban</td>
  1022. <td>Admin or owner changes affiliation to "none"</td>
  1023. <td>--</td>
  1024. <td>Owner adds user to admin list</td>
  1025. <td>Owner adds user to owner list</td>
  1026. </tr>
  1027. <tr>
  1028. <td>Admin</td>
  1029. <td>Owner applies ban</td>
  1030. <td>Owner changes affiliation to "none"</td>
  1031. <td>Owner changes affiliation to "member"</td>
  1032. <td>--</td>
  1033. <td>Owner adds user to owner list</td>
  1034. </tr>
  1035. <tr>
  1036. <td>Owner</td>
  1037. <td>Owner applies ban</td>
  1038. <td>Owner changes affiliation to "none"</td>
  1039. <td>Owner changes affiliation to "member"</td>
  1040. <td>Owner changes affiliation to "admin"</td>
  1041. <td>--</td>
  1042. </tr>
  1043. </table>
  1044. </section3>
  1045. </section2>
  1046. </section1>
  1047. <section1 topic='Entity Use Cases' anchor='entity'>
  1048. <p>A MUC implementation MUST support &xep0030; ("disco"). Any entity can complete the following disco-related use cases.</p>
  1049. <section2 topic='Discovering a MUC Service' anchor='disco-service'>
  1050. <p>An entity often discovers a MUC service by sending a Service Discovery items ("disco#items") request to its own server.</p>
  1051. <example caption='Entity Queries Server for Associated Services'><![CDATA[
  1052. <iq from='hag66@shakespeare.lit/pda'
  1053. id='h7ns81g'
  1054. to='shakespeare.lit'
  1055. type='get'>
  1056. <query xmlns='http://jabber.org/protocol/disco#items'/>
  1057. </iq>
  1058. ]]></example>
  1059. <p>The server then returns the services that are associated with it.</p>
  1060. <example caption='Server Returns Disco Items Result'><![CDATA[
  1061. <iq from='shakespeare.lit'
  1062. id='h7ns81g'
  1063. to='hag66@shakespeare.lit/pda'
  1064. type='result'>
  1065. <query xmlns='http://jabber.org/protocol/disco#items'>
  1066. <item jid='chat.shakespeare.lit'
  1067. name='Chatroom Service'/>
  1068. </query>
  1069. </iq>
  1070. ]]></example>
  1071. </section2>
  1072. <section2 topic='Discovering the Features Supported by a MUC Service' anchor='disco-service-features'>
  1073. <p>An entity may wish to discover if a service implements the Multi-User Chat protocol; in order to do so, it sends a service discovery information ("disco#info") query to the MUC service's JID.</p>
  1074. <example caption='Entity Queries Chat Service for MUC Support via Disco'><![CDATA[
  1075. <iq from='hag66@shakespeare.lit/pda'
  1076. id='lx09df27'
  1077. to='chat.shakespeare.lit'
  1078. type='get'>
  1079. <query xmlns='http://jabber.org/protocol/disco#info'/>
  1080. </iq>
  1081. ]]></example>
  1082. <p>The service MUST return its identity and the features it supports.</p>
  1083. <example caption='Service Returns Disco Info Result'><![CDATA[
  1084. <iq from='chat.shakespeare.lit'
  1085. id='lx09df27'
  1086. to='hag66@shakespeare.lit/pda'
  1087. type='result'>
  1088. <query xmlns='http://jabber.org/protocol/disco#info'>
  1089. <identity
  1090. category='conference'
  1091. name='Shakespearean Chat Service'
  1092. type='text'/>
  1093. <feature var='http://jabber.org/protocol/muc'/>
  1094. </query>
  1095. </iq>
  1096. ]]></example>
  1097. </section2>
  1098. <section2 topic='Discovering Rooms' anchor='disco-rooms'>
  1099. <p>The service discovery items ("disco#items") protocol enables an entity to query a service for a list of associated items, which in the case of a chat service would consist of the specific chat rooms hosted by the service.</p>
  1100. <example caption='Entity Queries Chat Service for Rooms'><![CDATA[
  1101. <iq from='hag66@shakespeare.lit/pda'
  1102. id='zb8q41f4'
  1103. to='chat.shakespeare.lit'
  1104. type='get'>
  1105. <query xmlns='http://jabber.org/protocol/disco#items'/>
  1106. </iq>
  1107. ]]></example>
  1108. <p>The service SHOULD return a full list of the public rooms it hosts (i.e., not return any rooms that are hidden).</p>
  1109. <example caption='Service Returns Disco Items Result'><![CDATA[
  1110. <iq from='chat.shakespeare.lit'
  1111. id='zb8q41f4'
  1112. to='hag66@shakespeare.lit/pda'
  1113. type='result'>
  1114. <query xmlns='http://jabber.org/protocol/disco#items'>
  1115. <item jid='heath@chat.shakespeare.lit'
  1116. name='A Lonely Heath'/>
  1117. <item jid='coven@chat.shakespeare.lit'
  1118. name='A Dark Cave'/>
  1119. <item jid='forres@chat.shakespeare.lit'
  1120. name='The Palace'/>
  1121. <item jid='inverness@chat.shakespeare.lit'
  1122. name='Macbeth&apos;s Castle'/>
  1123. </query>
  1124. </iq>
  1125. ]]></example>
  1126. <p>If the full list of rooms is large (see <cite>XEP-0030</cite> for details), the service MAY return only a partial list of rooms. If it does so, it SHOULD include a &lt;set/&gt; element qualified by the 'http://jabber.org/protocol/rsm' namespace (as defined in &xep0059;) to indicate that the list is not the full result set.</p>
  1127. <example caption='Service Returns Limited List of Disco Items Result'><![CDATA[
  1128. <iq from='chat.shakespeare.lit'
  1129. id='hx51v49s'
  1130. to='hag66@shakespeare.lit/pda'
  1131. type='result'>
  1132. <query xmlns='http://jabber.org/protocol/disco#items'>
  1133. <item jid='alls-well-that-ends-well@chat.shakespeare.lit'/>
  1134. <item jid='as-you-like-it@chat.shakespeare.lit'/>
  1135. <item jid='cleopatra@chat.shakespeare.lit'/>
  1136. <item jid='comedy-of-errors@chat.shakespeare.lit'/>
  1137. <item jid='coriolanus@chat.shakespeare.lit'/>
  1138. <item jid='cymbeline@chat.shakespeare.lit'/>
  1139. <item jid='hamlet@chat.shakespeare.lit'/>
  1140. <item jid='henry-the-fourth-one@chat.shakespeare.lit'/>
  1141. <item jid='henry-the-fourth-two@chat.shakespeare.lit'/>
  1142. <item jid='henry-the-fifth@chat.shakespeare.lit'/>
  1143. <set xmlns='http://jabber.org/protocol/rsm'>
  1144. <first index='0'>alls-well-that-ends-well@chat.shakespeare.lit</first>
  1145. <last>henry-the-fifth@chat.shakespeare.lit</last>
  1146. <count>37</count>
  1147. </set>
  1148. </query>
  1149. </iq>
  1150. ]]></example>
  1151. </section2>
  1152. <section2 topic='Querying for Room Information' anchor='disco-roominfo'>
  1153. <p>Using the disco#info protocol, an entity may also query a specific chat room for more detailed information about the room. An entity SHOULD do so before entering a room in order to determine the privacy and security profile of the room configuration (see the <link url='#security'>Security Considerations</link> for details).</p>
  1154. <example caption='Entity Queries for Information about a Specific Chat Room'><![CDATA[
  1155. <iq from='hag66@shakespeare.lit/pda'
  1156. id='ik3vs715'
  1157. to='coven@chat.shakespeare.lit'
  1158. type='get'>
  1159. <query xmlns='http://jabber.org/protocol/disco#info'/>
  1160. </iq>
  1161. ]]></example>
  1162. <p>The room MUST return its identity and SHOULD return the features it supports:</p>
  1163. <example caption='Room Returns Disco Info Result'><![CDATA[
  1164. <iq from='coven@chat.shakespeare.lit'
  1165. id='ik3vs715'
  1166. to='hag66@shakespeare.lit/pda'
  1167. type='result'>
  1168. <query xmlns='http://jabber.org/protocol/disco#info'>
  1169. <identity
  1170. category='conference'
  1171. name='A Dark Cave'
  1172. type='text'/>
  1173. <feature var='http://jabber.org/protocol/muc'/>
  1174. <feature var='http://jabber.org/protocol/muc#stable_id'/>
  1175. <feature var='muc_passwordprotected'/>
  1176. <feature var='muc_hidden'/>
  1177. <feature var='muc_temporary'/>
  1178. <feature var='muc_open'/>
  1179. <feature var='muc_unmoderated'/>
  1180. <feature var='muc_nonanonymous'/>
  1181. </query>
  1182. </iq>
  1183. ]]></example>
  1184. <p>Note: The room SHOULD return the materially-relevant features it supports, such as password protection and room moderation (these are listed fully in the feature registry maintained by the XMPP Registrar; see also the <link url='#registrar'>XMPP Registrar</link> section of this document).</p>
  1185. <p>A chatroom MAY return more detailed information in its disco#info response using &xep0128;, identified by inclusion of a hidden FORM_TYPE field whose value is "http://jabber.org/protocol/muc#roominfo". Such information might include a more verbose description of the room, the current room subject, and the current number of occupants in the room:</p>
  1186. <example caption='Room Returns Extended Disco Info Result'><![CDATA[
  1187. <iq from='coven@chat.shakespeare.lit'
  1188. id='ik3vs715'
  1189. to='hag66@shakespeare.lit/pda'
  1190. type='result'>
  1191. <query xmlns='http://jabber.org/protocol/disco#info'>
  1192. <identity
  1193. category='conference'
  1194. name='A Dark Cave'
  1195. type='text'/>
  1196. <feature var='http://jabber.org/protocol/muc'/>
  1197. <feature var='muc_passwordprotected'/>
  1198. <feature var='muc_hidden'/>
  1199. <feature var='muc_temporary'/>
  1200. <feature var='muc_open'/>
  1201. <feature var='muc_unmoderated'/>
  1202. <feature var='muc_nonanonymous'/>
  1203. <x xmlns='jabber:x:data' type='result'>
  1204. <field var='FORM_TYPE' type='hidden'>
  1205. <value>http://jabber.org/protocol/muc#roominfo</value>
  1206. </field>
  1207. <field var='muc#roominfo_description'
  1208. label='Description'>
  1209. <value>The place for all good witches!</value>
  1210. </field>
  1211. <field var='muc#roominfo_changesubject'
  1212. label='Occupants May Change the Subject'>
  1213. <value>true</value>
  1214. </field>
  1215. <field var='muc#roominfo_contactjid'
  1216. label='Contact Addresses'>
  1217. <value>crone1@shakespeare.lit</value>
  1218. </field>
  1219. <field var='muc#roominfo_subject'
  1220. label='Current Discussion Topic'>
  1221. <value>Spells</value>
  1222. </field>
  1223. <field var='muc#roomconfig_changesubject'
  1224. label='Subject can be modified'>
  1225. <value>true</value>
  1226. </field>
  1227. <field var='muc#roominfo_occupants'
  1228. label='Number of occupants'>
  1229. <value>3</value>
  1230. </field>
  1231. <field var='muc#roominfo_ldapgroup'
  1232. label='Associated LDAP Group'>
  1233. <value>cn=witches,dc=shakespeare,dc=lit</value>
  1234. </field>
  1235. <field var='muc#roominfo_lang'
  1236. label='Language of discussion'>
  1237. <value>en</value>
  1238. </field>
  1239. <field var='muc#roominfo_logs'
  1240. label='URL for discussion logs'>
  1241. <value>http://www.shakespeare.lit/chatlogs/coven/</value>
  1242. </field>
  1243. <field var='muc#maxhistoryfetch'
  1244. label='Maximum Number of History Messages Returned by Room'>
  1245. <value>50</value>
  1246. </field>
  1247. <field var='muc#roominfo_pubsub'
  1248. label='Associated pubsub node'>
  1249. <value>xmpp:pubsub.shakespeare.lit?;node=the-coven-node</value>
  1250. </field>
  1251. </x>
  1252. </query>
  1253. </iq>
  1254. ]]></example>
  1255. <p>Some extended room information is dynamically generated (e.g., the URL for discussion logs, which may be based on service-wide configuration), whereas other information is based on the more-stable room configuration, which is why any field defined for the <link url='#registrar-formtype-owner'>muc#roomconfig FORM_TYPE</link> can be included in the extended service discovery fields (as shown above for the "muc#roomconfig_changesubject" field).</p>
  1256. <p>Note: The foregoing extended service discovery fields for the 'http://jabber.org/protocol/muc#roominfo' FORM_TYPE are examples only and might be supplemented in the future via the mechanisms described in the <link url="#registrar-formtype">Field Standardization</link> section of this document.</p>
  1257. </section2>
  1258. <section2 topic='Querying for Room Items' anchor='disco-roomitems'>
  1259. <p>An entity MAY also query a specific chat room for its associated items:</p>
  1260. <example caption='Entity Queries for Items Associated with a Specific Chat Room'><![CDATA[
  1261. <iq from='hag66@shakespeare.lit/pda'
  1262. id='kl2fax27'
  1263. to='coven@chat.shakespeare.lit'
  1264. type='get'>
  1265. <query xmlns='http://jabber.org/protocol/disco#items'/>
  1266. </iq>
  1267. ]]></example>
  1268. <p>An implementation MAY return a list of existing occupants if that information is publicly available, or return no list at all if this information is kept private. Implementations and deployments are advised to turn off such information sharing by default.</p>
  1269. <example caption='Room Returns Disco Items Result (Items are Public)'><![CDATA[
  1270. <iq from='coven@chat.shakespeare.lit'
  1271. id='kl2fax27'
  1272. to='hag66@shakespeare.lit/pda'
  1273. type='result'>
  1274. <query xmlns='http://jabber.org/protocol/disco#items'>
  1275. <item jid='coven@chat.shakespeare.lit/firstwitch'/>
  1276. <item jid='coven@chat.shakespeare.lit/secondwitch'/>
  1277. </query>
  1278. </iq>
  1279. ]]></example>
  1280. <p>Note: These &lt;item/&gt; elements are qualified by the disco#items namespace, not the muc namespace; this means that they cannot possess 'affiliation' or 'role' attributes, for example.</p>
  1281. <p>If the list of occupants is private, the room MUST return an empty &QUERY; element, in accordance with <cite>XEP-0030</cite>.</p>
  1282. <example caption='Room Returns Empty Disco Items Result (Items are Private)'><![CDATA[
  1283. <iq from='coven@chat.shakespeare.lit'
  1284. id='kl2fax27'
  1285. to='hag66@shakespeare.lit/pda'
  1286. type='result'>
  1287. <query xmlns='http://jabber.org/protocol/disco#items'/>
  1288. </iq>
  1289. ]]></example>
  1290. </section2>
  1291. <section2 topic='Querying a Room Occupant' anchor='disco-occupant'>
  1292. <p>If a non-occupant attempts to send a disco request to an address of the form &OCCUPANTJID;, a MUC service MUST return a &badrequest; error. If an occupant sends such a request, the service MAY pass it through the intended recipient; see the <link url='#impl'>Implementation Guidelines</link> section of this document for details.</p>
  1293. </section2>
  1294. <section2 topic='Discovering Client Support for MUC' anchor='disco-client'>
  1295. <p>An entity might want to discover if one of the entity's contacts supports the Multi-User Chat protocol (e.g., before attempting to invite the contact to a room). This can be done using Service Discovery.</p>
  1296. <example caption='Entity Queries Contact Regarding MUC Support'><![CDATA[
  1297. <iq from='hag66@shakespeare.lit/pda'
  1298. id='yh2fs843'
  1299. to='wiccarocks@shakespeare.lit/laptop'
  1300. type='get'>
  1301. <query xmlns='http://jabber.org/protocol/disco#info'/>
  1302. </iq>
  1303. ]]></example>
  1304. <p>The client SHOULD return its identity and the features it supports.</p>
  1305. <example caption='Contact Returns Disco Info Result'><![CDATA[
  1306. <iq from='wiccarocks@shakespeare.lit/laptop'
  1307. id='yh2fs843'
  1308. to='hag66@shakespeare.lit/pda'
  1309. type='result'>
  1310. <query xmlns='http://jabber.org/protocol/disco#info'>
  1311. <identity
  1312. category='client'
  1313. type='pc'/>
  1314. ...
  1315. <feature var='http://jabber.org/protocol/muc'/>
  1316. ...
  1317. </query>
  1318. </iq>
  1319. ]]></example>
  1320. <p>An entity may also query a contact regarding which rooms the contact is in. This is done by querying the contact's full JID (&lt;user@host/resource&gt;) while specifying the well-known Service Discovery node 'http://jabber.org/protocol/muc#rooms'.</p>
  1321. <example caption='Entity Queries Contact for Current Rooms'><![CDATA[
  1322. <iq from='hag66@shakespeare.lit/pda'
  1323. id='gp7w61v3'
  1324. to='wiccarocks@shakespeare.lit/laptop'
  1325. type='get'>
  1326. <query xmlns='http://jabber.org/protocol/disco#items'
  1327. node='http://jabber.org/protocol/muc#rooms'/>
  1328. </iq>
  1329. ]]></example>
  1330. <example caption='Contact Returns Room Query Result'><![CDATA[
  1331. <iq from='wiccarocks@shakespeare.lit/laptop'
  1332. id='gp7w61v3'
  1333. to='hag66@shakespeare.lit/pda'
  1334. type='result'>
  1335. <query xmlns='http://jabber.org/protocol/disco#items'
  1336. node='http://jabber.org/protocol/muc#rooms'>
  1337. <item jid='coven@chat.shakespeare.lit'/>
  1338. <item jid='characters@conference.shakespeare.lit'/>
  1339. </query>
  1340. </iq>
  1341. ]]></example>
  1342. <p>Optionally, the contact MAY include its roomnick as the value of the 'name' attribute:</p>
  1343. <code><![CDATA[
  1344. ...
  1345. <item jid='coven@chat.shakespeare.lit'
  1346. name='secondwitch'/>
  1347. ...
  1348. ]]></code>
  1349. <p>If this information is private, the user MUST return an empty &QUERY; element, in accordance with <cite>XEP-0030</cite>.</p>
  1350. </section2>
  1351. </section1>
  1352. <section1 topic='Occupant Use Cases' anchor='user'>
  1353. <p>The main actor in a multi-user chat environment is the occupant, who can be said to be located "in" a multi-user chat room and to participate in the discussions held in that room (for the purposes of this specification, participants and visitors are considered to be "mere" occupants, since they possess no admin status). As will become clear, the protocol elements proposed in this document to fulfill the occupant use cases fall into three categories:</p>
  1354. <ol start='1'>
  1355. <li><p>the basic functionality for joining a room, exchanging messages with all occupants, etc. (supported by the groupchat 1.0 protocol that preceded MUC)</p></li>
  1356. <li><p>straightforward additions to the basic functionality, such as handling of errors related to new room types</p></li>
  1357. <li><p>additional protocol elements to handle functionality not covered by groupchat 1.0 (room invites, room passwords, extended presence related to room roles and affiliations); these are qualified by the 'http://jabber.org/protocol/muc#user' namespace</p></li>
  1358. </ol>
  1359. <p>Note: All client-generated examples herein are presented from the perspective of the service, with the result that all stanzas received by a service contain a 'from' attribute corresponding to the sender's full JID as added by a normal XMPP router or session manager. In addition, normal IQ result stanzas sent upon successful completion of a request (as required by &xmppcore;) are not shown.</p>
  1360. <section2 topic='Order of Events' anchor='order'>
  1361. <p>The order of events involved in joining a room needs to be consistent so that clients can know which events to expect when. After a client sends presence to join a room, the MUC service MUST send it events in the following order:</p>
  1362. <ol>
  1363. <li>In-room presence from other occupants</li>
  1364. <li>In-room presence from the joining entity itself (so-called "self-presence")</li>
  1365. <li>Room history (if any)</li>
  1366. <li>The room subject</li>
  1367. <li>Live messages, presence updates, new user joins, etc.</li>
  1368. </ol>
  1369. </section2>
  1370. <section2 topic='Entering a Room' anchor='enter'>
  1371. <section3 topic='Groupchat 1.0 Protocol' anchor='enter-gc'>
  1372. <p>In order to participate in the discussions held in a multi-user chat room, a user MUST first become an occupant by entering the room. In the old groupchat 1.0 protocol, this was done by sending presence with no 'type' attribute to &OCCUPANTJID;, where "room" is the room ID, "service" is the hostname of the chat service, and "nick" is the user's desired nickname within the room:</p>
  1373. <example caption='User Seeks to Enter a Room (groupchat 1.0)'><![CDATA[
  1374. <presence
  1375. from='hag66@shakespeare.lit/pda'
  1376. id='ng91xs69'
  1377. to='coven@chat.shakespeare.lit/thirdwitch'/>
  1378. ]]></example>
  1379. <p>In this example, a user with a full JID of "hag66@shakespeare.lit/pda" has requested to enter the room "coven" on the "chat.shakespeare.lit" chat service with a room nickname of "thirdwitch".</p>
  1380. <p>If the user does not specify a room nickname (note the bare JID on the 'from' address in the following example), the service MUST return a &badjid; error:</p>
  1381. <example caption='No Nickname Specified'><![CDATA[
  1382. <presence
  1383. from='coven@chat.shakespeare.lit'
  1384. id='273hs51g'
  1385. to='hag66@shakespeare.lit/pda'
  1386. type='error'>
  1387. <error by='coven@chat.shakespeare.lit' type='modify'>
  1388. <jid-malformed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1389. </error>
  1390. </presence>
  1391. ]]></example>
  1392. <p>Note: The presence stanza used to join a room MUST NOT possess a 'type' attribute, i.e., it must be available presence. For further discussion, see the <link url='#bizrules-presence'>Presence</link> business rules.</p>
  1393. </section3>
  1394. <section3 topic='Basic MUC Protocol' anchor='enter-muc'>
  1395. <p>Compliant multi-user chat services MUST accept the foregoing as a request to enter a room from any client that knows either the groupchat 1.0 protocol or the multi-user chat (MUC) protocol; however, MUC clients SHOULD signal their ability to speak the MUC protocol by including in the initial presence stanza an empty &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc' namespace (note the absence of the '#user' fragment):</p>
  1396. <example caption='User Seeks to Enter a Room (Multi-User Chat)'><![CDATA[
  1397. <presence
  1398. from='hag66@shakespeare.lit/pda'
  1399. id='n13mt3l'
  1400. to='coven@chat.shakespeare.lit/thirdwitch'>
  1401. <x xmlns='http://jabber.org/protocol/muc'/>
  1402. </presence>
  1403. ]]></example>
  1404. <p>Before attempting to enter the room, a MUC-compliant client SHOULD first discover its reserved room nickname (if any) by following the protocol defined in the <link url='#reservednick'>Discovering Reserved Room Nickname</link> section of this document.</p>
  1405. <p>When a MUC service receives an &lt;x/&gt; tagged join stanza from an already-joined client (as identified by the client's full JID), the service should assume that the client lost its synchronization, and therefore it SHOULD send exactly the same stanzas to the client as if it actually just joined the MUC. The server MAY also send a presence update to the other participants according to the received join presence.</p>
  1406. </section3>
  1407. <section3 topic='Presence Broadcast' anchor='enter-pres'>
  1408. <p>If the service is able to add the user to the room, it MUST send presence from all the existing participants' occupant JIDs to the new occupant's full JID, including extended presence information about roles in a single &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'role' attribute set to a value of "moderator", "participant", or "visitor", and with the 'affiliation' attribute set to a value of "owner", "admin", "member", or "none" as appropriate. <note>The &PRESENCE; element MUST NOT include more than once instance of the &X; element qualified by the 'http://jabber.org/protocol/muc#user' namespace.</note></p>
  1409. <example caption='Service Sends Presence from Existing Occupants to New Occupant'><![CDATA[
  1410. <presence
  1411. from='coven@chat.shakespeare.lit/firstwitch'
  1412. id='3DCB0401-D7CF-4E31-BE05-EDF8D057BFBD'
  1413. to='hag66@shakespeare.lit/pda'>
  1414. <x xmlns='http://jabber.org/protocol/muc#user'>
  1415. <item affiliation='owner' role='moderator'/>
  1416. </x>
  1417. </presence>
  1418. <presence
  1419. from='coven@chat.shakespeare.lit/secondwitch'
  1420. id='C2CD9EE3-8421-431E-854A-A2AD0CE2E23D'
  1421. to='hag66@shakespeare.lit/pda'>
  1422. <x xmlns='http://jabber.org/protocol/muc#user'>
  1423. <item affiliation='admin' role='moderator'/>
  1424. </x>
  1425. </presence>
  1426. ]]></example>
  1427. <p>In this example, the user from the previous example has entered the room, by which time two other people had already entered the room: a user with a room nickname of "firstwitch" (who is a room owner) and a user with a room nickname of "secondwitch" (who is a room admin).</p>
  1428. <p>Unless the room is configured to not broadcast presence from new occupants below a certain affiliation level (as controlled by the "muc#roomconfig_presencebroadcast" room configuration option), the service MUST also send presence from the new participant's occupant JID to the full JIDs of all the occupants (including the new occupant).</p>
  1429. <example caption="Service Sends New Occupant's Presence to All Occupants"><![CDATA[
  1430. <presence
  1431. from='coven@chat.shakespeare.lit/thirdwitch'
  1432. id='27C55F89-1C6A-459A-9EB5-77690145D624'
  1433. to='crone1@shakespeare.lit/desktop'>
  1434. <x xmlns='http://jabber.org/protocol/muc#user'>
  1435. <item affiliation='member' role='participant'/>
  1436. </x>
  1437. </presence>
  1438. <presence
  1439. from='coven@chat.shakespeare.lit/thirdwitch'
  1440. id='9E757BAE-8AC8-4093-AA9C-407F6AEF15D6'
  1441. to='wiccarocks@shakespeare.lit/laptop'>
  1442. <x xmlns='http://jabber.org/protocol/muc#user'>
  1443. <item affiliation='member' role='participant'/>
  1444. </x>
  1445. </presence>
  1446. <presence
  1447. from='coven@chat.shakespeare.lit/thirdwitch'
  1448. id='026B3509-2CCE-4D69-96D6-25F41FFDC408'
  1449. to='hag66@shakespeare.lit/pda'>
  1450. <x xmlns='http://jabber.org/protocol/muc#user'>
  1451. <item affiliation='member' role='participant'/>
  1452. <status code='110'/>
  1453. </x>
  1454. </presence>
  1455. ]]></example>
  1456. <p>In this example, initial room presence is being sent from the new occupant (thirdwitch) to all occupants, including the new occupant.</p>
  1457. <p>As shown in the last stanza, the "self-presence" sent by the room to the new user MUST include a status code of 110 so that the user knows this presence refers to itself as an occupant. This self-presence MUST NOT be sent to the new occupant until the room has sent the presence of all other occupants to the new occupant; this enables the new occupant to know when it has finished receiving the room roster.</p>
  1458. <p>The service MAY rewrite the new occupant's roomnick (e.g., if roomnicks are locked down or based on some other policy).</p>
  1459. <p>In particular, if roomnicks are locked down then the service MUST do one of the following.</p>
  1460. <p>If the user has connected using a "groupchat 1.0" client (as indicated on joining the room by the lack of the MUC extension), then the service SHOULD deny the nickname change request and return a presence stanza of type "error" with a &notacceptable; error condition:</p>
  1461. <example caption='Service Denies Room Join Because Roomnicks Are Locked Down'><![CDATA[
  1462. <presence
  1463. from='coven@chat.shakespeare.lit/thirdwitch'
  1464. id='ng91xs69'
  1465. to='hag66@shakespeare.lit/pda'
  1466. type='error'>
  1467. <x xmlns='http://jabber.org/protocol/muc'/>
  1468. <error by='coven@chat.shakespeare.lit' type='cancel'>
  1469. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1470. </error>
  1471. </presence>
  1472. ]]></example>
  1473. <p>If the user has connected using a MUC client (as indicated on joining the room by inclusion of the MUC extension), then the service MUST allow the client to enter the room, modify the nick in accordance with the lockdown policy, and include a status code of "210" in the presence broadcast that it sends to the new occupant.</p>
  1474. <example caption="Service Sends New Occupant's Presence to New Occupant"><![CDATA[
  1475. <presence
  1476. from='coven@chat.shakespeare.lit/thirdwitch'
  1477. id='n13mt3l'
  1478. to='hag66@shakespeare.lit/pda'>
  1479. <x xmlns='http://jabber.org/protocol/muc#user'>
  1480. <item affiliation='member' role='participant'/>
  1481. <status code='110'/>
  1482. <status code='210'/>
  1483. </x>
  1484. </presence>
  1485. ]]></example>
  1486. <p>Note: The order of the presence stanzas sent to the new occupant is important. The service MUST first send the complete list of the existing occupants to the new occupant and only then send the new occupant's own presence to the new occupant. This helps the client know when it has received the complete "room roster". For tracking purposes, the room might also reflect the original 'id' value if provided in the presence stanza sent by the user.</p>
  1487. <p>After sending the presence broadcast (and only after doing so), the service MAY then send discussion history, the room subject, live messages, presence updates, and other in-room traffic.</p>
  1488. </section3>
  1489. <section3 topic='Non-Anonymous Rooms' anchor='enter-nonanon'>
  1490. <p>If the room is non-anonymous, the service MUST send the new occupant's full JID to all occupants using extended presence information in an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with a 'jid' attribute specifying the occupant's full JID:</p>
  1491. <example caption="Service Sends Full JID to All Occupants"><![CDATA[
  1492. <presence
  1493. from='coven@chat.shakespeare.lit/thirdwitch'
  1494. id='17232D15-134F-43C8-9A29-61C20A64B236'
  1495. to='crone1@shakespeare.lit/desktop'>
  1496. <x xmlns='http://jabber.org/protocol/muc#user'>
  1497. <item affiliation='none'
  1498. jid='hag66@shakespeare.lit/pda'
  1499. role='participant'/>
  1500. </x>
  1501. </presence>
  1502. [ ... ]
  1503. ]]></example>
  1504. <p>If the user is entering a room that is non-anonymous (i.e., which informs all occupants of each occupant's full JID as shown above), the service MUST warn the user by including a status code of "100" in the initial presence that the room sends to the new occupant:</p>
  1505. <example caption="Service Sends New Occupant's Presence to New Occupant"><![CDATA[
  1506. <presence
  1507. from='coven@chat.shakespeare.lit/thirdwitch'
  1508. id='n13mt3l'
  1509. to='hag66@shakespeare.lit/pda'>
  1510. <x xmlns='http://jabber.org/protocol/muc#user'>
  1511. <item affiliation='member' role='participant'/>
  1512. <status code='100'/>
  1513. <status code='110'/>
  1514. <status code='210'/>
  1515. </x>
  1516. </presence>
  1517. ]]></example>
  1518. <p>The inclusion of the status code assists clients in presenting their own notification messages (e.g., information appropriate to the user's locality).</p>
  1519. </section3>
  1520. <section3 topic='Semi-Anonymous Rooms' anchor='enter-semianon'>
  1521. <p>If the room is semi-anonymous, the service MUST send presence from the new occupant to all occupants as specified above (i.e., unless the room is configured to not broadcast presence from new occupants below a certain affiliation level as controlled by the "muc#roomconfig_presencebroadcast" room configuration option), but MUST include the new occupant's full JID only in the presence notifications it sends to occupants with a role of "moderator" and not to non-moderator occupants.</p>
  1522. <p>(Note: All subsequent examples include the 'jid' attribute for each &lt;item/&gt; element, even though this information is not sent to non-moderators in semi-anonymous rooms.)</p>
  1523. </section3>
  1524. <section3 topic='Password-Protected Rooms' anchor='enter-pw'>
  1525. <p>If the room requires a password and the user did not supply one (or the password provided is incorrect), the service MUST deny access to the room and inform the user that they are unauthorized; this is done by returning a presence stanza of type "error" specifying a &notauthorized; error:</p>
  1526. <example caption='Service Denies Access Because No Password Provided'><![CDATA[
  1527. <presence
  1528. from='coven@chat.shakespeare.lit/thirdwitch'
  1529. id='n13mt3l'
  1530. to='hag66@shakespeare.lit/pda'
  1531. type='error'>
  1532. <x xmlns='http://jabber.org/protocol/muc'/>
  1533. <error by='coven@chat.shakespeare.lit' type='auth'>
  1534. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1535. </error>
  1536. </presence>
  1537. ]]></example>
  1538. <p>Passwords SHOULD be supplied with the presence stanza sent when entering the room, contained within an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc' namespace and containing a &lt;password/&gt; child. Passwords are to be sent as cleartext; no other authentication methods are supported at this time, and any such authentication or authorization methods shall be defined in a separate specification (see the <link url='#security'>Security Considerations</link> section of this document).</p>
  1539. <example caption='User Provides Password On Entering a Room'><![CDATA[
  1540. <presence
  1541. from='hag66@shakespeare.lit/pda'
  1542. id='djn4714'
  1543. to='coven@chat.shakespeare.lit/thirdwitch'>
  1544. <x xmlns='http://jabber.org/protocol/muc'>
  1545. <password>cauldronburn</password>
  1546. </x>
  1547. </presence>
  1548. ]]></example>
  1549. </section3>
  1550. <section3 topic='Members-Only Rooms' anchor='enter-members'>
  1551. <p>If the room is members-only but the user is not on the member list, the service MUST deny access to the room and inform the user that they are not allowed to enter the room; this is done by returning a presence stanza of type "error" specifying a &registration; error condition:</p>
  1552. <example caption='Service Denies Access Because User Is Not on Member List'><![CDATA[
  1553. <presence
  1554. from='coven@chat.shakespeare.lit/thirdwitch'
  1555. id='n13mt3l'
  1556. to='hag66@shakespeare.lit/pda'
  1557. type='error'>
  1558. <x xmlns='http://jabber.org/protocol/muc'/>
  1559. <error by='coven@chat.shakespeare.lit' type='auth'>
  1560. <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1561. </error>
  1562. </presence>
  1563. ]]></example>
  1564. </section3>
  1565. <section3 topic='Banned Users' anchor='enter-banned'>
  1566. <p>If the user has been banned from the room (i.e., has an affiliation of "outcast"), the service MUST deny access to the room and inform the user of the fact that they are banned; this is done by returning a presence stanza of type "error" specifying a &forbidden; error condition:</p>
  1567. <example caption='Service Denies Access Because User is Banned'><![CDATA[
  1568. <presence
  1569. from='coven@chat.shakespeare.lit/thirdwitch'
  1570. id='n13mt3l'
  1571. to='hag66@shakespeare.lit/pda'
  1572. type='error'>
  1573. <x xmlns='http://jabber.org/protocol/muc'/>
  1574. <error by='coven@chat.shakespeare.lit' type='auth'>
  1575. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1576. </error>
  1577. </presence>
  1578. ]]></example>
  1579. </section3>
  1580. <section3 topic='Nickname Conflict' anchor='enter-conflict'>
  1581. <p>If the room already contains another user with the nickname desired by the user seeking to enter the room (or if the nickname is reserved by another user on the member list), the service MUST deny access to the room and inform the user of the conflict; this is done by returning a presence stanza of type "error" specifying a &conflict; error condition:</p>
  1582. <example caption='Service Denies Access Because of Nick Conflict'><![CDATA[
  1583. <presence
  1584. from='coven@chat.shakespeare.lit/thirdwitch'
  1585. id='n13mt3l'
  1586. to='hag66@shakespeare.lit/pda'
  1587. type='error'>
  1588. <x xmlns='http://jabber.org/protocol/muc'/>
  1589. <error by='coven@chat.shakespeare.lit' type='cancel'>
  1590. <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1591. </error>
  1592. </presence>
  1593. ]]></example>
  1594. <p>However, if the bare JID &LOCALBARE; of the present occupant matches the bare JID of the user seeking to enter the room, then the service SHOULD allow entry to the user, so that the user has two (or more) in-room "sessions" with the same roomnick, one for each resource. If a service allows more than one occupant with the same bare JID and the same room nickname, it MUST route in-room messages to all of the user's resources and allow all of the user's resources to send messages to the room; it is up to the implementation whether to route private messages to all resources or only one resource (based on presence priority or some other algorithm); however, it is RECOMMENDED to route to all resources.</p>
  1595. <p>How nickname conflicts are determined is up to the implementation (e.g., whether the service applies a case folding routine, a stringprep profile such as Resourceprep or Nodeprep, etc.).</p>
  1596. </section3>
  1597. <section3 topic='Max Users' anchor='enter-maxusers'>
  1598. <p>If the room has reached its maximum number of occupants, the service SHOULD deny access to the room and inform the user of the restriction; this is done by returning a presence stanza of type "error" specifying a &unavailable; error condition:</p>
  1599. <example caption='Service Informs User that Room Occupant Limit Has Been Reached'><![CDATA[
  1600. <presence
  1601. from='coven@chat.shakespeare.lit/thirdwitch'
  1602. id='n13mt3l'
  1603. to='hag66@shakespeare.lit/pda'
  1604. type='error'>
  1605. <x xmlns='http://jabber.org/protocol/muc'/>
  1606. <error by='coven@chat.shakespeare.lit' type='wait'>
  1607. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1608. </error>
  1609. </presence>
  1610. ]]></example>
  1611. <p>Alternatively, the room could kick an "idle user" in order to free up space (where the definition of "idle user" is up to the implementation).</p>
  1612. <p>If the room has reached its maximum number of occupants and a room admin or owner attempts to join, the room MUST allow the admin or owner to join, up to some reasonable number of additional occupants; this helps to prevent denial of service attacks caused by stuffing the room with non-admin users.</p>
  1613. </section3>
  1614. <section3 topic='Locked Room' anchor='enter-locked'>
  1615. <p>If a user attempts to enter a room while it is "locked" (i.e., before the room creator provides an initial configuration and therefore before the room officially exists), the service MUST refuse entry and return an &notfound; error to the user:</p>
  1616. <example caption='Service Denies Access Because Room Does Not (Yet) Exist'><![CDATA[
  1617. <presence
  1618. from='coven@chat.shakespeare.lit/thirdwitch'
  1619. id='n13mt3l'
  1620. to='hag66@shakespeare.lit/pda'
  1621. type='error'>
  1622. <x xmlns='http://jabber.org/protocol/muc'/>
  1623. <error by='coven@chat.shakespeare.lit' type='cancel'>
  1624. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1625. </error>
  1626. </presence>
  1627. ]]></example>
  1628. </section3>
  1629. <section3 topic='Nonexistent Room' anchor='enter-nonexistent'>
  1630. <p>If the room does not already exist when the user seeks to enter it, the service SHOULD create it; however, this is not required, since an implementation or deployment MAY choose to restrict the privilege of creating rooms. For details, see the <link url='#createroom'>Creating a Room</link> section of this document.</p>
  1631. </section3>
  1632. <section3 topic='Room Logging' anchor='enter-logging'>
  1633. <p>If the user is entering a room in which the discussions are logged to a public archive (often accessible via HTTP), the service SHOULD allow the user to enter the room but MUST also warn the user that the discussions are logged. This is done by including a status code of "170" in the initial presence that the room sends to the new occupant:</p>
  1634. <example caption="Service Sends New Occupant's Presence to New Occupant"><![CDATA[
  1635. <presence
  1636. from='coven@chat.shakespeare.lit/thirdwitch'
  1637. id='n13mt3l'
  1638. to='hag66@shakespeare.lit/pda'>
  1639. <x xmlns='http://jabber.org/protocol/muc#user'>
  1640. <item affiliation='member' role='participant'/>
  1641. <status code='100'/>
  1642. <status code='110'/>
  1643. <status code='170'/>
  1644. <status code='210'/>
  1645. </x>
  1646. </presence>
  1647. ]]></example>
  1648. </section3>
  1649. <section3 topic='Discussion History' anchor='enter-history'>
  1650. <p>After sending initial presence as shown above, depending on local service policy or room configuration a room MAY send discussion history to the new occupant. (The room MUST NOT send any discussion history before it finishes sending room presence as specified in the <link url='#enter-pres'>Presence Broadcast</link> section of this document.) Whether such history is sent, and how many messages comprise the history, shall be determined by the chat service implementation or specific deployment depending on local service policy or room configuration.</p>
  1651. <example caption='Delivery of Discussion History'><![CDATA[
  1652. <message
  1653. from='coven@chat.shakespeare.lit/firstwitch'
  1654. id='162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2'
  1655. to='hecate@shakespeare.lit/broom'
  1656. type='groupchat'>
  1657. <body>Thrice the brinded cat hath mew'd.</body>
  1658. <delay xmlns='urn:xmpp:delay'
  1659. from='coven@chat.shakespeare.lit'
  1660. stamp='2002-10-13T23:58:37Z'/>
  1661. </message>
  1662. <message
  1663. from='coven@chat.shakespeare.lit/secondwitch'
  1664. id='90057840-30FD-4141-AA44-103EEDF218FC'
  1665. to='hecate@shakespeare.lit/broom'
  1666. type='groupchat'>
  1667. <body>Thrice and once the hedge-pig whined.</body>
  1668. <delay xmlns='urn:xmpp:delay'
  1669. from='coven@chat.shakespeare.lit'
  1670. stamp='2002-10-13T23:58:43Z'/>
  1671. </message>
  1672. <message
  1673. from='coven@chat.shakespeare.lit/thirdwitch'
  1674. id='77E07BB0-55CF-4BD4-890E-3F7C0E686BBD'
  1675. to='hecate@shakespeare.lit/broom'
  1676. type='groupchat'>
  1677. <body>Harpier cries 'Tis time, 'tis time.</body>
  1678. <delay xmlns='urn:xmpp:delay'
  1679. from='coven@chat.shakespeare.lit'
  1680. stamp='2002-10-13T23:58:49Z'/>
  1681. </message>
  1682. ]]></example>
  1683. <p>Discussion history messages MUST be stamped with &xep0203; information qualified by the 'urn:xmpp:delay' namespace to indicate that they are sent with delayed delivery and to specify the times at which they were originally sent. The 'from' attribute MUST be set to the JID of the room itself.</p>
  1684. <p>(Note: The 'urn:xmpp:delay' namespace defined in <cite>XEP-0203</cite> supersedes the older 'jabber:x:delay' namespace defined in &xep0091;; some implementations include both formats for backward compatibility.)</p>
  1685. <p>The service MUST send all discussion history messages before delivering the room subject and any "live" messages sent after the user enters the room. Note well that this means the room subject (and changes to the room subject prior to the current subject) are not part of the discussion history.</p>
  1686. <p>If the room is non-anonymous, the service MAY include an &xep0033; element that notes the original full JID of the sender by means of the "ofrom" address type:</p>
  1687. <example caption='Discussion History Message with Original From'><![CDATA[
  1688. <message
  1689. from='coven@chat.shakespeare.lit/firstwitch'
  1690. id='162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2'
  1691. to='hecate@shakespeare.lit/broom'
  1692. type='groupchat'>
  1693. <body>Thrice the brinded cat hath mew'd.</body>
  1694. <delay xmlns='urn:xmpp:delay'
  1695. from='coven@chat.shakespeare.lit'
  1696. stamp='2002-10-13T23:58:37Z'/>
  1697. <addresses xmlns='http://jabber.org/protocol/address'>
  1698. <address type='ofrom' jid='crone1@shakespeare.lit/desktop'/>
  1699. </addresses>
  1700. </message>
  1701. ]]></example>
  1702. </section3>
  1703. <section3 topic='Managing Discussion History' anchor='enter-managehistory'>
  1704. <p>A user might want to manage the amount of discussion history provided on entering a room (perhaps because the user is on a low-bandwidth connection or is using a small-footprint client). This is accomplished by including a &lt;history/&gt; child in the initial presence stanza sent when joining the room. There are four allowable attributes for this element:</p>
  1705. <table caption='History Management Attributes'>
  1706. <tr>
  1707. <th>Attribute</th>
  1708. <th>Datatype</th>
  1709. <th>Meaning</th>
  1710. </tr>
  1711. <tr>
  1712. <td>maxchars</td>
  1713. <td>int</td>
  1714. <td>Limit the total number of characters in the history to "X" (where the character count is the characters of the complete XML stanzas, not only their XML character data).</td>
  1715. </tr>
  1716. <tr>
  1717. <td>maxstanzas</td>
  1718. <td>int</td>
  1719. <td>Limit the total number of messages in the history to "X".</td>
  1720. </tr>
  1721. <tr>
  1722. <td>seconds</td>
  1723. <td>int</td>
  1724. <td>Send only the messages received in the last "X" seconds.</td>
  1725. </tr>
  1726. <tr>
  1727. <td>since</td>
  1728. <td>dateTime</td>
  1729. <td>Send only the messages received since the UTC datetime specified (which MUST conform to the DateTime profile specified in &xep0082;).</td>
  1730. </tr>
  1731. </table>
  1732. <p>The service MUST send the smallest amount of traffic that meets any combination of the above criteria, taking into account service-level and room-level defaults. The service MUST send complete message stanzas only (i.e., it MUST not literally truncate the history at a certain number of characters, but MUST send the largest number of complete stanzas that results in a number of characters less than or equal to the 'maxchars' value specified). If the client wishes to receive no history, it MUST set the 'maxchars' attribute to a value of "0" (zero).</p>
  1733. <p>Note: It is known that not all service implementations support MUC history management, so in practice a client might not be able to depend on receiving only the history that it has requested.</p>
  1734. <p>The following examples illustrate the use of this feature.</p>
  1735. <example caption='User Requests Limit on Number of Characters in History'><![CDATA[
  1736. <presence
  1737. from='hag66@shakespeare.lit/pda'
  1738. id='n13mt3l'
  1739. to='coven@chat.shakespeare.lit/thirdwitch'>
  1740. <x xmlns='http://jabber.org/protocol/muc'>
  1741. <history maxchars='65000'/>
  1742. </x>
  1743. </presence>
  1744. ]]></example>
  1745. <example caption='User Requests Limit on Number of Messages in History'><![CDATA[
  1746. <presence
  1747. from='hag66@shakespeare.lit/pda'
  1748. id='n13mt3l'
  1749. to='coven@chat.shakespeare.lit/thirdwitch'>
  1750. <x xmlns='http://jabber.org/protocol/muc'>
  1751. <history maxstanzas='20'/>
  1752. </x>
  1753. </presence>
  1754. ]]></example>
  1755. <example caption='User Requests History in Last 3 Minutes'><![CDATA[
  1756. <presence
  1757. from='hag66@shakespeare.lit/pda'
  1758. id='n13mt3l'
  1759. to='coven@chat.shakespeare.lit/thirdwitch'>
  1760. <x xmlns='http://jabber.org/protocol/muc'>
  1761. <history seconds='180'/>
  1762. </x>
  1763. </presence>
  1764. ]]></example>
  1765. <example caption='User Requests All History Since the Beginning of the Unix Era'><![CDATA[
  1766. <presence
  1767. from='hag66@shakespeare.lit/pda'
  1768. id='n13mt3l'
  1769. to='coven@chat.shakespeare.lit/thirdwitch'>
  1770. <x xmlns='http://jabber.org/protocol/muc'>
  1771. <history since='1970-01-01T00:00:00Z'/>
  1772. </x>
  1773. </presence>
  1774. ]]></example>
  1775. <p>Obviously the service SHOULD NOT return all messages sent in the room since the beginning of the Unix era, and SHOULD appropriately limit the amount of history sent to the user based on service or room defaults.</p>
  1776. <example caption='User Requests No History'><![CDATA[
  1777. <presence
  1778. from='hag66@shakespeare.lit/pda'
  1779. id='n13mt3l'
  1780. to='coven@chat.shakespeare.lit/thirdwitch'>
  1781. <x xmlns='http://jabber.org/protocol/muc'>
  1782. <history maxchars='0'/>
  1783. </x>
  1784. </presence>
  1785. ]]></example>
  1786. </section3>
  1787. <section3 topic='Room Subject' anchor='enter-subject'>
  1788. <p>After the room has optionally sent the discussion history to the new occupant, it SHALL send the current room subject. This is a &MESSAGE; stanza from the room JID (or from the occupant JID of the entity that set the subject), with a &SUBJECT; element but no &BODY; element, as shown in the following example.</p>
  1789. <example caption='Service Informs New Occupant of Room Subject'><![CDATA[
  1790. <message
  1791. from='coven@chat.shakespeare.lit/secondwitch'
  1792. id='F437C672-D438-4BD3-9BFF-091050D32EE2'
  1793. to='crone1@shakespeare.lit/desktop'
  1794. type='groupchat'>
  1795. <subject>Fire Burn and Cauldron Bubble!</subject>
  1796. </message>
  1797. ]]></example>
  1798. <p>If there is no subject set, the room MUST return an empty &SUBJECT; element.</p>
  1799. <example caption='No Subject'><![CDATA[
  1800. <message
  1801. from='coven@chat.shakespeare.lit/secondwitch'
  1802. id='F437C672-D438-4BD3-9BFF-091050D32EE2'
  1803. to='crone1@shakespeare.lit/desktop'
  1804. type='groupchat'>
  1805. <subject></subject>
  1806. </message>
  1807. ]]></example>
  1808. <p>Note: In accordance with the core definition of XML stanzas, any message can contain a &SUBJECT; element; only a message that contains a &SUBJECT; but no &BODY; element shall be considered a subject change for MUC purposes.</p>
  1809. </section3>
  1810. <section3 topic='Live Messages' anchor='enter-live'>
  1811. <p>After the room has sent the room subject, it SHALL begin to send live messages, presence changes, occupant "joins" and "leaves", and other real-time traffic to the new occupant, as described in other sections of this document.</p>
  1812. </section3>
  1813. <section3 topic='Error Conditions' anchor='enter-errorcodes'>
  1814. <p>The following table summarizes the XMPP error conditions that can be returned to an entity that attempts to enter a MUC room.</p>
  1815. <table caption='Error Conditions for Entering a Room'>
  1816. <tr>
  1817. <th>Condition</th>
  1818. <th>Purpose</th>
  1819. </tr>
  1820. <tr>
  1821. <td>&notauthorized;</td>
  1822. <td>Inform user that a password is required</td>
  1823. </tr>
  1824. <tr>
  1825. <td>&forbidden;</td>
  1826. <td>Inform user that he or she is banned from the room</td>
  1827. </tr>
  1828. <tr>
  1829. <td>&notfound;</td>
  1830. <td>Inform user that the room does not exist</td>
  1831. </tr>
  1832. <tr>
  1833. <td>&notallowed;</td>
  1834. <td>Inform user that room creation is restricted</td>
  1835. </tr>
  1836. <tr>
  1837. <td>&notacceptable;</td>
  1838. <td>Inform user that the reserved roomnick must be used</td>
  1839. </tr>
  1840. <tr>
  1841. <td>&registration;</td>
  1842. <td>Inform user that he or she is not on the member list</td>
  1843. </tr>
  1844. <tr>
  1845. <td>&conflict;</td>
  1846. <td>Inform user that his or her desired room nickname is in use or registered by another user</td>
  1847. </tr>
  1848. <tr>
  1849. <td>&unavailable;</td>
  1850. <td>Inform user that the maximum number of users has been reached</td>
  1851. </tr>
  1852. </table>
  1853. </section3>
  1854. </section2>
  1855. <section2 topic='Occupant Modification of the Room Subject' anchor='subject-occupant'>
  1856. <p>If allowed in accordance with room configuration, a mere occupant MAY be allowed to change the subject in a room. For details, see the <link url='#subject-mod'>Modifying the Room Subject</link> section of this document.</p>
  1857. </section2>
  1858. <section2 topic='Sending a Message to All Occupants' anchor='message'>
  1859. <p>An occupant sends a message to all other occupants in the room by sending a message of type "groupchat" to the &ROOMJID; itself (a service MAY ignore or reject messages that do not have a type of "groupchat"). In a moderated room, this privilege is restricted to occupants with a role of participant or higher.</p>
  1860. <example caption='Occupant Sends a Message to All Occupants'><![CDATA[
  1861. <message
  1862. from='hag66@shakespeare.lit/pda'
  1863. id='hysf1v37'
  1864. to='coven@chat.shakespeare.lit'
  1865. type='groupchat'>
  1866. <body>Harpier cries: 'tis time, 'tis time.</body>
  1867. </message>
  1868. ]]></example>
  1869. <p>If the sender has voice in the room (this is the default except in moderated rooms) and the message does not violate any service-level or room-level policies (e.g., policies regarding message content or size), the service MUST change the 'from' attribute to the sender's occupant JID and reflect the message out to the full JID of each occupant.</p>
  1870. <example caption='Service Reflects Message to All Occupants'><![CDATA[
  1871. <message
  1872. from='coven@chat.shakespeare.lit/thirdwitch'
  1873. id='hysf1v37'
  1874. to='crone1@shakespeare.lit/desktop'
  1875. type='groupchat'>
  1876. <body>Harpier cries: 'tis time, 'tis time.</body>
  1877. </message>
  1878. <message
  1879. from='coven@chat.shakespeare.lit/thirdwitch'
  1880. id='hysf1v37'
  1881. to='wiccarocks@shakespeare.lit/laptop'
  1882. type='groupchat'>
  1883. <body>Harpier cries: 'tis time, 'tis time.</body>
  1884. </message>
  1885. <message
  1886. from='coven@chat.shakespeare.lit/thirdwitch'
  1887. id='hysf1v37'
  1888. to='hag66@shakespeare.lit/pda'
  1889. type='groupchat'>
  1890. <body>Harpier cries: 'tis time, 'tis time.</body>
  1891. </message>
  1892. ]]></example>
  1893. <p>The service SHOULD reflect the message with the same 'id' that was generated by the client, to allow clients to track their outbound messages. If the client did not provide an 'id', the server MAY generate an 'id' and use it for all reflections of the same message (e.g. using a UUID as defined in &rfc4122;).</p>
  1894. <p><strong>Note:</strong> the requirement to reflect the 'id' attribute was added in version 1.31 of this XEP. Servers following the new specification SHOULD advertise that with a disco info feature of 'http://jabber.org/protocol/muc#stable_id' on both the service domain and on individual MUCs, so that clients can check for support.</p>
  1895. <p>If the sender is a visitor (i.e., does not have voice in a moderated room), the service MUST return a &forbidden; error to the sender and MUST NOT reflect the message to all occupants. If the sender is not an occupant of the room, the service SHOULD return a &notacceptable; error to the sender and SHOULD NOT reflect the message to all occupants; the only exception to this rule is that an implementation MAY allow users with certain privileges (e.g., a room owner, room admin, or service-level admin) to send messages to the room even if those users are not occupants.</p>
  1896. </section2>
  1897. <section2 topic='Sending a Private Message' anchor='privatemessage'>
  1898. <p>Since each occupant has its own occupant JID, an occupant can send a "private message" to a selected occupant via the service by sending a message to the intended recipient's occupant JID. The message type SHOULD be "chat" and MUST NOT be "groupchat", but MAY be left unspecified (i.e., a normal message). This privilege is controlled by the "muc#roomconfig_allowpm" room configuration option.</p>
  1899. <p>To allow for proper synchronization of these messages to the user's other clients by &xep0280;, the sending client SHOULD add an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace to the message.</p>
  1900. <p><strong>Note:</strong> because this requirement was only added in revision 1.28 of this XEP, receiving entities MUST NOT rely on the existence of the &lt;x/&gt; element on private messages for proper processing.</p>
  1901. <example caption='Occupant Sends Private Message'><![CDATA[
  1902. <message
  1903. from='wiccarocks@shakespeare.lit/laptop'
  1904. id='hgn27af1'
  1905. to='coven@chat.shakespeare.lit/firstwitch'
  1906. type='chat'>
  1907. <body>I'll give thee a wind.</body>
  1908. <x xmlns='http://jabber.org/protocol/muc#user' />
  1909. </message>
  1910. ]]></example>
  1911. <p>The service is responsible for changing the 'from' address to the sender's occupant JID and delivering the message to the intended recipient's full JID. The service SHOULD add the &lt;x/&gt; element if the message does not contain it already.</p>
  1912. <example caption='Recipient Receives the Private Message'><![CDATA[
  1913. <message
  1914. from='coven@chat.shakespeare.lit/secondwitch'
  1915. id='hgn27af1'
  1916. to='crone1@shakespeare.lit/desktop'
  1917. type='chat'>
  1918. <body>I'll give thee a wind.</body>
  1919. <x xmlns='http://jabber.org/protocol/muc#user' />
  1920. </message>
  1921. ]]></example>
  1922. <p>If the sender attempts to send a private message of type "groupchat" to a particular occupant, the service MUST refuse to deliver the message (since the recipient's client would expect in-room messages to be of type "groupchat") and return a &badrequest; error to the sender:</p>
  1923. <example caption='Occupant Attempts to Send a Message of Type "Groupchat" to a Particular Occupant'><![CDATA[
  1924. <message
  1925. from='wiccarocks@shakespeare.lit/laptop'
  1926. id='bx71f29k'
  1927. to='coven@chat.shakespeare.lit/firstwitch'
  1928. type='groupchat'>
  1929. <body>I'll give thee a wind.</body>
  1930. </message>
  1931. <message
  1932. from='coven@chat.shakespeare.lit/firstwitch'
  1933. id='bx71f29k'
  1934. to='wiccarocks@shakespeare.lit/laptop'
  1935. type='error'>
  1936. <body>I'll give thee a wind.</body>
  1937. <error by='coven@chat.shakespeare.lit' type='modify'>
  1938. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1939. </error>
  1940. </message>
  1941. ]]></example>
  1942. <p>If the sender attempts to send a private message to an occupant JID that does not exist, the service MUST return an &notfound; error to the sender.</p>
  1943. <p>If the sender is not an occupant of the room in which the intended recipient is visiting, the service MUST return a &notacceptable; error to the sender.</p>
  1944. </section2>
  1945. <section2 topic='Changing Nickname' anchor='changenick'>
  1946. <p>A common feature of chat rooms is the ability for an occupant to change his or her nickname within the room. In MUC this is done by sending updated presence information to the room, specifically by sending presence to a new occupant JID in the same room (changing only the resource identifier in the occupant JID).</p>
  1947. <example caption='Occupant Changes Nickname'><![CDATA[
  1948. <presence
  1949. from='hag66@shakespeare.lit/pda'
  1950. id='ifd1c35'
  1951. to='coven@chat.shakespeare.lit/oldhag'/>
  1952. ]]></example>
  1953. <p>The service then sends two presence stanzas to the full JID of each occupant (including the occupant who is changing his or her room nickname), one of type "unavailable" for the old nickname and one indicating availability for the new nickname.</p>
  1954. <p>The unavailable presence MUST contain the following as extended presence information in an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace:</p>
  1955. <ul>
  1956. <li>The new nickname (in this case, nick='oldhag')</li>
  1957. <li>A status code of 303</li>
  1958. </ul>
  1959. <p>This enables the recipients to correlate the old roomnick with the new roomnick.</p>
  1960. <example caption='Service Updates Nick'><![CDATA[
  1961. <presence
  1962. from='coven@chat.shakespeare.lit/thirdwitch'
  1963. id='5C1B95B3-7CCC-4422-A952-8885A050BDE9'
  1964. to='crone1@shakespeare.lit/desktop'
  1965. type='unavailable'>
  1966. <x xmlns='http://jabber.org/protocol/muc#user'>
  1967. <item affiliation='member'
  1968. jid='hag66@shakespeare.lit/pda'
  1969. nick='oldhag'
  1970. role='participant'/>
  1971. <status code='303'/>
  1972. </x>
  1973. </presence>
  1974. <presence
  1975. from='coven@chat.shakespeare.lit/thirdwitch'
  1976. id='B0E6ABD5-575D-42F0-8242-569004D88F73'
  1977. to='wiccarocks@shakespeare.lit/laptop'
  1978. type='unavailable'>
  1979. <x xmlns='http://jabber.org/protocol/muc#user'>
  1980. <item affiliation='member'
  1981. jid='hag66@shakespeare.lit/pda'
  1982. nick='oldhag'
  1983. role='participant'/>
  1984. <status code='303'/>
  1985. </x>
  1986. </presence>
  1987. <presence
  1988. from='coven@chat.shakespeare.lit/thirdwitch'
  1989. id='DC352437-C019-40EC-B590-AF29E879AF98'
  1990. to='hag66@shakespeare.lit/pda'
  1991. type='unavailable'>
  1992. <x xmlns='http://jabber.org/protocol/muc#user'>
  1993. <item affiliation='member'
  1994. jid='hag66@shakespeare.lit/pda'
  1995. nick='oldhag'
  1996. role='participant'/>
  1997. <status code='303'/>
  1998. <status code='110'/>
  1999. </x>
  2000. </presence>
  2001. <presence
  2002. from='coven@chat.shakespeare.lit/oldhag'
  2003. id='19E41EB3-3F4C-444F-8A1B-713A8860980C'
  2004. to='crone1@shakespeare.lit/desktop'>
  2005. <x xmlns='http://jabber.org/protocol/muc#user'>
  2006. <item affiliation='member'
  2007. jid='hag66@shakespeare.lit/pda'
  2008. role='participant'/>
  2009. </x>
  2010. </presence>
  2011. <presence
  2012. from='coven@chat.shakespeare.lit/oldhag'
  2013. id='79225CEA-F610-49BE-9B97-FEFA8737185B'
  2014. to='wiccarocks@shakespeare.lit/laptop'>
  2015. <x xmlns='http://jabber.org/protocol/muc#user'>
  2016. <item affiliation='member'
  2017. jid='hag66@shakespeare.lit/pda'
  2018. role='participant'/>
  2019. </x>
  2020. </presence>
  2021. <presence
  2022. from='coven@chat.shakespeare.lit/oldhag'
  2023. id='5B4F27A4-25ED-43F7-A699-382C6B4AFC67'
  2024. to='hag66@shakespeare.lit/pda'>
  2025. <x xmlns='http://jabber.org/protocol/muc#user'>
  2026. <item affiliation='member'
  2027. jid='hag66@shakespeare.lit/pda'
  2028. role='participant'/>
  2029. <status code='110'/>
  2030. </x>
  2031. </presence>
  2032. ]]></example>
  2033. <p>If the service modifies the user's nickname in accordance with local service policies, it MUST include a MUC status code of 210 in the presence stanza sent to the user. An example follows (here the service changes the nickname to all lowercase).</p>
  2034. <example caption='Occupant Changes Nickname, Modified by Service'><![CDATA[
  2035. <presence
  2036. from='hag66@shakespeare.lit/pda'
  2037. id='nx6z2v5'
  2038. to='coven@chat.shakespeare.lit/OldHag'/>
  2039. <presence
  2040. from='coven@chat.shakespeare.lit/oldhag'
  2041. id='D0E2B666-3373-42C9-B726-D52C40A48383'
  2042. to='hag66@shakespeare.lit/pda'>
  2043. <x xmlns='http://jabber.org/protocol/muc#user'>
  2044. <item affiliation='member'
  2045. jid='hag66@shakespeare.lit/pda'
  2046. role='participant'/>
  2047. <status code='110'/>
  2048. <status code='210'/>
  2049. </x>
  2050. </presence>
  2051. ]]></example>
  2052. <p>If the user attempts to change his or her room nickname to a room nickname that is already in use by another user (or that is reserved by another user affiliated with the room, e.g., a member or owner), the service MUST deny the nickname change request and inform the user of the conflict; this is done by returning a presence stanza of type "error" specifying a &conflict; error condition:</p>
  2053. <example caption='Service Denies Nickname Change Because of Nick Conflict'><![CDATA[
  2054. <presence
  2055. from='coven@chat.shakespeare.lit/thirdwitch'
  2056. id='ifd1c35'
  2057. to='hag66@shakespeare.lit/pda'
  2058. type='error'>
  2059. <x xmlns='http://jabber.org/protocol/muc'/>
  2060. <error by='coven@chat.shakespeare.lit' type='cancel'>
  2061. <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2062. </error>
  2063. </presence>
  2064. ]]></example>
  2065. <p>However, if the bare JID &LOCALBARE; of the present occupant matches the bare JID of the user seeking to change his or her nickname, then the service MAY allow the nickname change. See the <link url='#enter-conflict'>Nickname Conflict</link> section of this document for details.</p>
  2066. <p>If the user attempts to change their room nickname but nicknames are "locked down", the service MUST either deny the nickname change request and return a presence stanza of type "error" with a &notacceptable; error condition:</p>
  2067. <example caption='Service Denies Nickname Change Because Roomnicks Are Locked Down'><![CDATA[
  2068. <presence
  2069. from='coven@chat.shakespeare.lit/thirdwitch'
  2070. id='ifd1c35'
  2071. to='hag66@shakespeare.lit/pda'
  2072. type='error'>
  2073. <x xmlns='http://jabber.org/protocol/muc'/>
  2074. <error by='coven@chat.shakespeare.lit' type='cancel'>
  2075. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2076. </error>
  2077. </presence>
  2078. ]]></example>
  2079. <p>The user SHOULD then discover its reserved nickname as specified in the <link url='#reservednick'>Discovering Reserved Room Nickname</link> section of this document.</p>
  2080. </section2>
  2081. <section2 topic='Changing Availability Status' anchor='changepres'>
  2082. <p>In text chat systems such as IRC, one common use for changing one's room nickname is to indicate a change in one's availability (e.g., changing one's room nickname to "thirdwitch|away"). In XMPP, availability is of course noted by a change in presence (specifically the &lt;show/&gt; and &lt;status/&gt; elements), which can provide important context within a chatroom. An occupant changes availability status within the room by sending updated presence to its &OCCUPANTJID;.</p>
  2083. <example caption='Occupant Changes Availability Status'><![CDATA[
  2084. <presence
  2085. from='wiccarocks@shakespeare.lit/laptop'
  2086. id='kr7v143h'
  2087. to='coven@chat.shakespeare.lit/oldhag'>
  2088. <show>xa</show>
  2089. <status>gone where the goblins go</status>
  2090. </presence>
  2091. ]]></example>
  2092. <p>If the room is configured to broadcast presence from entities with the occupant's role, the service then sends a presence stanza from the occupant changing his or her presence to the full JID of each occupant, including extended presence information about the occupant's role and full JID to those with privileges to view such information:</p>
  2093. <example caption='Service Passes Along Changed Presence to All Occupants'><![CDATA[
  2094. <presence
  2095. from='coven@chat.shakespeare.lit/secondwitch'
  2096. id='86E11ABF-26BC-46F1-AD3B-F5E54F3C1EE5'
  2097. to='crone1@shakespeare.lit/desktop'>
  2098. <show>xa</show>
  2099. <status>gone where the goblins go</status>
  2100. <x xmlns='http://jabber.org/protocol/muc#user'>
  2101. <item affiliation='admin'
  2102. jid='wiccarocks@shakespeare.lit/laptop'
  2103. role='moderator'/>
  2104. </x>
  2105. </presence>
  2106. [ ... ]
  2107. ]]></example>
  2108. </section2>
  2109. <section2 topic='Inviting Another User to a Room' anchor='invite'>
  2110. <p>There are two ways of inviting another user to a room: direct invitations and mediated invitations.</p>
  2111. <p>Direct invitations were the original method used in the early Jabber community's "groupchat 1.0" protocol. Mediated invitations were added in Multi-User Chat as a way to handle invitations in the context of members-only rooms (so that the room could exercise control over the issuance of invitations). The existence of two different invitation methods might cause confusion among client developers. Because the room needs to be involved in the invitation process only for members-only rooms, because members-only rooms are relatively rare, and because mediated invitations do not work when &xep0016; or similar technologies are used to block communication from entities not in a user's roster, client developers are encouraged to use direct invitations for all other room types.</p>
  2112. <section3 topic='Direct Invitation' anchor='invite-direct'>
  2113. <p>A method for sending a direct invitation (not mediated by the room itself) is defined in &xep0249;. Sending the invitation directly can help to work around communications blocking on the part of the invitee (which might reject or discard messages from entities not in its roster).</p>
  2114. </section3>
  2115. <section3 topic='Mediated Invitation' anchor='invite-mediated'>
  2116. <p>It can be useful to invite another user to a room in which one is an occupant. To send a mediated invitation, a MUC client MUST send XML of the following form to the &ROOMJID; itself (the reason is OPTIONAL and the message MUST be explicitly or implicitly of type "normal"):</p>
  2117. <example caption='Occupant Sends a Mediated Invitation'><![CDATA[
  2118. <message
  2119. from='crone1@shakespeare.lit/desktop'
  2120. id='nzd143v8'
  2121. to='coven@chat.shakespeare.lit'>
  2122. <x xmlns='http://jabber.org/protocol/muc#user'>
  2123. <invite to='hecate@shakespeare.lit'>
  2124. <reason>
  2125. Hey Hecate, this is the place for all good witches!
  2126. </reason>
  2127. </invite>
  2128. </x>
  2129. </message>
  2130. ]]></example>
  2131. <p>The &ROOMJID; itself MUST then add a 'from' address to the &lt;invite/&gt; element whose value is the bare JID, full JID, or occupant JID of the inviter and send the invitation to the invitee specified in the 'to' address; the room SHOULD add the password if the room is password-protected):</p>
  2132. <example caption='Room Sends Invitation to Invitee on Behalf of Invitor'><![CDATA[
  2133. <message
  2134. from='coven@chat.shakespeare.lit'
  2135. id='nzd143v8'
  2136. to='hecate@shakespeare.lit'>
  2137. <x xmlns='http://jabber.org/protocol/muc#user'>
  2138. <invite from='crone1@shakespeare.lit/desktop'>
  2139. <reason>
  2140. Hey Hecate, this is the place for all good witches!
  2141. </reason>
  2142. </invite>
  2143. <password>cauldronburn</password>
  2144. </x>
  2145. </message>
  2146. ]]></example>
  2147. <p>If the room is members-only, the service MAY also add the invitee to the member list. (Note: Invitation privileges in members-only rooms SHOULD be restricted to room admins; if a member without privileges to edit the member list attempts to invite another user, the service SHOULD return a &forbidden; error to the occupant; for details, see the <link url='#modifymember'>Modifying the Member List</link> section of this document.)</p>
  2148. <p>If the inviter supplies a non-existent JID, the room SHOULD return an &notfound; error to the inviter.</p>
  2149. <p>The invitee MAY choose to formally decline (as opposed to ignore) the invitation; and this is something that the sender might want to be informed about. In order to decline the invitation, the invitee MUST send a message of the following form to the &ROOMJID; itself:</p>
  2150. <example caption='Invitee Declines Invitation'><![CDATA[
  2151. <message
  2152. from='hecate@shakespeare.lit/broom'
  2153. id='jk2vs61v'
  2154. to='coven@chat.shakespeare.lit'>
  2155. <x xmlns='http://jabber.org/protocol/muc#user'>
  2156. <decline to='crone1@shakespeare.lit'>
  2157. <reason>
  2158. Sorry, I'm too busy right now.
  2159. </reason>
  2160. </decline>
  2161. </x>
  2162. </message>
  2163. ]]></example>
  2164. <example caption='Room Informs Invitor that Invitation Was Declined'><![CDATA[
  2165. <message
  2166. from='coven@chat.shakespeare.lit'
  2167. id='jk2vs61v'
  2168. to='crone1@shakespeare.lit/desktop'>
  2169. <x xmlns='http://jabber.org/protocol/muc#user'>
  2170. <decline from='hecate@shakespeare.lit'>
  2171. <reason>
  2172. Sorry, I'm too busy right now.
  2173. </reason>
  2174. </decline>
  2175. </x>
  2176. </message>
  2177. ]]></example>
  2178. <p>It may be wondered why the invitee does not send the decline message directly to the inviter. The main reason is that certain implementations might choose to base invitations on occupant JIDs rather than bare JIDs (so that, for example, an occupant could invite someone from one room to another without knowing that person's bare JID). Thus the service needs to handle both the invites and declines.</p>
  2179. </section3>
  2180. </section2>
  2181. <section2 topic='Converting a One-to-One Chat Into a Multi-User Conference' anchor='continue'>
  2182. <p>Sometimes it is desirable to convert a one-to-one chat into a multi-user conference. The process is as follows.</p>
  2183. <p>First, two users begin a one-to-one chat.</p>
  2184. <example caption='A One-to-One Chat'><![CDATA[
  2185. <message
  2186. from='crone1@shakespeare.lit/desktop'
  2187. id='mjs51f36'
  2188. to='wiccarocks@shakespeare.lit/laptop'
  2189. type='chat'>
  2190. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  2191. <body>Thrice the brinded cat hath mew'd.</body>
  2192. </message>
  2193. <message
  2194. from='wiccarocks@shakespeare.lit/laptop'
  2195. id='l9ij1f3h'
  2196. to='crone1@shakespeare.lit/desktop'
  2197. type='chat'>
  2198. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  2199. <body>Thrice and once the hedge-pig whined.</body>
  2200. </message>
  2201. ]]></example>
  2202. <p>Now the first person decides to include a third person in the discussion, so she does the following:</p>
  2203. <ol start='1'>
  2204. <li>Creates a new multi-user chatroom</li>
  2205. <li>Sends history of the one-to-one chat to the room (this is purely discretionary; however, because it might cause information leakage, the client ought to warn the user before doing so)</li>
  2206. <li>Sends an invitation to the second person and the third person, including a &lt;continue/&gt; element (optionally including a 'thread' attribute).</li>
  2207. </ol>
  2208. <p>Note: The new room SHOULD be non-anonymous and MAY be an instant room as specified in the <link url='#createroom-instant'>Creating an Instant Room</link> section of this document.</p>
  2209. <p>Note: If the one-to-one chat messages included a &THREAD; element, the person who creates the room SHOULD include the ThreadID with the history messages, specify the ThreadID in the invitations as the value of the &lt;continue/&gt; element's 'thread' attribute, and include the ThreadID in any new messages sent to the room. Use of ThreadIDs is RECOMMENDED because it helps to provide continuity between the one-to-one chat and the multi-user chat.</p>
  2210. <example caption='Continuing the Discussion I: User Creates Room'><![CDATA[
  2211. <presence
  2212. from='crone1@shakespeare.lit/desktop'
  2213. to='coven@chat.shakespeare.lit/firstwitch'>
  2214. <x xmlns='http://jabber.org/protocol/muc'/>
  2215. </presence>
  2216. <presence
  2217. from='coven@chat.shakespeare.lit/firstwitch'
  2218. to='crone1@shakespeare.lit/desktop'>
  2219. <x xmlns='http://jabber.org/protocol/muc#user'>
  2220. <item affiliation='owner' role='moderator'/>
  2221. <status code='110'/>
  2222. </x>
  2223. </presence>
  2224. ]]></example>
  2225. <example caption='Continuing the Discussion II: Owner Sends History to Room'><![CDATA[
  2226. <message
  2227. from='crone1@shakespeare.lit/desktop'
  2228. id='b4va73n0'
  2229. to='coven@chat.shakespeare.lit'
  2230. type='groupchat'>
  2231. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  2232. <body>Thrice the brinded cat hath mew'd.</body>
  2233. <delay xmlns='urn:xmpp:delay'
  2234. from='crone1@shakespeare.lit/desktop'
  2235. stamp='2004-09-29T01:54:37Z'/>
  2236. </message>
  2237. <message
  2238. from='crone1@shakespeare.lit/desktop'
  2239. id='i4hs759k'
  2240. to='coven@chat.shakespeare.lit'
  2241. type='groupchat'>
  2242. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  2243. <body>Thrice and once the hedge-pig whined.</body>
  2244. <delay xmlns='urn:xmpp:delay'
  2245. from='crone1@shakespeare.lit/desktop'
  2246. stamp='2004-09-29T01:55:21Z'/>
  2247. </message>
  2248. ]]></example>
  2249. <p>Note: Use of the <cite>Delayed Delivery</cite> protocol enables the room creator to specify the datetime of each message from the one-to-one chat history (via the 'stamp' attribute), as well as the JID of the original sender of each message (via the 'from' attribute); note well that the 'from' here is not the room itself, since the originator of the message is the delaying party. The room creator might send the complete one-to-one chat history before inviting additional users to the room, and also send as history any messages appearing in the one-to-one chat interface after joining the room and before the second person joins the room; if the one-to-one history is especially large, the sending client might want to send the history over a few seconds rather than all at once (to avoid triggering rate limits). The service SHOULD NOT add its own delay elements (as described in the <link url='#enter-history'>Discussion History</link> section of this document) to prior chat history messages received from the room owner.</p>
  2250. <example caption='Continuing the Discussion III: Owner Sends Invitations, Including Continue Flag'><![CDATA[
  2251. <message
  2252. from='crone1@shakespeare.lit/desktop'
  2253. id='gl3s85n7'
  2254. to='coven@chat.shakespeare.lit'>
  2255. <x xmlns='http://jabber.org/protocol/muc#user'>
  2256. <invite to='wiccarocks@shakespeare.lit/laptop'>
  2257. <reason>This coven needs both wiccarocks and hag66.</reason>
  2258. <continue thread='e0ffe42b28561960c6b12b944a092794b9683a38'/>
  2259. </invite>
  2260. <invite to='hag66@shakespeare.lit'>
  2261. <reason>This coven needs both wiccarocks and hag66.</reason>
  2262. <continue thread='e0ffe42b28561960c6b12b944a092794b9683a38'/>
  2263. </invite>
  2264. </x>
  2265. </message>
  2266. ]]></example>
  2267. <p>Note: Since the inviter's client knows the full JID of the person with whom the inviter was having a one-to-one chat, it SHOULD include the full JID (rather than the bare JID) in its invitation to that user.</p>
  2268. <p>The invitations are delivered to the invitees:</p>
  2269. <example caption='Invitations Delivered'><![CDATA[
  2270. <message
  2271. from='coven@chat.shakespeare.lit/firstwitch'
  2272. id='DB0414CB-AFBA-407E-9DE3-0E014E84860F'
  2273. to='wiccarocks@shakespeare.lit/laptop'>
  2274. <x xmlns='http://jabber.org/protocol/muc#user'>
  2275. <invite from='crone1@shakespeare.lit'>
  2276. <reason>This coven needs both wiccarocks and hag66.</reason>
  2277. <continue thread='e0ffe42b28561960c6b12b944a092794b9683a38'/>
  2278. </invite>
  2279. </x>
  2280. </message>
  2281. <message
  2282. from='coven@chat.shakespeare.lit/firstwitch'
  2283. id='89028D79-AB4C-44C0-BE81-B07607C2F4C2'
  2284. to='hag66@shakespeare.lit'>
  2285. <x xmlns='http://jabber.org/protocol/muc#user'>
  2286. <invite from='crone1@shakespeare.lit'>
  2287. <reason>This coven needs both wiccarocks and hag66.</reason>
  2288. <continue thread='e0ffe42b28561960c6b12b944a092794b9683a38'/>
  2289. </invite>
  2290. </x>
  2291. </message>
  2292. ]]></example>
  2293. <p>When the client being used by &lt;wiccarocks@shakespeare.lit/laptop&gt; receives the invitation, it can either auto-join the room or prompt the user whether to join (subject to user preferences) and then seamlessly convert the existing one-to-one chat window into a multi-user conferencing window:</p>
  2294. <example caption='Invitee Accepts Invitation, Joins Room, and Receives Presence and History'><![CDATA[
  2295. <presence
  2296. from='wiccarocks@shakespeare.lit/laptop'
  2297. to='coven@chat.shakespeare.lit/secondwitch'>
  2298. <x xmlns='http://jabber.org/protocol/muc'/>
  2299. </presence>
  2300. <presence
  2301. from='coven@chat.shakespeare.lit/firstwitch'
  2302. to='wiccarocks@shakespeare.lit/laptop'>
  2303. <x xmlns='http://jabber.org/protocol/muc#user'>
  2304. <item affiliation='owner' role='moderator'/>
  2305. </x>
  2306. </presence>
  2307. <presence
  2308. from='coven@chat.shakespeare.lit/secondwitch'
  2309. to='wiccarocks@shakespeare.lit/laptop'>
  2310. <x xmlns='http://jabber.org/protocol/muc#user'>
  2311. <item affiliation='member' role='participant'/>
  2312. </x>
  2313. </presence>
  2314. <message
  2315. from='coven@chat.shakespeare.lit'
  2316. id='67268D36-100C-457D-A769-8A3663BD1949'
  2317. to='wiccarocks@shakespeare.lit/laptop'
  2318. type='groupchat'>
  2319. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  2320. <body>Thrice the brinded cat hath mew'd.</body>
  2321. <delay xmlns='urn:xmpp:delay'
  2322. from='coven@chat.shakespeare.lit'
  2323. stamp='2004-09-29T01:54:37Z'/>
  2324. </message>
  2325. <message
  2326. from='coven@chat.shakespeare.lit'
  2327. id='367DCF6B-0CB4-482D-A142-C0B9E08016B5'
  2328. to='wiccarocks@shakespeare.lit/laptop'
  2329. type='groupchat'>
  2330. <thread>e0ffe42b28561960c6b12b944a092794b9683a38</thread>
  2331. <body>Thrice and once the hedge-pig whined.</body>
  2332. <delay xmlns='urn:xmpp:delay'
  2333. from='coven@chat.shakespeare.lit'
  2334. stamp='2004-09-29T01:55:21Z'/>
  2335. </message>
  2336. ]]></example>
  2337. </section2>
  2338. <section2 topic='Registering with a Room' anchor='register'>
  2339. <p>An implementation MAY allow an unaffiliated user (in a moderated room, normally a participant) to register with a room; as a result, the user will become a member of the room and will have their preferred nickname reserved in the room. (Conversely, an implementation MAY restrict this privilege and allow only room admins to add new members.) In particular, it is not possible to join a members-only room without being on the member list, so an entity might need to request membership in order to join such a room.</p>
  2340. <p>If allowed, this functionality SHOULD be implemented by enabling a user to send a request for registration requirements to the room qualified by the 'jabber:iq:register' namespace as described in &xep0077;:</p>
  2341. <example caption='User Requests Registration Requirements'><![CDATA[
  2342. <iq from='hag66@shakespeare.lit/pda'
  2343. id='jw81b36f'
  2344. to='coven@chat.shakespeare.lit'
  2345. type='get'>
  2346. <query xmlns='jabber:iq:register'/>
  2347. </iq>
  2348. ]]></example>
  2349. <p>If the room does not exist, the service MUST return an &notfound; error.</p>
  2350. <example caption='Room Does Not Exist'><![CDATA[
  2351. <iq from='coven@chat.shakespeare.lit'
  2352. id='jw81b36f'
  2353. to='hag66@shakespeare.lit/pda'
  2354. type='error'>
  2355. <error type='cancel'>
  2356. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2357. </error>
  2358. </iq>
  2359. ]]></example>
  2360. <p>If the user requesting registration requirements is not allowed to register with the room (e.g., because that privilege has been restricted), the room MUST return a &notallowed; error to the user.</p>
  2361. <example caption='User Is Not Allowed to Register'><![CDATA[
  2362. <iq from='coven@chat.shakespeare.lit'
  2363. id='jw81b36f'
  2364. to='hag66@shakespeare.lit/pda'
  2365. type='error'>
  2366. <error type='cancel'>
  2367. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2368. </error>
  2369. </iq>
  2370. ]]></example>
  2371. <p>If the user is already registered, as described in <cite>XEP-0077</cite> the room MUST reply with an IQ stanza of type "result", which MUST contain an empty &lt;registered/&gt; element and SHOULD contain at least a &lt;username/&gt; element that specifies the user's registered nickname in the room.</p>
  2372. <example caption='User Is Already Registered'><![CDATA[
  2373. <iq from='coven@chat.shakespeare.lit'
  2374. id='jw81b36f'
  2375. to='hag66@shakespeare.lit/pda'
  2376. type='result'>
  2377. <query xmlns='jabber:iq:register'>
  2378. <registered/>
  2379. <username>thirdwitch</username>
  2380. </query>
  2381. </iq>
  2382. ]]></example>
  2383. <p>Otherwise, the room MUST then return a Data Form to the user (as described in &xep0004;). The information required to register might vary by implementation or deployment and is not fully specified in this document (e.g., the fields registered by this document for the 'http://jabber.org/protocol/muc#register' FORM_TYPE might be supplemented in the future via the mechanisms described in the <link url="#registrar-formtype">Field Standardization</link> section of this document). The following can be taken as a fairly typical example:</p>
  2384. <example caption='Service Returns Registration Form'><![CDATA[
  2385. <iq from='coven@chat.shakespeare.lit'
  2386. id='jw81b36f'
  2387. to='hag66@shakespeare.lit/pda'
  2388. type='result'>
  2389. <query xmlns='jabber:iq:register'>
  2390. <instructions>
  2391. To register on the web, visit http://shakespeare.lit/
  2392. </instructions>
  2393. <x xmlns='jabber:x:data' type='form'>
  2394. <title>Dark Cave Registration</title>
  2395. <instructions>
  2396. Please provide the following information
  2397. to register with this room.
  2398. </instructions>
  2399. <field
  2400. type='hidden'
  2401. var='FORM_TYPE'>
  2402. <value>http://jabber.org/protocol/muc#register</value>
  2403. </field>
  2404. <field
  2405. label='Given Name'
  2406. type='text-single'
  2407. var='muc#register_first'>
  2408. <required/>
  2409. </field>
  2410. <field
  2411. label='Family Name'
  2412. type='text-single'
  2413. var='muc#register_last'>
  2414. <required/>
  2415. </field>
  2416. <field
  2417. label='Desired Nickname'
  2418. type='text-single'
  2419. var='muc#register_roomnick'>
  2420. <required/>
  2421. </field>
  2422. <field
  2423. label='Your URL'
  2424. type='text-single'
  2425. var='muc#register_url'/>
  2426. <field
  2427. label='Email Address'
  2428. type='text-single'
  2429. var='muc#register_email'/>
  2430. <field
  2431. label='FAQ Entry'
  2432. type='text-multi'
  2433. var='muc#register_faqentry'/>
  2434. </x>
  2435. </query>
  2436. </iq>
  2437. ]]></example>
  2438. <p>The user SHOULD then submit the form:</p>
  2439. <example caption='User Submits Registration Form'><![CDATA[
  2440. <iq from='hag66@shakespeare.lit/pda'
  2441. id='nv71va54'
  2442. to='coven@chat.shakespeare.lit'
  2443. type='set'>
  2444. <query xmlns='jabber:iq:register'>
  2445. <x xmlns='jabber:x:data' type='submit'>
  2446. <field var='FORM_TYPE'>
  2447. <value>http://jabber.org/protocol/muc#register</value>
  2448. </field>
  2449. <field var='muc#register_first'>
  2450. <value>Brunhilde</value>
  2451. </field>
  2452. <field var='muc#register_last'>
  2453. <value>Entwhistle-Throckmorton</value>
  2454. </field>
  2455. <field var='muc#register_roomnick'>
  2456. <value>thirdwitch</value>
  2457. </field>
  2458. <field var='muc#register_url'>
  2459. <value>http://witchesonline/~hag66/</value>
  2460. </field>
  2461. <field var='muc#register_email'>
  2462. <value>hag66@witchesonline</value>
  2463. </field>
  2464. <field var='muc#register_faqentry'>
  2465. <value>Just another witch.</value>
  2466. </field>
  2467. </x>
  2468. </query>
  2469. </iq>
  2470. ]]></example>
  2471. <p>If the desired room nickname is already reserved for that room, the room MUST return a &conflict; error to the user:</p>
  2472. <example caption='Room Returns Conflict Error to User'><![CDATA[
  2473. <iq from='coven@chat.shakespeare.lit'
  2474. id='nv71va54'
  2475. to='hag66@shakespeare.lit/pda'
  2476. type='error'>
  2477. <error type='cancel'>
  2478. <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2479. </error>
  2480. </iq>
  2481. ]]></example>
  2482. <p>If the room or service does not support registration, it MUST return a &unavailable; error to the user:</p>
  2483. <example caption='Room Returns Service Unavailable Error to User'><![CDATA[
  2484. <iq from='coven@chat.shakespeare.lit'
  2485. id='nv71va54'
  2486. to='hag66@shakespeare.lit/pda'
  2487. type='error'>
  2488. <error type='cancel'>
  2489. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2490. </error>
  2491. </iq>
  2492. ]]></example>
  2493. <p>If the user did not include a valid data form, the room MUST return a &badrequest; error to the user:</p>
  2494. <example caption='Room Returns Service Bad Request Error to User'><![CDATA[
  2495. <iq from='coven@chat.shakespeare.lit'
  2496. id='nv71va54'
  2497. to='hag66@shakespeare.lit/pda'
  2498. type='error'>
  2499. <error type='modify'>
  2500. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2501. </error>
  2502. </iq>
  2503. ]]></example>
  2504. <p>Otherwise, the room MUST inform the user that the registration request was successfully received:</p>
  2505. <example caption='Room Informs User that Registration Request Has Been Processed'><![CDATA[
  2506. <iq from='coven@chat.shakespeare.lit'
  2507. id='nv71va54'
  2508. to='hag66@shakespeare.lit/pda'
  2509. type='result'/>
  2510. ]]></example>
  2511. <p>After the user submits the form, the service MAY request that the submission be approved by a room admin/owner (see the <link url='#regapprove'>Approving Registration Requests</link> section of this document), MAY immediately add the user to the member list by changing the user's affiliation from "none" to "member", or MAY perform some service-specific checking (e.g., email verification).</p>
  2512. <p>If the service changes the user's affiliation and the user is in the room, it MUST send updated presence from this individual to all occupants, indicating the change in affiliation by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "member".</p>
  2513. <example caption="Service Sends Notice of Membership to All Occupants"><![CDATA[
  2514. <presence
  2515. from='coven@chat.shakespeare.lit/thirdwitch'
  2516. to='crone1@shakespeare.lit/desktop'>
  2517. <x xmlns='http://jabber.org/protocol/muc#user'>
  2518. <item affiliation='member'
  2519. jid='hag66@shakespeare.lit/pda'
  2520. role='participant'/>
  2521. </x>
  2522. </presence>
  2523. [ ... ]
  2524. ]]></example>
  2525. <p>If the user's nickname is modified by the service as a result of registration and the user is in the room, the service SHOULD include status code "210" in the updated presence notification that it sends to all users.</p>
  2526. <p>If a user has registered with a room, the room MAY choose to restrict the user to use of the registered nickname only in that room. If it does so, it SHOULD modify the user's nickname to be the registered nickname (instead of returning a &notacceptable; error) if the user attempts to join the room with a roomnick other than the user's registered roomnick (this enables a room to "lock down" roomnicks for consistent identification of occupants).</p>
  2527. </section2>
  2528. <section2 topic='Getting the Member List' anchor='getmemberlist'>
  2529. <p>If allowed in accordance with room configuration, an occupant MAY be allowed to retrieve the list of room members. For details, see the <link url='#modifymember'>Modifying the Member List</link> section of this document.</p>
  2530. </section2>
  2531. <section2 topic='Discovering Reserved Room Nickname' anchor='reservednick'>
  2532. <p>A user MAY have a reserved room nickname, for example through explicit room registration, database integration, or nickname "lockdown". A user SHOULD discover his or her reserved nickname before attempting to enter the room. This is done by sending a Service Discovery information request to the room JID while specifying a well-known Service Discovery node of "x-roomuser-item".</p>
  2533. <example caption="User Requests Reserved Nickname"><![CDATA[
  2534. <iq from='hag66@shakespeare.lit/pda'
  2535. id='getnick1'
  2536. to='coven@chat.shakespeare.lit'
  2537. type='get'>
  2538. <query xmlns='http://jabber.org/protocol/disco#info'
  2539. node='x-roomuser-item'/>
  2540. </iq>
  2541. ]]></example>
  2542. <p>It is OPTIONAL for a multi-user chat service to support the foregoing service discovery node. If the room or service does not support the foregoing service discovery node, it MUST return a &feature; error to the user. If it does and the user has a registered nickname, it MUST return the nickname to the user as the value of the 'name' attribute of a Service Discovery &lt;identity/&gt; element (for which the category/type SHOULD be "conference/text"):</p>
  2543. <example caption="Room Returns Nickname"><![CDATA[
  2544. <iq from='coven@chat.shakespeare.lit'
  2545. id='getnick1'
  2546. to='hag66@shakespeare.lit/pda'
  2547. type='result'>
  2548. <query xmlns='http://jabber.org/protocol/disco#info'
  2549. node='x-roomuser-item'>
  2550. <identity
  2551. category='conference'
  2552. name='thirdwitch'
  2553. type='text'/>
  2554. </query>
  2555. </iq>
  2556. ]]></example>
  2557. <p>If the user does not have a registered nickname, the room MUST return a service discovery &QUERY; element that is empty (in accordance with <cite>XEP-0030</cite>).</p>
  2558. <p>Even if a user has registered one room nickname, the service SHOULD allow the user to specify a different nickname on entering the room (e.g., in order to join from different client resources), although the service MAY choose to "lock down" nicknames and therefore deny entry to the user, including a &notacceptable; error. The service MUST NOT return an error to the user if his or her client sends the foregoing request after having already joined the room, but instead SHOULD reply as previously described.</p>
  2559. <p>If another user attempts to join the room with a nickname reserved by the first user, the service MUST deny entry to the second user and return a &conflict; error as previously described.</p>
  2560. </section2>
  2561. <section2 topic='Requesting Voice' anchor='requestvoice'>
  2562. <p>It is not possible for a visitor to speak (i.e., send a message to all occupants) in a moderated room. To request voice, a visitor SHOULD send a &MESSAGE; stanza containing a data form to the room itself, where the data form contains only a "muc#role" field with a value of "participant".</p>
  2563. <example caption='Occupant Requests Voice'><![CDATA[
  2564. <message from='hag66@shakespeare.lit/pda'
  2565. id='yd53c486'
  2566. to='coven@chat.shakespeare.lit'>
  2567. <x xmlns='jabber:x:data' type='submit'>
  2568. <field var='FORM_TYPE'>
  2569. <value>http://jabber.org/protocol/muc#request</value>
  2570. </field>
  2571. <field var='muc#role'
  2572. type='list-single'
  2573. label='Requested role'>
  2574. <value>participant</value>
  2575. </field>
  2576. </x>
  2577. </message>
  2578. ]]></example>
  2579. <p>The service then proceeds as described in the <link url='#voiceapprove'>Approving Voice Requests</link> section of this document.</p>
  2580. </section2>
  2581. <section2 topic='Exiting a Room' anchor='exit'>
  2582. <p>In order to exit a multi-user chat room, an occupant sends a presence stanza of type "unavailable" to the &OCCUPANTJID; it is currently using in the room.</p>
  2583. <example caption='Occupant Exits a Room'><![CDATA[
  2584. <presence
  2585. from='hag66@shakespeare.lit/pda'
  2586. to='coven@chat.shakespeare.lit/thirdwitch'
  2587. type='unavailable'/>
  2588. ]]></example>
  2589. <p>The service MUST then send a presence stanzas of type "unavailable" from the departing user's occupant JID to the departing occupant's full JIDs, including a status code of "110" to indicate that this notification is "self-presence":</p>
  2590. <example caption='Service Sends Self-Presence Related to Departure of Occupant'><![CDATA[
  2591. <presence
  2592. from='coven@chat.shakespeare.lit/thirdwitch'
  2593. to='hag66@shakespeare.lit/pda'
  2594. type='unavailable'>
  2595. <x xmlns='http://jabber.org/protocol/muc#user'>
  2596. <item affiliation='member'
  2597. jid='hag66@shakespeare.lit/pda'
  2598. role='none'/>
  2599. <status code='110'/>
  2600. </x>
  2601. </presence>
  2602. ]]></example>
  2603. <p>Note: The presence stanza used to exit a room MUST possess a 'type' attribute whose value is "unavailable". For further discussion, see the <link url='#bizrules-presence'>Presence</link> business rules.</p>
  2604. <p>The service MUST then send presence stanzas of type "unavailable" from the departing user's occupant JID to the full JIDs of the remaining occupants:</p>
  2605. <example caption='Service Sends Presence Related to Departure of Occupant'><![CDATA[
  2606. <presence
  2607. from='coven@chat.shakespeare.lit/thirdwitch'
  2608. to='hag66@shakespeare.lit/pda'
  2609. type='unavailable'>
  2610. <x xmlns='http://jabber.org/protocol/muc#user'>
  2611. <item affiliation='member'
  2612. jid='hag66@shakespeare.lit/pda'
  2613. role='none'/>
  2614. <status code='110'/>
  2615. </x>
  2616. </presence>
  2617. <presence
  2618. from='coven@chat.shakespeare.lit/thirdwitch'
  2619. to='crone1@shakespeare.lit/desktop'
  2620. type='unavailable'>
  2621. <x xmlns='http://jabber.org/protocol/muc#user'>
  2622. <item affiliation='member'
  2623. jid='hag66@shakespeare.lit/pda'
  2624. role='none'/>
  2625. </x>
  2626. </presence>
  2627. <presence
  2628. from='coven@chat.shakespeare.lit/thirdwitch'
  2629. to='wiccarocks@shakespeare.lit/laptop'
  2630. type='unavailable'>
  2631. <x xmlns='http://jabber.org/protocol/muc#user'>
  2632. <item affiliation='member'
  2633. jid='hag66@shakespeare.lit/pda'
  2634. role='none'/>
  2635. </x>
  2636. </presence>
  2637. ]]></example>
  2638. <p>Presence stanzas of type "unavailable" reflected by the room MUST contain extended presence information about roles and affiliations; in particular, the 'role' attribute MUST be set to a value of "none" to denote that the individual is no longer an occupant.</p>
  2639. <p>The occupant MAY include normal &lt;status/&gt; information in the unavailable presence stanzas; this enables the occupant to provide a custom exit message if desired:</p>
  2640. <example caption='Custom Exit Message'><![CDATA[
  2641. <presence
  2642. from='wiccarocks@shakespeare.lit/laptop'
  2643. to='coven@chat.shakespeare.lit/oldhag'
  2644. type='unavailable'>
  2645. <status>gone where the goblins go</status>
  2646. </presence>
  2647. ]]></example>
  2648. <p>Normal presence stanza generation rules apply as defined in &xmppim;, so that if the user sends a general unavailable presence stanza, the user's server will broadcast that stanza to the client's &OCCUPANTJID;; as a result, there is no need for the leaving client to send directed unavailable presence to its occupant JID. It is possible that a user might not be able to gracefully exit the room by sending unavailable presence. If the user goes offline without sending unavailable presence, the user's server is responsible for sending unavailable presence on behalf of the user (in accordance with <cite>RFC 6121</cite>).</p>
  2649. <p>Note: See <link url='#impl-service-ghosts'>Ghost Users</link> for suggestions regarding room occupants that appear to be present in the room but that are actually offline.</p>
  2650. <p>Note: If the room is not persistent and this occupant is the last to exit, the service is responsible for destroying the room.</p>
  2651. </section2>
  2652. </section1>
  2653. <section1 topic='Moderator Use Cases' anchor='moderator'>
  2654. <p>A moderator has privileges to perform certain actions within the room (e.g., to change the roles of some occupants) but does not have rights to change persistent information about affiliations (which can be changed only by an admin or owner) or the room configuration. Exactly which actions can be performed by a moderator is subject to configuration. However, for the purposes of the MUC framework, moderators are stipulated to have privileges to perform the following actions:</p>
  2655. <ol start='1'>
  2656. <li>discover an occupant's full JID in a semi-anonymous room (occurs automatically through presence)</li>
  2657. <li>modify the subject</li>
  2658. <li>kick a participant or visitor from the room</li>
  2659. <li>grant or revoke voice in a moderated room</li>
  2660. <li>modify the list of occupants who have voice in a moderated room</li>
  2661. </ol>
  2662. <p>These features are implemented with a request/response exchange using &lt;iq/&gt; elements that contain child elements qualified by the 'http://jabber.org/protocol/muc#admin' namespace. The examples below illustrate the protocol interactions to implement the desired functionality. (Except where explicitly noted below, any of the following administrative requests MUST be denied if the &lt;user@host&gt; of the 'from' address of the request does not match the bare JID portion of one of the moderators; in this case, the service MUST return a &forbidden; error.)</p>
  2663. <section2 topic='Modifying the Room Subject' anchor='subject-mod'>
  2664. <p>A common feature of multi-user chat rooms is the ability to change the subject within the room.</p>
  2665. <p>By default, only users with a role of "moderator" SHOULD be allowed to change the subject in a room (although this is configurable, with the result that a mere participant or even visitor might be allowed to change the subject, as controlled by the "muc#roomconfig_changesubject" option).</p>
  2666. <p>The subject is changed by sending a message of type "groupchat" to the &ROOMJID;, where the &MESSAGE; MUST contain a &lt;subject/&gt; element that specifies the new subject but MUST NOT contain a &BODY; element (or a &THREAD; element). In accordance with the core definition of XMPP, other child elements are allowed (although the entity that receives them might ignore them).</p>
  2667. <p>Note: A message with a &SUBJECT; and a &BODY; or a &SUBJECT; and a &THREAD; is a legitimate message, but it SHALL NOT be interpreted as a subject change.</p>
  2668. <example caption='Moderator Changes Subject'><![CDATA[
  2669. <message
  2670. from='wiccarocks@shakespeare.lit/laptop'
  2671. id='lh2bs617'
  2672. to='coven@chat.shakespeare.lit'
  2673. type='groupchat'>
  2674. <subject>Fire Burn and Cauldron Bubble!</subject>
  2675. </message>
  2676. ]]></example>
  2677. <p>The MUC service MUST reflect the message to all other occupants with a 'from' address equal to the room JID or to the occupant JID that corresponds to the sender of the subject change:</p>
  2678. <example caption='Service Informs All Occupants of Subject Change'><![CDATA[
  2679. <message
  2680. from='coven@chat.shakespeare.lit/secondwitch'
  2681. id='5BCE07C5-0729-4353-A6A3-ED9818C9B498'
  2682. to='crone1@shakespeare.lit/desktop'
  2683. type='groupchat'>
  2684. <subject>Fire Burn and Cauldron Bubble!</subject>
  2685. </message>
  2686. [ ... ]
  2687. ]]></example>
  2688. <p>As explained under <link url='#enter-history'></link>, when a new occupant joins the room the room SHOULD include the last subject change after the discussion history.</p>
  2689. <p>A MUC client that receives such a message MAY choose to display an in-room message, such as the following:</p>
  2690. <example caption='Client Displays Room Subject Change Message'><![CDATA[
  2691. * secondwitch has changed the subject to: Fire Burn and Cauldron Bubble!
  2692. ]]></example>
  2693. <p>If someone without appropriate privileges attempts to change the room subject, the service MUST return a message of type "error" specifying a &forbidden; error condition:</p>
  2694. <example caption='Service Returns Error Related to Unauthorized Subject Change'><![CDATA[
  2695. <message
  2696. from='coven@chat.shakespeare.lit/thirdwitch'
  2697. id='lh2bs617'
  2698. to='hag66@shakespeare.lit/pda'
  2699. type='error'>
  2700. <subject>Fire Burn and Cauldron Bubble!</subject>
  2701. <error by='coven@chat.shakespeare.lit' type='auth'>
  2702. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2703. </error>
  2704. </message>
  2705. ]]></example>
  2706. <p>In order to remove the existing subject but not provide a new subject (i.e., set the subject to be empty), the client shall send an empty &lt;subject/&gt; element (i.e., either "&lt;subject/&gt;" or "&lt;subject&gt;&lt;/subject&gt;").</p>
  2707. <example caption='Moderator Sets Empty Subject'><![CDATA[
  2708. <message
  2709. from='wiccarocks@shakespeare.lit/laptop'
  2710. id='uj3bs61g'
  2711. to='coven@chat.shakespeare.lit'
  2712. type='groupchat'>
  2713. <subject></subject>
  2714. </message>
  2715. ]]></example>
  2716. </section2>
  2717. <section2 topic='Kicking an Occupant' anchor='kick'>
  2718. <p>A moderator has permissions to kick certain kinds of occupants from a room (which occupants are "kickable" depends on service provisioning, room configuration, and the moderator's affiliation -- see below). The kick is performed based on the occupant's room nickname and is completed by setting the role of a participant or visitor to a value of "none".</p>
  2719. <example caption='Moderator Kicks Occupant'><![CDATA[
  2720. <iq from='fluellen@shakespeare.lit/pda'
  2721. id='kick1'
  2722. to='harfleur@chat.shakespeare.lit'
  2723. type='set'>
  2724. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2725. <item nick='pistol' role='none'>
  2726. <reason>Avaunt, you cullion!</reason>
  2727. </item>
  2728. </query>
  2729. </iq>
  2730. ]]></example>
  2731. <p>The service MUST remove the kicked occupant by sending a presence stanza of type "unavailable" to each kicked occupant, including status code 307 in the extended presence information, optionally along with the reason (if provided) and the roomnick or bare JID of the user who initiated the kick.</p>
  2732. <example caption='Service Removes Kicked Occupant'><![CDATA[
  2733. <presence
  2734. from='harfleur@chat.shakespeare.lit/pistol'
  2735. to='pistol@shakespeare.lit/harfleur'
  2736. type='unavailable'>
  2737. <x xmlns='http://jabber.org/protocol/muc#user'>
  2738. <item affiliation='none' role='none'>
  2739. <actor nick='Fluellen'/>
  2740. <reason>Avaunt, you cullion!</reason>
  2741. </item>
  2742. <status code='110'/>
  2743. <status code='307'/>
  2744. </x>
  2745. </presence>
  2746. ]]></example>
  2747. <p>The inclusion of the status code assists clients in presenting their own notification messages (e.g., information appropriate to the user's locality). The optional inclusion of the reason and actor enable the kicked user to understand why he or she was kicked, and by whom if the kicked occupant would like to discuss the matter. <note>Some commentors have complained that this opens room owners and administrators up to potential abuse; unfortunately, with great power comes great responsibility.</note></p>
  2748. <p>After removing the kicked occupant(s), the service MUST then inform the moderator of success:</p>
  2749. <example caption='Service Informs Moderator of Success'><![CDATA[
  2750. <iq from='harfleur@chat.shakespeare.lit'
  2751. id='kick1'
  2752. to='fluellen@shakespeare.lit/pda'
  2753. type='result'/>
  2754. ]]></example>
  2755. <p>After informing the moderator, the service MUST then inform all of the remaining occupants that the kicked occupant is no longer in the room by sending presence stanzas of type "unavailable" from the individual's roomnick (&OCCUPANTJID;) to all the remaining occupants (just as it does when occupants exit the room of their own volition), including the status code and optionally the reason and actor.</p>
  2756. <example caption='Service Informs Remaining Occupants'><![CDATA[
  2757. <presence
  2758. from='harfleur@chat.shakespeare.lit/pistol'
  2759. to='gower@shakespeare.lit/cell'
  2760. type='unavailable'>
  2761. <x xmlns='http://jabber.org/protocol/muc#user'>
  2762. <item affiliation='none' role='none'/>
  2763. <status code='307'/>
  2764. </x>
  2765. </presence>
  2766. [ ... ]
  2767. ]]></example>
  2768. <p>A user cannot be kicked by a moderator with a lower affiliation. Therefore, if a moderator who is a member attempts to kick an admin or a moderator who is a member or admin attempts to kick an owner, the service MUST deny the request and return a &notallowed; error to the sender:</p>
  2769. <example caption='Service Returns Error on Attempt to Kick User With Higher Affiliation'><![CDATA[
  2770. <iq from='coven@chat.shakespeare.lit'
  2771. id='kicktest'
  2772. to='wiccarocks@shakespeare.lit/laptop'
  2773. type='error'>
  2774. <error type='cancel'>
  2775. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2776. </error>
  2777. </iq>
  2778. ]]></example>
  2779. <p>If a moderator attempts to kick himself, the service MAY deny the request and return a &conflict; error to the sender. (Although the act of kicking oneself may seem odd, it is common in IRC as a way of apologizing for one's actions in the room.)</p>
  2780. </section2>
  2781. <section2 topic='Granting Voice to a Visitor' anchor='grantvoice'>
  2782. <p>In a moderated room, a moderator might want to manage who does and does not have "voice" in the room (i.e., the ability to send messages to all occupants). Voice is granted based on the visitor's room nickname, which the service will convert into the visitor's full JID internally. The moderator grants voice to a visitor by changing the visitor's role to "participant".</p>
  2783. <example caption='Moderator Grants Voice to a Visitor'><![CDATA[
  2784. <iq from='crone1@shakespeare.lit/desktop'
  2785. id='voice1'
  2786. to='coven@chat.shakespeare.lit'
  2787. type='set'>
  2788. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2789. <item nick='thirdwitch'
  2790. role='participant'/>
  2791. </query>
  2792. </iq>
  2793. ]]></example>
  2794. <p>The &lt;reason/&gt; element is OPTIONAL:</p>
  2795. <example caption='Moderator Grants Voice to a Visitor (With a Reason)'><![CDATA[
  2796. <iq from='crone1@shakespeare.lit/desktop'
  2797. id='voice1'
  2798. to='coven@chat.shakespeare.lit'
  2799. type='set'>
  2800. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2801. <item nick='thirdwitch'
  2802. role='participant'>
  2803. <reason>A worthy witch indeed!</reason>
  2804. </item>
  2805. </query>
  2806. </iq>
  2807. ]]></example>
  2808. <p>The service MUST then inform the moderator of success:</p>
  2809. <example caption='Service Informs Moderator of Success'><![CDATA[
  2810. <iq from='coven@chat.shakespeare.lit'
  2811. id='voice1'
  2812. to='crone1@shakespeare.lit/desktop'
  2813. type='result'/>
  2814. ]]></example>
  2815. <p>The service MUST then send updated presence from this individual's &OCCUPANTJID; to all occupants, indicating the addition of voice privileges by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'role' attribute set to a value of "participant".</p>
  2816. <example caption="Service Sends Notice of Voice to All Occupants"><![CDATA[
  2817. <presence
  2818. from='coven@chat.shakespeare.lit/thirdwitch'
  2819. to='crone1@shakespeare.lit/desktop'>
  2820. <x xmlns='http://jabber.org/protocol/muc#user'>
  2821. <item affiliation='member'
  2822. nick='thirdwitch'
  2823. role='participant'>
  2824. <reason>A worthy witch indeed!</reason>
  2825. </item>
  2826. </x>
  2827. </presence>
  2828. [ ... ]
  2829. ]]></example>
  2830. </section2>
  2831. <section2 topic='Revoking Voice from a Participant' anchor='revokevoice'>
  2832. <p>In a moderated room, a moderator might want to revoke a participant's privileges to speak. The moderator can revoke voice from a participant by changing the participant's role to "visitor":</p>
  2833. <example caption='Moderator Revokes Voice from a Participant'><![CDATA[
  2834. <iq from='crone1@shakespeare.lit/desktop'
  2835. id='voice2'
  2836. to='coven@chat.shakespeare.lit'
  2837. type='set'>
  2838. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2839. <item nick='thirdwitch'
  2840. role='visitor'/>
  2841. </query>
  2842. </iq>
  2843. ]]></example>
  2844. <p>The &lt;reason/&gt; element is OPTIONAL:</p>
  2845. <example caption='Moderator Revokes Voice from a Visitor (With a Reason)'><![CDATA[
  2846. <iq from='crone1@shakespeare.lit/desktop'
  2847. id='voice2'
  2848. to='coven@chat.shakespeare.lit'
  2849. type='set'>
  2850. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2851. <item nick='thirdwitch'
  2852. role='visitor'>
  2853. <reason>Not so worthy after all!</reason>
  2854. </item>
  2855. </query>
  2856. </iq>
  2857. ]]></example>
  2858. <p>The service MUST then inform the moderator of success:</p>
  2859. <example caption='Service Informs Moderator of Success'><![CDATA[
  2860. <iq from='coven@chat.shakespeare.lit'
  2861. id='voice2'
  2862. to='crone1@shakespeare.lit/desktop'
  2863. type='result'/>
  2864. ]]></example>
  2865. <p>The service MUST then send updated presence from this individual to all occupants, indicating the removal of voice privileges by sending a presence element that contains an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'role' attribute set to a value of "visitor".</p>
  2866. <example caption="Service Notes Loss of Voice"><![CDATA[
  2867. <presence
  2868. from='coven@chat.shakespeare.lit/thirdwitch'
  2869. to='crone1@shakespeare.lit/desktop'>
  2870. <x xmlns='http://jabber.org/protocol/muc#user'>
  2871. <item affiliation='member'
  2872. jid='hag66@shakespeare.lit/pda'
  2873. role='visitor'/>
  2874. </x>
  2875. </presence>
  2876. [ ... ]
  2877. ]]></example>
  2878. <p>A moderator MUST NOT be able to revoke voice from a user whose affiliation is at or above the moderator's level. In addition, a service MUST NOT allow the voice privileges of an admin or owner to be removed by anyone. If a moderator attempts to revoke voice privileges from such a user, the service MUST deny the request and return a &notallowed; error to the sender along with the offending item(s):</p>
  2879. <example caption='Service Returns Error on Attempt to Revoke Voice from an Admin, Owner, or User with a Higher Affiliation'><![CDATA[
  2880. <iq from='coven@chat.shakespeare.lit'
  2881. id='voicetest'
  2882. to='crone1@shakespeare.lit/desktop'
  2883. type='error'>
  2884. <error type='cancel'>
  2885. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2886. </error>
  2887. </iq>
  2888. ]]></example>
  2889. </section2>
  2890. <section2 topic='Modifying the Voice List' anchor='modifyvoice'>
  2891. <p>A moderator in a moderated room might want to modify the voice list. To do so, the moderator first requests the voice list by querying the room for all occupants with a role of 'participant'.</p>
  2892. <example caption='Moderator Requests Voice List'><![CDATA[
  2893. <iq from='bard@shakespeare.lit/globe'
  2894. id='voice3'
  2895. to='goodfolk@chat.shakespeare.lit'
  2896. type='get'>
  2897. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2898. <item role='participant'/>
  2899. </query>
  2900. </iq>
  2901. ]]></example>
  2902. <p>The service MUST then return the voice list to the moderator; each item MUST include the 'nick' and 'role' attributes and SHOULD include the 'affiliation' and 'jid' attributes:</p>
  2903. <example caption='Service Sends Voice List to Moderator'><![CDATA[
  2904. <iq from='goodfolk@chat.shakespeare.lit'
  2905. id='voice3'
  2906. to='bard@shakespeare.lit/globe'
  2907. type='result'>
  2908. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2909. <item affiliation='none'
  2910. jid='polonius@hamlet/castle'
  2911. nick='Polo'
  2912. role='participant'/>
  2913. <item affiliation='none'
  2914. jid='horatio@hamlet/castle'
  2915. nick='horotoro'
  2916. role='participant'/>
  2917. <item affiliation='member'
  2918. jid='hecate@shakespeare.lit/broom'
  2919. nick='Hecate'
  2920. role='participant'/>
  2921. </query>
  2922. </iq>
  2923. ]]></example>
  2924. <p>The moderator can then modify the voice list if desired. In order to do so, the moderator MUST send the changed items (i.e., only the "delta") back to the service; each item MUST include the 'nick' attribute and 'role' attribute (normally set to a value of "participant" or "visitor") but SHOULD NOT include the 'jid' attribute and MUST NOT include the 'affiliation' attribute (which is used to manage affiliations such as owner rather than the participant role):</p>
  2925. <example caption='Moderator Sends Modified Voice List to Service'><![CDATA[
  2926. <iq from='bard@shakespeare.lit/globe'
  2927. id='voice4'
  2928. to='goodfolk@chat.shakespeare.lit'
  2929. type='set'>
  2930. <query xmlns='http://jabber.org/protocol/muc#admin'>
  2931. <item nick='Hecate'
  2932. role='visitor'/>
  2933. <item nick='rosencrantz'
  2934. role='participant'>
  2935. <reason>A worthy fellow.</reason>
  2936. </item>
  2937. <item nick='guildenstern'
  2938. role='participant'>
  2939. <reason>A worthy fellow.</reason>
  2940. </item>
  2941. </query>
  2942. </iq>
  2943. ]]></example>
  2944. <p>The service MUST then inform the moderator of success:</p>
  2945. <example caption='Service Informs Moderator of Success'><![CDATA[
  2946. <iq from='goodfolk@chat.shakespeare.lit'
  2947. id='voice1'
  2948. to='bard@shakespeare.lit/globe'
  2949. type='result'/>
  2950. ]]></example>
  2951. <p>The service MUST then send updated presence for any affected individuals to all occupants, indicating the change in voice privileges by sending the appropriate extended presence stanzas as described in the foregoing use cases.</p>
  2952. <p>As noted, voice privileges cannot be revoked from a room owner or room admin, nor from any user with a higher affiliation than the moderator making the request. If a room admin attempts to revoke voice privileges from such a user by modifying the voice list, the service MUST deny the request and return a &notallowed; error to the sender:</p>
  2953. <example caption='Service Returns Error on Attempt to Revoke Voice from an Admin, Owner, or User with a Higher Affiliation'><![CDATA[
  2954. <iq from='goodfolk@chat.shakespeare.lit'
  2955. id='voicetest'
  2956. to='bard@shakespeare.lit/globe'
  2957. type='error'>
  2958. <error type='cancel'>
  2959. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  2960. </error>
  2961. </iq>
  2962. ]]></example>
  2963. </section2>
  2964. <section2 topic='Approving Voice Requests' anchor='voiceapprove'>
  2965. <p>As noted in the <link url='#requestvoice'>Requesting Voice</link> section of this document, an occupant requests voice by sending a voice request data form to the service. The service then SHOULD use that voice request data form as the basis for a voice approval data form that it generates and sends to the room moderator(s). The voice approval data form is contained in a &MESSAGE; stanza, as shown below.</p>
  2966. <example caption='Voice Request Approval Form'><![CDATA[
  2967. <message from='coven@chat.shakespeare.lit'
  2968. id='approve'
  2969. to='crone1@shakespeare.lit/pda'>
  2970. <x xmlns='jabber:x:data' type='form'>
  2971. <title>Voice request</title>
  2972. <instructions>
  2973. To approve this request for voice, select
  2974. the &quot;Grant voice to this person?&quot;
  2975. checkbox and click OK. To skip this request,
  2976. click the cancel button.
  2977. </instructions>
  2978. <field var='FORM_TYPE' type='hidden'>
  2979. <value>http://jabber.org/protocol/muc#request</value>
  2980. </field>
  2981. <field var='muc#role'
  2982. type='list-single'
  2983. label='Requested role'>
  2984. <value>participant</value>
  2985. </field>
  2986. <field var='muc#jid'
  2987. type='jid-single'
  2988. label='User ID'>
  2989. <value>hag66@shakespeare.lit/pda</value>
  2990. </field>
  2991. <field var='muc#roomnick'
  2992. type='text-single'
  2993. label='Room Nickname'>
  2994. <value>thirdwitch</value>
  2995. </field>
  2996. <field var='muc#request_allow'
  2997. type='boolean'
  2998. label='Grant voice to this person?'>
  2999. <value>false</value>
  3000. </field>
  3001. </x>
  3002. </message>
  3003. ]]></example>
  3004. <p>In order to approve the request, a moderator shall submit the form:</p>
  3005. <example caption='Voice Request Approval Submission'><![CDATA[
  3006. <message from='crone1@shakespeare.lit/pda'
  3007. id='approve'
  3008. to='coven@chat.shakespeare.lit'>
  3009. <x xmlns='jabber:x:data' type='submit'>
  3010. <field var='FORM_TYPE' type='hidden'>
  3011. <value>http://jabber.org/protocol/muc#request</value>
  3012. </field>
  3013. <field var='muc#role'>
  3014. <value>participant</value>
  3015. </field>
  3016. <field var='muc#jid'>
  3017. <value>hag66@shakespeare.lit/pda</value>
  3018. </field>
  3019. <field var='muc#roomnick'>
  3020. <value>thirdwitch</value>
  3021. </field>
  3022. <field var='muc#request_allow'>
  3023. <value>true</value>
  3024. </field>
  3025. </x>
  3026. </message>
  3027. ]]></example>
  3028. <p>If a moderator approves the voice request, the service shall grant voice to the occupant and send a presence update as described in the <link url='#grantvoice'>Granting Voice to a Visitor</link> section of this document.</p>
  3029. </section2>
  3030. </section1>
  3031. <section1 topic='Admin Use Cases' anchor='admin'>
  3032. <p>A room administrator has privileges to modify persistent information about user affiliations (e.g., by banning users) and to grant and revoke moderator status, but does not have rights to change the room configuration, which is the sole province of the room owner(s). Exactly which actions can be performed by a room admin is subject to configuration. However, for the purposes of the MUC framework, room admins are stipulated to at a minimum have privileges to perform the following actions:</p>
  3033. <ol start='1'>
  3034. <li>ban a user from the room</li>
  3035. <li>modify the list of users who are banned from the room</li>
  3036. <li>grant or revoke membership</li>
  3037. <li>modify the member list</li>
  3038. <li>grant or revoke moderator status</li>
  3039. <li>modify the list of moderators</li>
  3040. </ol>
  3041. <p>These features are implemented with a request/response exchange using &lt;iq/&gt; elements that contain child elements qualified by the 'http://jabber.org/protocol/muc#admin' namespace. The examples below illustrate the protocol interactions that implement the desired functionality. (Except where explicitly noted below, any of the following administrative requests MUST be denied if the &lt;user@host&gt; of the 'from' address of the request does not match the bare JID of one of the room admins; in this case, the service MUST return a &forbidden; error.)</p>
  3042. <section2 topic='Banning a User' anchor='ban'>
  3043. <p>An admin or owner can ban one or more users from a room. The ban MUST be performed based on the occupant's bare JID. In order to ban a user, an admin MUST change the user's affiliation to "outcast".</p>
  3044. <example caption='Admin Bans User'><![CDATA[
  3045. <iq from='kinghenryv@shakespeare.lit/throne'
  3046. id='ban1'
  3047. to='southampton@chat.shakespeare.lit'
  3048. type='set'>
  3049. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3050. <item affiliation='outcast'
  3051. jid='earlofcambridge@shakespeare.lit'/>
  3052. </query>
  3053. </iq>
  3054. ]]></example>
  3055. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  3056. <example caption='Admin Bans User (With a Reason)'><![CDATA[
  3057. <iq from='kinghenryv@shakespeare.lit/throne'
  3058. id='ban1'
  3059. to='southampton@chat.shakespeare.lit'
  3060. type='set'>
  3061. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3062. <item affiliation='outcast'
  3063. jid='earlofcambridge@shakespeare.lit'>
  3064. <reason>Treason</reason>
  3065. </item>
  3066. </query>
  3067. </iq>
  3068. ]]></example>
  3069. <p>The service MUST add that bare JID to the ban list, MUST remove the outcast's nickname from the list of registered nicknames, and MUST inform the admin or owner of success:</p>
  3070. <example caption='Service Informs Admin or Owner of Success'><![CDATA[
  3071. <iq from='southampton@chat.shakespeare.lit'
  3072. id='ban1'
  3073. to='kinghenryv@shakespeare.lit/throne'
  3074. type='result'/>
  3075. ]]></example>
  3076. <p>The service MUST also remove any banned users who are in the room by sending a presence stanza of type "unavailable" to each banned occupant, including status code 301 in the extended presence information, optionally along with the reason (if provided) and the roomnick or bare JID of the user who initiated the ban.</p>
  3077. <example caption='Service Removes Banned User'><![CDATA[
  3078. <presence
  3079. from='southampton@chat.shakespeare.lit/cambridge'
  3080. to='earlofcambridge@shakespeare.lit/stabber'
  3081. type='unavailable'>
  3082. <x xmlns='http://jabber.org/protocol/muc#user'>
  3083. <item affiliation='outcast' role='none'>
  3084. <actor nick='The ♚'/>
  3085. <reason>Treason</reason>
  3086. </item>
  3087. <status code='301'/>
  3088. </x>
  3089. </presence>
  3090. ]]></example>
  3091. <p>The inclusion of the status code assists clients in presenting their own notification messages (e.g., information appropriate to the user's locality). The optional inclusion of the reason and actor enable the banned user to understand why he or she was banned, and by whom if the banned user would like to discuss the matter.</p>
  3092. <p>The service MUST then inform all of the remaining occupants that the banned user is no longer in the room by sending presence stanzas of type "unavailable" from the banned user to all remaining occupants (just as it does when occupants exit the room of their own volition), including the status code and optionally the reason and actor:</p>
  3093. <example caption='Service Informs Remaining Occupants'><![CDATA[
  3094. <presence
  3095. type='unavailable'
  3096. from='southampton@chat.shakespeare.lit/cambridge'
  3097. to='exeter@shakespeare.lit/pda'>
  3098. <x xmlns='http://jabber.org/protocol/muc#user'>
  3099. <item affiliation='outcast'
  3100. jid='earlofcambridge@shakespeare.lit/stabber'
  3101. role='none'/>
  3102. <status code='301'/>
  3103. </x>
  3104. </presence>
  3105. [ ... ]
  3106. ]]></example>
  3107. <p>As with <link url='#kick'>Kicking an Occupant</link>, a user cannot be banned by an admin with a lower affiliation. Therefore, if an admin attempts to ban an owner, the service MUST deny the request and return a &notallowed; error to the sender:</p>
  3108. <example caption='Service Returns Error on Attempt to Ban User With Higher Affiliation'><![CDATA[
  3109. <iq from='kinghenryv@shakespeare.lit/throne'
  3110. id='ban1'
  3111. to='southampton@chat.shakespeare.lit'
  3112. type='set'>
  3113. <error type='cancel'>
  3114. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3115. </error>
  3116. </iq>
  3117. ]]></example>
  3118. <p>If an admin or owner attempts to ban himself, the service MUST deny the request and return a &conflict; error to the sender. (Note: This is different from the recommended service behavior on kicking oneself.)</p>
  3119. </section2>
  3120. <section2 topic='Modifying the Ban List' anchor='modifyban'>
  3121. <p>A room admin might want to modify the ban list. (Note: The ban list is always based on a user's bare JID.) To modify the list of banned JIDs, the admin first requests the ban list by querying the room for all users with an affiliation of 'outcast'.</p>
  3122. <example caption='Admin Requests Ban List'><![CDATA[
  3123. <iq from='kinghenryv@shakespeare.lit/throne'
  3124. id='ban2'
  3125. to='southampton@chat.shakespeare.lit'
  3126. type='get'>
  3127. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3128. <item affiliation='outcast'/>
  3129. </query>
  3130. </iq>
  3131. ]]></example>
  3132. <p>The service MUST then return the list of banned users to the admin; each item MUST include the 'affiliation' and 'jid' attributes but SHOULD NOT include the 'nick' and 'role' attributes:</p>
  3133. <example caption='Service Sends Ban List to Admin'><![CDATA[
  3134. <iq from='southampton@chat.shakespeare.lit'
  3135. id='ban2'
  3136. to='kinghenryv@shakespeare.lit/throne'
  3137. type='result'>
  3138. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3139. <item affiliation='outcast'
  3140. jid='earlofcambridge@shakespeare.lit'>
  3141. <reason>Treason</reason>
  3142. </item>
  3143. </query>
  3144. </iq>
  3145. ]]></example>
  3146. <p>The admin can then modify the ban list if desired. In order to do so, the admin MUST send the changed items (i.e., only the "delta") back to the service; each item MUST include the 'affiliation' attribute (normally set to a value of "outcast" to ban or "none" to remove ban) and 'jid' attribute but SHOULD NOT include the 'nick' attribute and MUST NOT include the 'role' attribute (which is used to manage roles such as participant rather than affiliations such as outcast); in addition, the reason and actor elements are OPTIONAL:</p>
  3147. <example caption='Admin Sends Modified Ban List to Service'><![CDATA[
  3148. <iq from='kinghenryv@shakespeare.lit/throne'
  3149. id='ban3'
  3150. to='southampton@chat.shakespeare.lit'
  3151. type='set'>
  3152. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3153. <item affiliation='outcast'
  3154. jid='lordscroop@shakespeare.lit'>
  3155. <reason>Treason</reason>
  3156. </item>
  3157. <item affiliation='outcast'
  3158. jid='sirthomasgrey@shakespeare.lit'>
  3159. <reason>Treason</reason>
  3160. </item>
  3161. </query>
  3162. </iq>
  3163. ]]></example>
  3164. <p>After updating the ban list, the service MUST inform the admin of success:</p>
  3165. <example caption='Service Informs Admin of Success'><![CDATA[
  3166. <iq from='southampton@chat.shakespeare.lit'
  3167. id='ban3'
  3168. to='kinghenryv@shakespeare.lit/throne'
  3169. type='result'/>
  3170. ]]></example>
  3171. <p>The service MUST then remove the affected occupants (if they are in the room) and send updated presence (including the appropriate status code) from them to all the remaining occupants as described in the "Banning a User" use case. (The service MUST also remove each banned user's reserved nickname from the list of reserved roomnicks, if appropriate.)</p>
  3172. <p>When an entity is banned from a room, an implementation SHOULD match JIDs in the following order (these matching rules are the same as those defined for privacy lists in &xep0016;):</p>
  3173. <ol start='1'>
  3174. <li>&lt;user@domain/resource&gt; (only that resource matches)</li>
  3175. <li>&lt;user@domain&gt; (any resource matches)</li>
  3176. <li>&lt;domain/resource&gt; (only that resource matches)</li>
  3177. <li>&lt;domain&gt; (the domain itself matches, as does any user@domain or domain/resource)</li>
  3178. </ol>
  3179. <p>Some administrators might wish to ban all users associated with a specific domain from all rooms hosted by a MUC service. Such functionality is a service-level feature and is therefore out of scope for this document; see <cite>XEP-0133</cite>.</p>
  3180. </section2>
  3181. <section2 topic='Granting Membership' anchor='grantmember'>
  3182. <p>An admin can grant membership to a user; this is done by changing the affiliation for the user's bare JID to "member" (if a nick is provided, that nick becomes the user's default nick in the room if that functionality is supported by the implementation):</p>
  3183. <example caption='Admin Grants Membership'><![CDATA[
  3184. <iq from='crone1@shakespeare.lit/desktop'
  3185. id='member1'
  3186. to='coven@chat.shakespeare.lit'
  3187. type='set'>
  3188. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3189. <item affiliation='member'
  3190. jid='hag66@shakespeare.lit'
  3191. nick='thirdwitch'/>
  3192. </query>
  3193. </iq>
  3194. ]]></example>
  3195. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  3196. <example caption='Admin Grants Membership (With a Reason)'><![CDATA[
  3197. <iq from='crone1@shakespeare.lit/desktop'
  3198. id='member1'
  3199. to='coven@chat.shakespeare.lit'
  3200. type='set'>
  3201. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3202. <item affiliation='member'
  3203. jid='hag66@shakespeare.lit'
  3204. nick='thirdwitch'>
  3205. <reason>A worthy witch indeed!</reason>
  3206. </item>
  3207. </query>
  3208. </iq>
  3209. ]]></example>
  3210. <p>The service MUST add the user to the member list and then inform the admin of success:</p>
  3211. <example caption='Service Informs Admin of Success'><![CDATA[
  3212. <iq from='coven@chat.shakespeare.lit'
  3213. id='member1'
  3214. to='crone1@shakespeare.lit/desktop'
  3215. type='result'/>
  3216. ]]></example>
  3217. <p>If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the granting of membership by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "member".</p>
  3218. <example caption="Service Sends Notice of Membership to All Occupants"><![CDATA[
  3219. <presence
  3220. from='coven@chat.shakespeare.lit/thirdwitch'
  3221. to='crone1@shakespeare.lit/desktop'>
  3222. <x xmlns='http://jabber.org/protocol/muc#user'>
  3223. <item affiliation='member'
  3224. jid='hag66@shakespeare.lit/pda'
  3225. role='participant'
  3226. nick='thirdwitch'/>
  3227. </x>
  3228. </presence>
  3229. [ ... ]
  3230. ]]></example>
  3231. </section2>
  3232. <section2 topic='Revoking Membership' anchor='revokemember'>
  3233. <p>An admin might want to revoke a user's membership; this is done by changing the user's affiliation to "none":</p>
  3234. <example caption='Admin Revokes Membership'><![CDATA[
  3235. <iq from='crone1@shakespeare.lit/desktop'
  3236. id='member2'
  3237. to='coven@chat.shakespeare.lit'
  3238. type='set'>
  3239. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3240. <item affiliation='none'
  3241. jid='hag66@shakespeare.lit'/>
  3242. </query>
  3243. </iq>
  3244. ]]></example>
  3245. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  3246. <example caption='Admin Revokes Membership (With a Reason)'><![CDATA[
  3247. <iq from='crone1@shakespeare.lit/desktop'
  3248. id='member2'
  3249. to='coven@chat.shakespeare.lit'
  3250. type='set'>
  3251. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3252. <item affiliation='none'
  3253. jid='hag66@shakespeare.lit'>
  3254. <reason>Not so worthy after all!</reason>
  3255. </item>
  3256. </query>
  3257. </iq>
  3258. ]]></example>
  3259. <p>The service MUST remove the user from the member list and then inform the moderator of success:</p>
  3260. <example caption='Service Informs Moderator of Success'><![CDATA[
  3261. <iq from='coven@chat.shakespeare.lit'
  3262. id='member2'
  3263. to='crone1@shakespeare.lit/desktop'
  3264. type='result'/>
  3265. ]]></example>
  3266. <p>The service MUST then send updated presence from this individual to all occupants, indicating the loss of membership by sending a presence element that contains an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "none".</p>
  3267. <example caption="Service Notes Loss of Membership"><![CDATA[
  3268. <presence
  3269. from='coven@chat.shakespeare.lit/thirdwitch'
  3270. to='crone1@shakespeare.lit/desktop'>
  3271. <x xmlns='http://jabber.org/protocol/muc#user'>
  3272. <item affiliation='none'
  3273. jid='hag66@shakespeare.lit/pda'
  3274. role='participant'/>
  3275. </x>
  3276. </presence>
  3277. [ ... ]
  3278. ]]></example>
  3279. <p>If the room is members-only, the service MUST remove the user from the room, including a status code of 321 to indicate that the user was removed because of an affiliation change, and inform all remaining occupants:</p>
  3280. <example caption='Service Removes Non-Member'><![CDATA[
  3281. <presence
  3282. from='coven@chat.shakespeare.lit/thirdwitch'
  3283. to='crone1@shakespeare.lit/desktop'>
  3284. type='unavailable'>
  3285. <x xmlns='http://jabber.org/protocol/muc#user'>
  3286. <item affiliation='none' role='none'>
  3287. <actor nick='TheBard'/>
  3288. </item>
  3289. <status code='321'/>
  3290. </x>
  3291. </presence>
  3292. <presence
  3293. from='coven@chat.shakespeare.lit/thirdwitch'
  3294. to='crone1@shakespeare.lit/desktop'>
  3295. type='unavailable'>
  3296. <x xmlns='http://jabber.org/protocol/muc#user'>
  3297. <item affiliation='none' role='none'/>
  3298. <status code='321'/>
  3299. </x>
  3300. </presence>
  3301. [ ... ]
  3302. ]]></example>
  3303. </section2>
  3304. <section2 topic='Modifying the Member List' anchor='modifymember'>
  3305. <p>In the context of a members-only room, the member list is essentially a "whitelist" of people who are allowed to enter the room. Anyone who is not a member is effectively banned from entering the room, even if their affiliation is not "outcast".</p>
  3306. <p>In the context of an open room, the member list is simply a list of users (bare JID and reserved nick) who are registered with the room. Such users can appear in a room roster, have their room nickname reserved, be returned in search results or FAQ queries, and the like.</p>
  3307. <p>It is RECOMMENDED that only room admins have the privilege to modify the member list in members-only rooms. To do so, the admin first requests the member list by querying the room for all users with an affiliation of "member":</p>
  3308. <example caption='Admin Requests Member List'><![CDATA[
  3309. <iq from='crone1@shakespeare.lit/desktop'
  3310. id='member3'
  3311. to='coven@chat.shakespeare.lit'
  3312. type='get'>
  3313. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3314. <item affiliation='member'/>
  3315. </query>
  3316. </iq>
  3317. ]]></example>
  3318. <p>Note: A service SHOULD also return the member list to any occupant in a members-only room; i.e., it SHOULD NOT generate a &forbidden; error when a member in the room requests the member list. This functionality can assist clients in showing all the existing members even if some of them are not in the room, e.g. to help a member determine if another user should be invited. A service SHOULD also allow any member to retrieve the member list even if not yet an occupant.</p>
  3319. <p>The service MUST then return the full member list to the admin qualified by the 'http://jabber.org/protocol/muc#admin' namespace; each item MUST include the 'affiliation' and 'jid' attributes and MAY include the 'nick' and 'role' attributes for each member that is currently an occupant.</p>
  3320. <example caption='Service Sends Member List to Admin'><![CDATA[
  3321. <iq from='coven@chat.shakespeare.lit'
  3322. id='member3'
  3323. to='crone1@shakespeare.lit/desktop'
  3324. type='result'>
  3325. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3326. <item affiliation='member'
  3327. jid='hag66@shakespeare.lit'
  3328. nick='thirdwitch'
  3329. role='participant'/>
  3330. </query>
  3331. </iq>
  3332. ]]></example>
  3333. <p>The admin can then modify the member list if desired. In order to do so, the admin MUST send the changed items (i.e., only the "delta") to the service; each item MUST include the 'affiliation' attribute (normally set to a value of "member" or "none") and 'jid' attribute but SHOULD NOT include the 'nick' attribute (unless modifying the user's reserved nickname) and MUST NOT include the 'role' attribute (which is used to manage roles such as participant rather than affiliations such as member):</p>
  3334. <example caption='Admin Sends Modified Member List to Service'><![CDATA[
  3335. <iq from='crone1@shakespeare.lit/desktop'
  3336. id='member4'
  3337. to='coven@chat.shakespeare.lit'
  3338. type='set'>
  3339. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3340. <item affiliation='none'
  3341. jid='hag66@shakespeare.lit'/>
  3342. <item affiliation='member'
  3343. jid='hecate@shakespeare.lit'/>
  3344. </query>
  3345. </iq>
  3346. ]]></example>
  3347. <p>The service MUST modify the member list and then inform the moderator of success:</p>
  3348. <example caption='Service Informs Moderator of Success'><![CDATA[
  3349. <iq from='coven@chat.shakespeare.lit'
  3350. id='member4'
  3351. to='crone1@shakespeare.lit/desktop'
  3352. type='result'/>
  3353. ]]></example>
  3354. <p>The service MUST change the affiliation of any affected user. If the user has been removed from the member list, the service MUST change the user's affiliation from "member" to "none". If the user has been added to the member list, the service MUST change the user's affiliation to "member".</p>
  3355. <p>If a removed member is currently in a members-only room, the service SHOULD kick the occupant by changing the removed member's role to "none" and send appropriate presence to the removed member as previously described. The service MUST subsequently refuse entry to the user.</p>
  3356. <p>For all room types, the service MUST send updated presence from this individual to all occupants, indicating the change in affiliation by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "none".</p>
  3357. <example caption="Service Sends Notice of Loss of Membership to All Occupants"><![CDATA[
  3358. <presence
  3359. from='coven@chat.shakespeare.lit/thirdwitch'
  3360. to='crone1@shakespeare.lit/desktop'>
  3361. <x xmlns='http://jabber.org/protocol/muc#user'>
  3362. <item affiliation='none'
  3363. jid='hag66@shakespeare.lit/pda'
  3364. role='participant'/>
  3365. </x>
  3366. </presence>
  3367. [ ... ]
  3368. ]]></example>
  3369. <p>In addition, the service SHOULD send an invitation to any user who has been added to the member list of a members-only room if the user is not currently affiliated with the room (note that the following example includes a password but not a reason -- both child elements are OPTIONAL):</p>
  3370. <example caption='Room Sends Invitation to New Member'><![CDATA[
  3371. <message
  3372. from='coven@chat.shakespeare.lit'
  3373. id='CA409450-5AAE-41C1-AAAD-5375CA738885'
  3374. to='hecate@shakespeare.lit'>
  3375. <x xmlns='http://jabber.org/protocol/muc#user'>
  3376. <invite from='bard@shakespeare.lit'/>
  3377. <password>cauldronburn</password>
  3378. </x>
  3379. </message>
  3380. ]]></example>
  3381. <p>Although only admins and owners SHOULD be allowed to modify the member list, an implementation MAY provide a configuration option that opens invitation privileges to any member of a members-only room. In such a situation, any invitation sent SHOULD automatically trigger the addition of the invitee to the member list. However, if invitation privileges are restricted to admins and a mere member attempts to a send an invitation, the service MUST deny the invitation request and return a &forbidden; error to the sender:</p>
  3382. <example caption='Service Returns Error on Attempt by Mere Member to Invite Others to a Members-Only Room'><![CDATA[
  3383. <message
  3384. from='coven@chat.shakespeare.lit'
  3385. id='C6E14DF6-00B7-4729-BC1C-94E59C07548E'
  3386. to='hag66@shakespeare.lit/pda'
  3387. type='error'>
  3388. <x xmlns='http://jabber.org/protocol/muc#user'>
  3389. <invite to='hecate@shakespeare.lit'>
  3390. <reason>
  3391. Hey Hecate, this is the place for all good witches!
  3392. </reason>
  3393. </invite>
  3394. </x>
  3395. <error type='auth'>
  3396. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3397. </error>
  3398. </message>
  3399. ]]></example>
  3400. <p>Invitations sent through an open room MUST NOT trigger the addition of the invitee to the member list.</p>
  3401. <p>If a user is added to the member list of an open room and the user is in the room, the service MUST send updated presence from this individual to all occupants, indicating the change in affiliation by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "member".</p>
  3402. <example caption="Service Sends Notice of Membership to All Occupants"><![CDATA[
  3403. <presence
  3404. from='coven@chat.shakespeare.lit/hecate'
  3405. to='crone1@shakespeare.lit/desktop'>
  3406. <x xmlns='http://jabber.org/protocol/muc#user'>
  3407. <item affiliation='member'
  3408. jid='hecate@shakespeare.lit/broom'
  3409. role='participant'/>
  3410. </x>
  3411. </presence>
  3412. [ ... ]
  3413. ]]></example>
  3414. </section2>
  3415. <section2 topic='Granting Moderator Status' anchor='grantmod'>
  3416. <p>An admin might want to grant moderator status to a participant or visitor; this is done by changing the user's role to "moderator":</p>
  3417. <example caption='Admin Grants Moderator Status'><![CDATA[
  3418. <iq from='crone1@shakespeare.lit/desktop'
  3419. id='mod1'
  3420. to='coven@chat.shakespeare.lit'
  3421. type='set'>
  3422. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3423. <item nick='thirdwitch'
  3424. role='moderator'/>
  3425. </query>
  3426. </iq>
  3427. ]]></example>
  3428. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  3429. <example caption='Admin Grants Moderator Status (With a Reason)'><![CDATA[
  3430. <iq from='crone1@shakespeare.lit/desktop'
  3431. id='mod1'
  3432. to='coven@chat.shakespeare.lit'
  3433. type='set'>
  3434. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3435. <item nick='thirdwitch'
  3436. role='moderator'>
  3437. <reason>A worthy witch indeed!</reason>
  3438. </item>
  3439. </query>
  3440. </iq>
  3441. ]]></example>
  3442. <p>The service MUST add the user to the moderator list and then inform the admin of success:</p>
  3443. <example caption='Service Informs Admin of Success'><![CDATA[
  3444. <iq from='coven@chat.shakespeare.lit'
  3445. id='mod1'
  3446. to='crone1@shakespeare.lit/desktop'
  3447. type='result'/>
  3448. ]]></example>
  3449. <p>The service MUST then send updated presence from this individual to all occupants, indicating the addition of moderator status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'role' attribute set to a value of "moderator".</p>
  3450. <example caption="Service Sends Notice of Moderator Status to All Occupants"><![CDATA[
  3451. <presence
  3452. from='coven@chat.shakespeare.lit/thirdwitch'
  3453. to='crone1@shakespeare.lit/desktop'>
  3454. <x xmlns='http://jabber.org/protocol/muc#user'>
  3455. <item affiliation='member'
  3456. jid='hag66@shakespeare.lit/pda'
  3457. role='moderator'/>
  3458. </x>
  3459. </presence>
  3460. [ ... ]
  3461. ]]></example>
  3462. </section2>
  3463. <section2 topic='Revoking Moderator Status' anchor='revokemod'>
  3464. <p>An admin might want to revoke a user's moderator status. An admin MAY revoke moderator status only from a user whose affiliation is "member" or "none" (i.e., not from an owner or admin). The status is revoked by changing the user's role to "participant":</p>
  3465. <example caption='Admin Revokes Moderator Status'><![CDATA[
  3466. <iq from='crone1@shakespeare.lit/desktop'
  3467. id='mod2'
  3468. to='coven@chat.shakespeare.lit'
  3469. type='set'>
  3470. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3471. <item nick='thirdwitch'
  3472. role='participant'/>
  3473. </query>
  3474. </iq>
  3475. ]]></example>
  3476. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  3477. <example caption='Admin Revokes Moderator Status (With a Reason)'><![CDATA[
  3478. <iq from='crone1@shakespeare.lit/desktop'
  3479. id='mod2'
  3480. to='coven@chat.shakespeare.lit'
  3481. type='set'>
  3482. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3483. <item nick='thirdwitch'
  3484. role='participant'>
  3485. <reason>Not so worthy after all!</reason>
  3486. </item>
  3487. </query>
  3488. </iq>
  3489. ]]></example>
  3490. <p>The service MUST remove the user from the moderator list and then inform the admin of success:</p>
  3491. <example caption='Service Informs Admin of Success'><![CDATA[
  3492. <iq from='coven@chat.shakespeare.lit'
  3493. id='mod2'
  3494. to='crone1@shakespeare.lit/desktop'
  3495. type='result'/>
  3496. ]]></example>
  3497. <p>The service MUST then send updated presence from this individual to all occupants, indicating the removal of moderator status by sending a presence element that contains an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'role' attribute set to a value of "participant".</p>
  3498. <example caption="Service Notes Loss of Moderator Status"><![CDATA[
  3499. <presence
  3500. from='coven@chat.shakespeare.lit/thirdwitch'
  3501. to='crone1@shakespeare.lit/desktop'>
  3502. <x xmlns='http://jabber.org/protocol/muc#user'>
  3503. <item affiliation='member'
  3504. jid='hag66@shakespeare.lit/pda'
  3505. role='participant'/>
  3506. </x>
  3507. </presence>
  3508. [ ... ]
  3509. ]]></example>
  3510. <p>As noted, an admin MUST NOT be allowed to revoke moderator status from a user whose affiliation is "owner" or "admin". If an admin attempts to revoke moderator status from such a user, the service MUST deny the request and return a &notallowed; error to the sender:</p>
  3511. <example caption='Service Returns Error on Attempt to Revoke Moderator Status from an Admin or Owner'><![CDATA[
  3512. <iq from='coven@chat.shakespeare.lit'
  3513. id='modtest'
  3514. to='crone1@shakespeare.lit/desktop'
  3515. type='error'>
  3516. <error type='cancel'>
  3517. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3518. </error>
  3519. </iq>
  3520. ]]></example>
  3521. </section2>
  3522. <section2 topic='Modifying the Moderator List' anchor='modifymod'>
  3523. <p>An admin might want to modify the moderator list. To do so, the admin first requests the moderator list by querying the room for all users with a role of 'moderator'.</p>
  3524. <example caption='Admin Requests Moderator List'><![CDATA[
  3525. <iq from='crone1@shakespeare.lit/desktop'
  3526. id='mod3'
  3527. to='coven@chat.shakespeare.lit'
  3528. type='get'>
  3529. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3530. <item role='moderator'/>
  3531. </query>
  3532. </iq>
  3533. ]]></example>
  3534. <p>The service MUST then return the moderator list to the admin; each item MUST include the 'nick' and 'role' attributes, and MAY include the 'jid' and 'affiliation' attributes:</p>
  3535. <example caption='Service Sends Moderator List to Admin'><![CDATA[
  3536. <iq from='coven@chat.shakespeare.lit'
  3537. id='mod3'
  3538. to='crone1@shakespeare.lit/desktop'
  3539. type='result'>
  3540. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3541. <item affiliation='member'
  3542. jid='hag66@shakespeare.lit/pda'
  3543. nick='thirdwitch'
  3544. role='moderator'/>
  3545. </query>
  3546. </iq>
  3547. ]]></example>
  3548. <p>The admin can then modify the moderator list if desired. In order to do so, the admin MUST send the changed items (i.e., only the "delta") back to the service; each item MUST include the 'nick' attribute and 'role' attribute (set to a value of "moderator" to grant moderator status or "participant" to revoke moderator status), but SHOULD NOT include the 'jid' attribute and MUST NOT include the 'affiliation' attribute (which is used to manage affiliations such as admin rather than the moderator role):</p>
  3549. <example caption='Admin Sends Modified Moderator List to Service'><![CDATA[
  3550. <iq from='crone1@shakespeare.lit/desktop'
  3551. id='mod4'
  3552. to='coven@chat.shakespeare.lit'
  3553. type='set'>
  3554. <query xmlns='http://jabber.org/protocol/muc#admin'>
  3555. <item nick='thirdwitch'
  3556. role='participant'/>
  3557. <item nick='Hecate'
  3558. role='moderator'/>
  3559. </query>
  3560. </iq>
  3561. ]]></example>
  3562. <p>The service MUST modify the moderator list and then inform the admin of success:</p>
  3563. <example caption='Service Informs Admin of Success'><![CDATA[
  3564. <iq from='coven@chat.shakespeare.lit'
  3565. id='mod4'
  3566. to='crone1@shakespeare.lit/desktop'
  3567. type='result'/>
  3568. ]]></example>
  3569. <p>The service MUST then send updated presence for any affected individuals to all occupants, indicating the change in moderator status by sending the appropriate extended presence stanzas as described in the foregoing use cases.</p>
  3570. <p>As noted, moderator status cannot be revoked from a room owner or room admin. If a room admin attempts to revoke moderator status from such a user by modifying the moderator list, the service MUST deny the request and return a &notallowed; error to the sender:</p>
  3571. <example caption='Service Returns Error on Attempt to Revoke Moderator Status from an Admin or Owner'><![CDATA[
  3572. <iq from='coven@chat.shakespeare.lit'
  3573. id='modtest'
  3574. to='hag66@shakespeare.lit/pda'
  3575. type='error'>
  3576. <error type='cancel'>
  3577. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3578. </error>
  3579. </iq>
  3580. ]]></example>
  3581. </section2>
  3582. <section2 topic='Approving Registration Requests' anchor='regapprove'>
  3583. <p>If a service does not automatically accept requests to register with a room, it MAY provide a way for room admins to approve or deny registration requests over XMPP (alternatively, it could provide a web interface or some other admin tool). The simplest way to do so is for the service to send a &MESSAGE; stanza to the room admin(s) when the registration request is received, where the &MESSAGE; stanza contains a Data Form asking for approval or denial of the request. The following Data Form is RECOMMENDED but implementations might use a different form entirely, or supplement the following form with additional fields.</p>
  3584. <example caption='Registration Request Approval Form'><![CDATA[
  3585. <message from='coven@chat.shakespeare.lit'
  3586. id='407665A9-E54E-4AD5-905F-9FD8864489B3'
  3587. to='crone1@shakespeare.lit/pda'>
  3588. <x xmlns='jabber:x:data' type='form'>
  3589. <title>Registration request</title>
  3590. <instructions>
  3591. To approve this registration request, select the
  3592. &quot;Allow this person to register with the room?&quot;
  3593. checkbox and click OK. To skip this request, click the
  3594. cancel button.
  3595. </instructions>
  3596. <field var='FORM_TYPE' type='hidden'>
  3597. <value>http://jabber.org/protocol/muc#register</value>
  3598. </field>
  3599. <field var='muc#register_first'
  3600. type='text-single'
  3601. label='Given Name'>
  3602. <value>Brunhilde</value>
  3603. </field>
  3604. <field var='muc#register_last'
  3605. type="text-single"
  3606. label="Family Name">
  3607. <value>Entwhistle-Throckmorton</value>
  3608. </field>
  3609. <field var='muc#register_roomnick'
  3610. type="text-single"
  3611. label="Desired Nickname">
  3612. <value>thirdwitch</value>
  3613. </field>
  3614. <field var='muc#register_url'
  3615. type="text-single"
  3616. label="User URL">
  3617. <value>http://witchesonline/~hag66/</value>
  3618. </field>
  3619. <field var='muc#register_email'
  3620. type="text-single"
  3621. label="Email Address">
  3622. <value>hag66@witchesonline</value>
  3623. </field>
  3624. <field var='muc#register_faqentry'
  3625. type="text-multi"
  3626. label="FAQ Entry">
  3627. <value>Just another witch.</value>
  3628. </field>
  3629. <field var='muc#register_allow'
  3630. type='boolean'
  3631. label='Allow this person to register with the room?'>
  3632. <value>0</value>
  3633. </field>
  3634. </x>
  3635. </message>
  3636. ]]></example>
  3637. <p>If the admin approves the registration request, the service shall register the user with the room.</p>
  3638. <p>More advanced registration approval mechanisms (e.g., retrieving a list of registration requests using &xep0050; as is done in &xep0060;) are out of scope for this document.</p>
  3639. </section2>
  3640. </section1>
  3641. <section1 topic='Owner Use Cases' anchor='owner'>
  3642. <p>Every room MUST have at least one owner, and that owner (or a successor) is a long-lived attribute of the room for as long as the room exists (e.g., the owner does not lose ownership on exiting a persistent room). This document assumes that the (initial) room owner is the individual who creates the room and that only a room owner has the right to change defining room configuration settings such as the room type. Room owners can specify not only the room types (password-protected, members-only, etc.) but also certain attributes of the room as listed in the <link url='#reqs'>Requirements</link> section of this document. In addition, an owner can also specify the JIDs of other owners, if supported by the implementation.</p>
  3643. <p>In order to provide the necessary flexibility for a wide range of configuration options, Data Forms (<cite>XEP-0004</cite>) are used for room configuration, triggered by use of the 'http://jabber.org/protocol/muc' namespace. If an entity does not include the MUC namespace in its room join/create request, then the service shall create the room and not wait for configuration via Data Forms before creating the room (this ensures backwards-compatibility with the old groupchat 1.0 protocol); however, if the room join/create request includes the MUC extension, then the service shall require configuration via Data Forms before creating and unlocking the room.</p>
  3644. <p>Note: The configuration options shown below address all of the features and room types listed in the requirements section of this document; however, the exact configuration options and form layout shall be determined by the implementation or specific deployment. Also, these are examples only and are not intended to define the only allowed or required configuration options for rooms. A given implementation or deployment MAY choose to provide additional configuration options (clearance levels, profanity filters, supported languages, message logging, etc.), which is why the use of the 'jabber:x:data' protocol is valuable here.</p>
  3645. <section2 topic='Creating a Room' anchor='createroom'>
  3646. <section3 topic='General Considerations' anchor='createroom-general'>
  3647. <p>The privilege to create rooms MAY be restricted to certain users or MAY be reserved to an administrator of the service. If access is restricted and a user attempts to create a room, the service MUST return a &notallowed; error:</p>
  3648. <example caption='Service Informs User of Inability to Create a Room'><![CDATA[
  3649. <presence
  3650. from='coven@chat.shakespeare.lit/thirdwitch'
  3651. to='hag66@shakespeare.lit/pda'
  3652. type='error'>
  3653. <x xmlns='http://jabber.org/protocol/muc'/>
  3654. <error by='coven@chat.shakespeare.lit' type='cancel'>
  3655. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  3656. </error>
  3657. </presence>
  3658. ]]></example>
  3659. <p>If access is not restricted, the service MUST allow the user to create a room as described below.</p>
  3660. <p>From the perspective of room creation, there are in essence two kinds of rooms:</p>
  3661. <ul>
  3662. <li><p>"Instant rooms" -- these are available for immediate access and are automatically created based on some default configuration.</p></li>
  3663. <li><p>"Reserved rooms" -- these are manually configured by the room creator before anyone is allowed to enter.</p></li>
  3664. </ul>
  3665. <p>The workflow for creating and configuring such rooms is as follows:</p>
  3666. <ol start='1'>
  3667. <li><p>The user sends presence to &OCCUPANTJID; and signal his or her support for the Multi-User Chat protocol by including extended presence information in an empty &lt;x/&gt; child element qualified by the 'http://jabber.org/protocol/muc' namespace (note the lack of an '#owner' or '#user' fragment).</p></li>
  3668. <li><p>If this user is allowed to create a room and the room does not yet exist, the service MUST create the room according to some default configuration, assign the requesting user as the initial room owner, and add the owner to the room but not allow anyone else to enter the room (effectively "locking" the room). The initial presence stanza received by the owner from the room MUST include extended presence information indicating the user's status as an owner and acknowledging that the room has been created (via status code 201) and is awaiting configuration.</p></li>
  3669. <li><p>If the initial room owner would like to create and configure a reserved room, the room owner MUST then request a configuration form by sending an IQ stanza of type "get" to the room containing an empty &lt;query/&gt; element qualified by the 'http://jabber.org/protocol/muc#owner' namespace, then complete Steps 4 and 5. If the room owner would prefer to create an instant room, the room owner MUST send a query element qualified by the 'http://jabber.org/protocol/muc#owner' namespace and containing an empty &lt;x/&gt; element of type "submit" qualified by the 'jabber:x:data' namespace, then skip to Step 6.</p></li>
  3670. <li><p>If the room owner requested a configuration form, the service MUST send an IQ result to the room owner containing a configuration form qualified by the 'jabber:x:data' namespace. If there are no configuration options available, the room MUST return an empty query element to the room owner.</p></li>
  3671. <li><p>The initial room owner SHOULD provide a starting configuration for the room (or accept the default configuration) by sending an IQ set containing the completed configuration form. Alternatively, the room owner MAY cancel the configuration process. (An implementation MAY set a timeout for initial configuration, such that if the room owner does not configure the room within the timeout period, the room owner is assumed to have accepted the default configuration or to have cancelled the configuration process.)</p></li>
  3672. <li><p>Once the service receives the completed configuration form from the initial room owner (or receives a request for an instant room), the service MUST "unlock" the room (i.e., allow other users to enter the room) and send an IQ of type "result" to the room owner. If the service receives a cancellation, it MUST destroy the room.</p></li>
  3673. </ol>
  3674. <p>The protocol for this workflow is shown in the examples below.</p>
  3675. <p>First, the user MUST send presence to the room, including an empty &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc' namespace (this is the same stanza sent when seeking to enter a room).</p>
  3676. <example caption='User Creates a Room and Signals Support for Multi-User Chat'><![CDATA[
  3677. <presence
  3678. from='crone1@shakespeare.lit/desktop'
  3679. to='coven@chat.shakespeare.lit/firstwitch'>
  3680. <x xmlns='http://jabber.org/protocol/muc'/>
  3681. </presence>
  3682. ]]></example>
  3683. <p>If the room does not yet exist, the service SHOULD create the room (subject to local policies regarding room creation), assign the bare JID of the requesting user as the owner, add the owner to the room, and acknowledge successful creation of the room by sending a presence stanza of the following form:</p>
  3684. <example caption="Service Acknowledges Room Creation"><![CDATA[
  3685. <presence
  3686. from='coven@chat.shakespeare.lit/firstwitch'
  3687. to='crone1@shakespeare.lit/desktop'>
  3688. <x xmlns='http://jabber.org/protocol/muc#user'>
  3689. <item affiliation='owner'
  3690. role='moderator'/>
  3691. <status code='110'/>
  3692. <status code='201'/>
  3693. </x>
  3694. </presence>
  3695. ]]></example>
  3696. <p>After receiving notification that the room has been created, the room owner needs to decide whether to accept the default room configuration (i.e., create an "instant room") or configure the room to use something other than the default room configuration (i.e., create a "reserved room"). The protocol flows for completing those two use cases are shown in the following sections.</p>
  3697. <p>Note: If the presence stanza sent to a nonexistent room does not include an &X; element qualified by the 'http://jabber.org/protocol/muc' namespace as shown above, the service SHOULD create a default room without delay (i.e., it MUST assume that the client supports groupchat 1.0 rather than MUC and therefore it MUST NOT lock the room while waiting for the room creator to either accept an instant room or configure a reserved room).</p>
  3698. </section3>
  3699. <section3 topic='Creating an Instant Room' anchor='createroom-instant'>
  3700. <p>If the initial room owner wants to accept the default room configuration (i.e., create an "instant room"), the room owner MUST decline an initial configuration form by sending an IQ set to the &ROOMJID; itself containing a &QUERY; element qualified by the 'http://jabber.org/protocol/muc#owner' namespace, where the only child of the &QUERY; is an empty &X; element that is qualified by the 'jabber:x:data' namespace and that possesses a 'type' attribute whose value is "submit":</p>
  3701. <example caption='Owner Requests Instant Room'><![CDATA[
  3702. <iq from='crone1@shakespeare.lit/desktop'
  3703. id='create1'
  3704. to='coven@chat.shakespeare.lit'
  3705. type='set'>
  3706. <query xmlns='http://jabber.org/protocol/muc#owner'>
  3707. <x xmlns='jabber:x:data' type='submit'/>
  3708. </query>
  3709. </iq>
  3710. ]]></example>
  3711. <p>The service MUST then unlock the room and allow other entities to join it.</p>
  3712. </section3>
  3713. <section3 topic='Creating a Reserved Room' anchor='createroom-reserved'>
  3714. <p>If the initial room owner wants to create and configure a reserved room, the room owner MUST request an initial configuration form by sending an IQ get to the &ROOMJID; itself containing an empty &QUERY; element qualified by the 'http://jabber.org/protocol/muc#owner' namespace:</p>
  3715. <example caption='Owner Requests Configuration Form'><![CDATA[
  3716. <iq from='crone1@shakespeare.lit/desktop'
  3717. id='create1'
  3718. to='coven@chat.shakespeare.lit'
  3719. type='get'>
  3720. <query xmlns='http://jabber.org/protocol/muc#owner'/>
  3721. </iq>
  3722. ]]></example>
  3723. <p>If the room does not already exist, the service MUST return an initial room configuration form to the user. (Note: The following example shows a representative sample of configuration options. A full list of x:data fields registered for use in room creation and configuration is maintained by the XMPP Registrar; see the <link url="#registrar">XMPP Registrar Considerations</link> section of this document.)</p>
  3724. <example caption='Service Sends Configuration Form'><![CDATA[
  3725. <iq from='coven@chat.shakespeare.lit'
  3726. id='create1'
  3727. to='crone1@shakespeare.lit/desktop'
  3728. type='result'>
  3729. <query xmlns='http://jabber.org/protocol/muc#owner'>
  3730. <x xmlns='jabber:x:data' type='form'>
  3731. <title>Configuration for "coven" Room</title>
  3732. <instructions>
  3733. Your room coven@macbeth has been created!
  3734. The default configuration is as follows:
  3735. - No logging
  3736. - No moderation
  3737. - Up to 20 occupants
  3738. - No password required
  3739. - No invitation required
  3740. - Room is not persistent
  3741. - Only admins may change the subject
  3742. - Presence broadcasted for all users
  3743. To accept the default configuration, click OK. To
  3744. select a different configuration, please complete
  3745. this form.
  3746. </instructions>
  3747. <field
  3748. type='hidden'
  3749. var='FORM_TYPE'>
  3750. <value>http://jabber.org/protocol/muc#roomconfig</value>
  3751. </field>
  3752. <field
  3753. label='Natural-Language Room Name'
  3754. type='text-single'
  3755. var='muc#roomconfig_roomname'/>
  3756. <field
  3757. label='Short Description of Room'
  3758. type='text-single'
  3759. var='muc#roomconfig_roomdesc'/>
  3760. <field
  3761. label='Natural Language for Room Discussions'
  3762. type='text-single'
  3763. var='muc#roomconfig_lang'/>
  3764. <field
  3765. label='Enable Public Logging?'
  3766. type='boolean'
  3767. var='muc#roomconfig_enablelogging'>
  3768. <value>0</value>
  3769. </field>
  3770. <field
  3771. label='Allow Occupants to Change Subject?'
  3772. type='boolean'
  3773. var='muc#roomconfig_changesubject'>
  3774. <value>0</value>
  3775. </field>
  3776. <field
  3777. label='Allow Occupants to Invite Others?'
  3778. type='boolean'
  3779. var='muc#roomconfig_allowinvites'>
  3780. <value>0</value>
  3781. </field>
  3782. <field
  3783. label='Who Can Send Private Messages?'
  3784. type='list-single'
  3785. var='muc#roomconfig_allowpm'>
  3786. <value>anyone</value>
  3787. <option label='Anyone'>
  3788. <value>anyone</value>
  3789. </option>
  3790. <option label='Anyone with Voice'>
  3791. <value>participants</value>
  3792. </option>
  3793. <option label='Moderators Only'>
  3794. <value>moderators</value>
  3795. </option>
  3796. <option label='Nobody'>
  3797. <value>none</value>
  3798. </option>
  3799. </field>
  3800. <field
  3801. label='Maximum Number of Occupants'
  3802. type='list-single'
  3803. var='muc#roomconfig_maxusers'>
  3804. <value>20</value>
  3805. <option label='10'><value>10</value></option>
  3806. <option label='20'><value>20</value></option>
  3807. <option label='30'><value>30</value></option>
  3808. <option label='50'><value>50</value></option>
  3809. <option label='100'><value>100</value></option>
  3810. <option label='None'><value>none</value></option>
  3811. </field>
  3812. <field
  3813. label='Roles for which Presence is Broadcasted'
  3814. type='list-multi'
  3815. var='muc#roomconfig_presencebroadcast'>
  3816. <value>moderator</value>
  3817. <value>participant</value>
  3818. <value>visitor</value>
  3819. <option label='Moderator'><value>moderator</value></option>
  3820. <option label='Participant'><value>participant</value></option>
  3821. <option label='Visitor'><value>visitor</value></option>
  3822. </field>
  3823. <field
  3824. label='Roles and Affiliations that May Retrieve Member List'
  3825. type='list-multi'
  3826. var='muc#roomconfig_getmemberlist'>
  3827. <value>moderator</value>
  3828. <value>participant</value>
  3829. <value>visitor</value>
  3830. <option label='Moderator'><value>moderator</value></option>
  3831. <option label='Participant'><value>participant</value></option>
  3832. <option label='Visitor'><value>visitor</value></option>
  3833. </field>
  3834. <field
  3835. label='Make Room Publicly Searchable?'
  3836. type='boolean'
  3837. var='muc#roomconfig_publicroom'>
  3838. <value>1</value>
  3839. </field>
  3840. <field
  3841. label='Make Room Persistent?'
  3842. type='boolean'
  3843. var='muc#roomconfig_persistentroom'>
  3844. <value>0</value>
  3845. </field>
  3846. <field
  3847. label='Make Room Moderated?'
  3848. type='boolean'
  3849. var='muc#roomconfig_moderatedroom'>
  3850. <value>0</value>
  3851. </field>
  3852. <field
  3853. label='Make Room Members-Only?'
  3854. type='boolean'
  3855. var='muc#roomconfig_membersonly'>
  3856. <value>0</value>
  3857. </field>
  3858. <field
  3859. label='Password Required to Enter?'
  3860. type='boolean'
  3861. var='muc#roomconfig_passwordprotectedroom'>
  3862. <value>0</value>
  3863. </field>
  3864. <field type='fixed'>
  3865. <value>
  3866. If a password is required to enter this room,
  3867. you must specify the password below.
  3868. </value>
  3869. </field>
  3870. <field
  3871. label='Password'
  3872. type='text-private'
  3873. var='muc#roomconfig_roomsecret'/>
  3874. <field
  3875. label='Who May Discover Real JIDs?'
  3876. type='list-single'
  3877. var='muc#roomconfig_whois'>
  3878. <option label='Moderators Only'>
  3879. <value>moderators</value>
  3880. </option>
  3881. <option label='Anyone'>
  3882. <value>anyone</value>
  3883. </option>
  3884. </field>
  3885. <field
  3886. label='Maximum Number of History Messages Returned by Room'
  3887. type='text-single'
  3888. var='muc#maxhistoryfetch'>
  3889. <value>50</value>
  3890. </field>
  3891. <field type='fixed'>
  3892. <value>
  3893. You may specify additional people who have
  3894. admin status in the room. Please
  3895. provide one Jabber ID per line.
  3896. </value>
  3897. </field>
  3898. <field
  3899. label='Room Admins'
  3900. type='jid-multi'
  3901. var='muc#roomconfig_roomadmins'/>
  3902. <field type='fixed'>
  3903. <value>
  3904. You may specify additional owners for this
  3905. room. Please provide one Jabber ID per line.
  3906. </value>
  3907. </field>
  3908. <field
  3909. label='Room Owners'
  3910. type='jid-multi'
  3911. var='muc#roomconfig_roomowners'/>
  3912. </x>
  3913. </query>
  3914. </iq>
  3915. ]]></example>
  3916. <p>Note: The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"), semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here).</p>
  3917. <p>If there are no configuration options available, the service MUST return an empty query element to the room owner:</p>
  3918. <example caption='Service Informs Owner that No Configuration is Possible'><![CDATA[
  3919. <iq from='coven@chat.shakespeare.lit'
  3920. id='create1'
  3921. to='crone1@shakespeare.lit/desktop'
  3922. type='result'>
  3923. <query xmlns='http://jabber.org/protocol/muc#owner'/>
  3924. </iq>
  3925. ]]></example>
  3926. <p>The room owner SHOULD then fill out the form and submit it to the service.</p>
  3927. <example caption='Owner Submits Configuration Form'><![CDATA[
  3928. <iq from='crone1@shakespeare.lit/desktop'
  3929. id='create2'
  3930. to='coven@chat.shakespeare.lit'
  3931. type='set'>
  3932. <query xmlns='http://jabber.org/protocol/muc#owner'>
  3933. <x xmlns='jabber:x:data' type='submit'>
  3934. <field var='FORM_TYPE'>
  3935. <value>http://jabber.org/protocol/muc#roomconfig</value>
  3936. </field>
  3937. <field var='muc#roomconfig_roomname'>
  3938. <value>A Dark Cave</value>
  3939. </field>
  3940. <field var='muc#roomconfig_roomdesc'>
  3941. <value>The place for all good witches!</value>
  3942. </field>
  3943. <field var='muc#roomconfig_enablelogging'>
  3944. <value>0</value>
  3945. </field>
  3946. <field var='muc#roomconfig_changesubject'>
  3947. <value>1</value>
  3948. </field>
  3949. <field var='muc#roomconfig_allowinvites'>
  3950. <value>0</value>
  3951. </field>
  3952. <field var='muc#roomconfig_allowpm'>
  3953. <value>anyone</value>
  3954. </field>
  3955. <field var='muc#roomconfig_maxusers'>
  3956. <value>10</value>
  3957. </field>
  3958. <field var='muc#roomconfig_publicroom'>
  3959. <value>0</value>
  3960. </field>
  3961. <field var='muc#roomconfig_persistentroom'>
  3962. <value>0</value>
  3963. </field>
  3964. <field var='muc#roomconfig_moderatedroom'>
  3965. <value>0</value>
  3966. </field>
  3967. <field var='muc#roomconfig_membersonly'>
  3968. <value>0</value>
  3969. </field>
  3970. <field var='muc#roomconfig_passwordprotectedroom'>
  3971. <value>1</value>
  3972. </field>
  3973. <field var='muc#roomconfig_roomsecret'>
  3974. <value>cauldronburn</value>
  3975. </field>
  3976. <field var='muc#roomconfig_whois'>
  3977. <value>moderators</value>
  3978. </field>
  3979. <field var='muc#maxhistoryfetch'>
  3980. <value>50</value>
  3981. </field>
  3982. <field var='muc#roomconfig_roomadmins'>
  3983. <value>wiccarocks@shakespeare.lit</value>
  3984. <value>hecate@shakespeare.lit</value>
  3985. </field>
  3986. </x>
  3987. </query>
  3988. </iq>
  3989. ]]></example>
  3990. <p>If room creation is successful, the service MUST inform the new room owner of success:</p>
  3991. <example caption='Service Informs New Room Owner of Success'><![CDATA[
  3992. <iq from='coven@chat.shakespeare.lit'
  3993. id='create2'
  3994. to='crone1@shakespeare.lit/desktop'
  3995. type='result'/>
  3996. ]]></example>
  3997. <p>If the room creation fails because the specified room configuration options violate one or more service policies (e.g., because the password for a password-protected room is blank), the service MUST return a &notacceptable; error.</p>
  3998. <example caption='Service Informs Owner that Requested Configuration Options Are Unacceptable'><![CDATA[
  3999. <iq from='coven@chat.shakespeare.lit'
  4000. id='create2'
  4001. to='crone1@shakespeare.lit/desktop'
  4002. type='error'>
  4003. <error type='modify'>
  4004. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4005. </error>
  4006. </iq>
  4007. ]]></example>
  4008. <p>Alternatively, the room owner MAY cancel the configuration process:</p>
  4009. <example caption='Owner Cancels Initial Configuration'><![CDATA[
  4010. <iq from='crone1@shakespeare.lit/desktop'
  4011. id='create2'
  4012. to='coven@chat.shakespeare.lit'
  4013. type='set'>
  4014. <query xmlns='http://jabber.org/protocol/muc#owner'>
  4015. <x xmlns='jabber:x:data' type='cancel'/>
  4016. </query>
  4017. </iq>
  4018. ]]></example>
  4019. <p>If the room owner cancels the initial configuration, the service MUST destroy the room, making sure to send unavailable presence to the room owner (see the "Destroying a Room" use case for protocol details).</p>
  4020. <p>If the room owner becomes unavailable for any reason before submitting the form (e.g., a lost connection), the service will receive a presence stanza of type "unavailable" from the owner to the owner's &OCCUPANTJID;. The service MUST then destroy the room, sending a presence stanza of type "unavailable" from the room to the owner including a &lt;destroy/&gt; element and reason (if provided) as defined in the <link url='#destroyroom'>Destroying a Room</link> section of this document.</p>
  4021. </section3>
  4022. </section2>
  4023. <section2 topic='Subsequent Room Configuration' anchor='roomconfig'>
  4024. <p>At any time after specifying the initial configuration of the room, a room owner might want to change the configuration. In order to initiate this process, a room owner requests a new configuration form from the room by sending an IQ get to &ROOMJID; containing an empty &lt;query/&gt; element qualified by the 'http://jabber.org/protocol/muc#owner' namespace.</p>
  4025. <example caption='Owner Requests Configuration Form'><![CDATA[
  4026. <iq from='crone1@shakespeare.lit/desktop'
  4027. id='config1'
  4028. to='coven@chat.shakespeare.lit'
  4029. type='get'>
  4030. <query xmlns='http://jabber.org/protocol/muc#owner'/>
  4031. </iq>
  4032. ]]></example>
  4033. <p>If the &lt;user@host&gt; of the 'from' address does not match the bare JID of a room owner, the service MUST return a &forbidden; error to the sender:</p>
  4034. <example caption='Service Denies Configuration Access to Non-Owner'><![CDATA[
  4035. <iq from='coven@chat.shakespeare.lit'
  4036. id='configures'
  4037. to='wiccarocks@shakespeare.lit/laptop'
  4038. type='error'>
  4039. <query xmlns='http://jabber.org/protocol/muc#owner'/>
  4040. <error type='auth'>
  4041. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4042. </error>
  4043. </iq>
  4044. ]]></example>
  4045. <p>Otherwise, the service MUST send a configuration form to the room owner with the current options set as defaults:</p>
  4046. <example caption='Service Sends Configuration Form to Owner'><![CDATA[
  4047. <iq from='coven@chat.shakespeare.lit'
  4048. id='config1'
  4049. to='crone1@shakespeare.lit/desktop'
  4050. type='result'>
  4051. <query xmlns='http://jabber.org/protocol/muc#owner'>
  4052. <x xmlns='jabber:x:data' type='form'>
  4053. <title>Configuration for "coven" Room</title>
  4054. <instructions>
  4055. Complete this form to modify the
  4056. configuration of your room.
  4057. </instructions>
  4058. <field
  4059. type='hidden'
  4060. var='FORM_TYPE'>
  4061. <value>http://jabber.org/protocol/muc#roomconfig</value>
  4062. </field>
  4063. <field
  4064. label='Natural-Language Room Name'
  4065. type='text-single'
  4066. var='muc#roomconfig_roomname'>
  4067. <value>A Dark Cave</value>
  4068. </field>
  4069. <field
  4070. label='Short Description of Room'
  4071. type='text-single'
  4072. var='muc#roomconfig_roomdesc'>
  4073. <value>The place for all good witches!</value>
  4074. </field>
  4075. <field
  4076. label='Enable Public Logging?'
  4077. type='boolean'
  4078. var='muc#roomconfig_enablelogging'>
  4079. <value>0</value>
  4080. </field>
  4081. <field
  4082. label='Allow Occupants to Change Subject?'
  4083. type='boolean'
  4084. var='muc#roomconfig_changesubject'>
  4085. <value>0</value>
  4086. </field>
  4087. <field
  4088. label='Allow Occupants to Invite Others?'
  4089. type='boolean'
  4090. var='muc#roomconfig_allowinvites'>
  4091. <value>0</value>
  4092. </field>
  4093. <field
  4094. label='Who Can Send Private Messages?'
  4095. type='list-single'
  4096. var='muc#roomconfig_allowpm'>
  4097. <value>anyone</value>
  4098. <option label='Anyone'>
  4099. <value>anyone</value>
  4100. </option>
  4101. <option label='Anyone with Voice'>
  4102. <value>participants</value>
  4103. </option>
  4104. <option label='Moderators Only'>
  4105. <value>moderators</value>
  4106. </option>
  4107. <option label='Nobody'>
  4108. <value>none</value>
  4109. </option>
  4110. </field>
  4111. <field
  4112. label='Maximum Number of Occupants'
  4113. type='list-single'
  4114. var='muc#roomconfig_maxusers'>
  4115. <value>10</value>
  4116. <option label='10'><value>10</value></option>
  4117. <option label='20'><value>20</value></option>
  4118. <option label='30'><value>30</value></option>
  4119. <option label='50'><value>50</value></option>
  4120. <option label='100'><value>100</value></option>
  4121. <option label='None'><value>none</value></option>
  4122. </field>
  4123. <field
  4124. label='Roles for which Presence is Broadcasted'
  4125. type='list-multi'
  4126. var='muc#roomconfig_presencebroadcast'>
  4127. <value>moderator</value>
  4128. <value>participant</value>
  4129. <value>visitor</value>
  4130. <option label='Moderator'><value>moderator</value></option>
  4131. <option label='Participant'><value>participant</value></option>
  4132. <option label='Visitor'><value>visitor</value></option>
  4133. </field>
  4134. <field
  4135. label='Roles and Affiliations that May Retrieve Member List'
  4136. type='list-multi'
  4137. var='muc#roomconfig_getmemberlist'>
  4138. <value>moderator</value>
  4139. <value>participant</value>
  4140. <value>visitor</value>
  4141. <option label='Moderator'><value>moderator</value></option>
  4142. <option label='Participant'><value>participant</value></option>
  4143. <option label='Visitor'><value>visitor</value></option>
  4144. </field>
  4145. <field
  4146. label='Make Room Publicly Searchable?'
  4147. type='boolean'
  4148. var='muc#roomconfig_publicroom'>
  4149. <value>0</value>
  4150. </field>
  4151. <field
  4152. label='Make Room Persistent?'
  4153. type='boolean'
  4154. var='muc#roomconfig_persistentroom'>
  4155. <value>0</value>
  4156. </field>
  4157. <field
  4158. label='Make Room Moderated?'
  4159. type='boolean'
  4160. var='muc#roomconfig_moderatedroom'>
  4161. <value>0</value>
  4162. </field>
  4163. <field
  4164. label='Make Room Members Only?'
  4165. type='boolean'
  4166. var='muc#roomconfig_membersonly'>
  4167. <value>0</value>
  4168. </field>
  4169. <field
  4170. label='Password Required for Entry?'
  4171. type='boolean'
  4172. var='muc#roomconfig_passwordprotectedroom'>
  4173. <value>1</value>
  4174. </field>
  4175. <field type='fixed'>
  4176. <value>
  4177. If a password is required to enter this room,
  4178. you must specify the password below.
  4179. </value>
  4180. </field>
  4181. <field
  4182. label='Password'
  4183. type='text-private'
  4184. var='muc#roomconfig_roomsecret'>
  4185. <value>cauldronburn</value>
  4186. </field>
  4187. <field
  4188. label='Who May Discover Real JIDs?'
  4189. type='list-single'
  4190. var='muc#roomconfig_whois'>
  4191. <value>moderators</value>
  4192. <option label='Moderators Only'>
  4193. <value>moderators</value>
  4194. </option>
  4195. <option label='Anyone'>
  4196. <value>anyone</value>
  4197. </option>
  4198. </field>
  4199. <field
  4200. label='Maximum Number of History Messages Returned by Room'
  4201. type='text-single'
  4202. var='muc#maxhistoryfetch'>
  4203. <value>50</value>
  4204. </field>
  4205. <field type='fixed'>
  4206. <value>
  4207. You may specify additional people who have
  4208. admin status in the room. Please
  4209. provide one Jabber ID per line.
  4210. </value>
  4211. </field>
  4212. <field
  4213. label='Room Admins'
  4214. type='jid-multi'
  4215. var='muc#roomconfig_roomadmins'>
  4216. <value>wiccarocks@shakespeare.lit</value>
  4217. <value>hecate@shakespeare.lit</value>
  4218. </field>
  4219. <field type='fixed'>
  4220. <value>
  4221. You may specify additional owners for this
  4222. room. Please provide one Jabber ID per line.
  4223. </value>
  4224. </field>
  4225. <field
  4226. label='Room Owners'
  4227. type='jid-multi'
  4228. var='muc#roomconfig_roomowners'/>
  4229. </x>
  4230. </query>
  4231. </iq>
  4232. ]]></example>
  4233. <p>If there are no configuration options available, the service MUST return an empty query element to the room owner as shown in the previous use case.</p>
  4234. <p>The room owner then submits the form with updated configuration information. (Example not shown.)</p>
  4235. <p>Alternatively, the room owner MAY cancel the configuration process:</p>
  4236. <example caption='Owner Cancels Subsequent Configuration'><![CDATA[
  4237. <iq from='crone1@shakespeare.lit/desktop'
  4238. id='config2'
  4239. to='coven@chat.shakespeare.lit'
  4240. type='set'>
  4241. <query xmlns='http://jabber.org/protocol/muc#owner'>
  4242. <x xmlns='jabber:x:data' type='cancel'/>
  4243. </query>
  4244. </iq>
  4245. ]]></example>
  4246. <p>If the room owner cancels the subsequent configuration, the service MUST leave the configuration of the room as it was before the room owner initiated the subsequent configuration process.</p>
  4247. <p>If as a result of a change in the room configuration a room admin loses admin status while in the room, the room MUST send updated presence for that individual to all occupants, denoting the change in status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "member" or "none" and the 'role' attribute set to a value of "participant" or "visitor" as appropriate for the affiliation level and the room type:</p>
  4248. <example caption="Service Notes Loss of Admin Affiliation"><![CDATA[
  4249. <presence
  4250. from='coven@chat.shakespeare.lit/secondwitch'
  4251. to='crone1@shakespeare.lit/desktop'>
  4252. <x xmlns='http://jabber.org/protocol/muc#user'>
  4253. <item affiliation='member'
  4254. jid='wiccarocks@shakespeare.lit/laptop'
  4255. role='participant'/>
  4256. </x>
  4257. </presence>
  4258. [ ... ]
  4259. ]]></example>
  4260. <p>If as a result of a change in the room configuration a user gains admin status while in the room, the room MUST send updated presence for that individual to all occupants, denoting the change in status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "admin" and the 'role' attribute set to a value of "moderator":</p>
  4261. <example caption="Service Notes Gain of Admin Affiliation to All Users"><![CDATA[
  4262. <presence
  4263. from='coven@chat.shakespeare.lit/secondwitch'
  4264. to='crone1@shakespeare.lit/desktop'>
  4265. <x xmlns='http://jabber.org/protocol/muc#user'>
  4266. <item affiliation='admin'
  4267. jid='wiccarocks@shakespeare.lit/laptop'
  4268. role='moderator'/>
  4269. </x>
  4270. </presence>
  4271. [ ... ]
  4272. ]]></example>
  4273. <p>If as a result of a change in the room configuration a room owner loses owner status while that owner is in the room, the room MUST send updated presence for that individual to all occupants, denoting the change in status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "admin" and the 'role' attribute set to an appropriate value given the affiliation and room type ("moderator" is recommended).</p>
  4274. <example caption="Service Notes Loss of Owner Affiliation"><![CDATA[
  4275. <presence
  4276. from='coven@chat.shakespeare.lit/secondwitch'
  4277. to='crone1@shakespeare.lit/desktop'>
  4278. <x xmlns='http://jabber.org/protocol/muc#user'>
  4279. <item affiliation='admin'
  4280. jid='wiccarocks@shakespeare.lit/laptop'
  4281. role='moderator'/>
  4282. </x>
  4283. </presence>
  4284. [ ... ]
  4285. ]]></example>
  4286. <p>A service MUST NOT allow an owner to revoke his or her own owner status if there are no other owners; if an owner attempts to do this, the service MUST return a &conflict; error to the owner. However, a service SHOULD allow an owner to revoke his or her own owner status if there are other owners.</p>
  4287. <p>If as a result of a change in the room configuration a user gains owner status while in the room, the room MUST send updated presence for that individual to all occupants, denoting the change in status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "owner" and the 'role' attribute set to an appropriate value given the affiliation and room type ("moderator" is recommended).</p>
  4288. <example caption="Service Notes Gain of Owner Affiliation to All Users"><![CDATA[
  4289. <presence
  4290. from='coven@chat.shakespeare.lit/secondwitch'
  4291. to='crone1@shakespeare.lit/desktop'>
  4292. <x xmlns='http://jabber.org/protocol/muc#user'>
  4293. <item affiliation='owner'
  4294. jid='wiccarocks@shakespeare.lit/laptop'
  4295. role='moderator'/>
  4296. </x>
  4297. </presence>
  4298. [ ... ]
  4299. ]]></example>
  4300. <p>If as a result of a change in the room configuration the room type is changed to members-only but there are non-members in the room, the service MUST remove any non-members from the room and include a status code of 322 in the presence unavailable stanzas sent to those users as well as any remaining occupants.</p>
  4301. <section3 topic='Notification of Configuration Changes' anchor='roomconfig-notify'>
  4302. <p>A room MUST send notification to all occupants when the room configuration changes in a way that has an impact on the privacy or security profile of the room. This notification shall consist of a &MESSAGE; stanza containing an &X; element qualified by the 'http://jabber.org/protocol/muc#user' namespace, which shall contain only a &lt;status/&gt; element with an appropriate value for the 'code' attribute. Here is an example:</p>
  4303. <example caption='Configuration Status Code'><![CDATA[
  4304. <message from='coven@chat.shakespeare.lit'
  4305. id='80349046-F26A-44F3-A7A6-54825064DD9E'
  4306. to='crone1@shakespeare.lit/desktop'
  4307. type='groupchat'>
  4308. <x xmlns='http://jabber.org/protocol/muc#user'>
  4309. <status code='170'/>
  4310. </x>
  4311. </message>
  4312. ]]></example>
  4313. <p>The codes to be generated as a result of a privacy-related change in room configuration are as follows:</p>
  4314. <ul>
  4315. <li>If room logging is now enabled, status code 170.</li>
  4316. <li>If room logging is now disabled, status code 171.</li>
  4317. <li>If the room is now non-anonymous, status code 172.</li>
  4318. <li>If the room is now semi-anonymous, status code 173.</li>
  4319. </ul>
  4320. <p>For any other configuration change, the room SHOULD send status code 104 so that interested occupants can retrieve the updated room configuration if desired.</p>
  4321. </section3>
  4322. </section2>
  4323. <section2 topic='Granting Owner Status' anchor='grantowner'>
  4324. <p>If allowed by an implementation, an owner MAY grant owner status to another user; this is done by changing the user's affiliation to "owner":</p>
  4325. <example caption='Owner Grants Owner Status'><![CDATA[
  4326. <iq from='crone1@shakespeare.lit/desktop'
  4327. id='owner1'
  4328. to='coven@chat.shakespeare.lit'
  4329. type='set'>
  4330. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4331. <item affiliation='owner'
  4332. jid='hecate@shakespeare.lit'/>
  4333. </query>
  4334. </iq>
  4335. ]]></example>
  4336. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  4337. <example caption='Owner Grants Owner Status (With a Reason)'><![CDATA[
  4338. <iq from='crone1@shakespeare.lit/desktop'
  4339. id='owner1'
  4340. to='coven@chat.shakespeare.lit'
  4341. type='set'>
  4342. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4343. <item affiliation='owner'
  4344. jid='hecate@shakespeare.lit'>
  4345. <reason>A worthy witch indeed!</reason>
  4346. </item>
  4347. </query>
  4348. </iq>
  4349. ]]></example>
  4350. <p>The service MUST add the user to the owner list and then inform the owner of success:</p>
  4351. <example caption='Service Informs Owner of Success'><![CDATA[
  4352. <iq from='coven@chat.shakespeare.lit'
  4353. id='owner1'
  4354. to='crone1@shakespeare.lit/desktop'
  4355. type='result'/>
  4356. ]]></example>
  4357. <p>If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the granting of owner status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "owner" and the 'role' attribute set to an appropriate value given the affiliation and room type ("moderator" is recommended).</p>
  4358. <example caption="Service Sends Notice of Owner Status to All Occupants"><![CDATA[
  4359. <presence
  4360. from='coven@chat.shakespeare.lit/hecate'
  4361. to='crone1@shakespeare.lit/desktop'>
  4362. <x xmlns='http://jabber.org/protocol/muc#user'>
  4363. <item affiliation='owner'
  4364. jid='hecate@shakespeare.lit'
  4365. role='moderator'/>
  4366. </x>
  4367. </presence>
  4368. [ ... ]
  4369. ]]></example>
  4370. <p>If the user is not in the room, the service MAY send a message from the room itself to the room occupants, indicating the granting of owner status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "owner".</p>
  4371. <example caption="Service Sends Notice of Owner Status to All Occupants"><![CDATA[
  4372. <message
  4373. from='chat.shakespeare.lit'
  4374. id='22B0F570-526A-4F22-BDE3-52EC3BB18371'
  4375. to='crone1@shakespeare.lit/desktop'>
  4376. <x xmlns='http://jabber.org/protocol/muc#user'>
  4377. <item affiliation='member'
  4378. jid='hecate@shakespeare.lit'
  4379. role='none'/>
  4380. </x>
  4381. </message>
  4382. [ ... ]
  4383. ]]></example>
  4384. </section2>
  4385. <section2 topic='Revoking Owner Status' anchor='revokeowner'>
  4386. <p>An implementation MAY allow an owner to revoke another user's owner status; this is done by changing the user's affiliation to something other than "owner":</p>
  4387. <example caption='Owner Revokes Owner Status'><![CDATA[
  4388. <iq from='crone1@shakespeare.lit/desktop'
  4389. id='owner2'
  4390. to='coven@chat.shakespeare.lit'
  4391. type='set'>
  4392. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4393. <item affiliation='admin'
  4394. jid='hecate@shakespeare.lit'/>
  4395. </query>
  4396. </iq>
  4397. ]]></example>
  4398. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  4399. <example caption='Owner Revokes Owner Status (With a Reason)'><![CDATA[
  4400. <iq from='crone1@shakespeare.lit/desktop'
  4401. id='owner2'
  4402. to='coven@chat.shakespeare.lit'
  4403. type='set'>
  4404. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4405. <item affiliation='admin'
  4406. jid='hecate@shakespeare.lit'>
  4407. <reason>Not so worthy after all!</reason>
  4408. </item>
  4409. </query>
  4410. </iq>
  4411. ]]></example>
  4412. <p>A service MUST NOT allow an owner to revoke his or her own owner status if there are no other owners; if an owner attempts to do this, the service MUST return a &conflict; error to the owner. However, a service SHOULD allow an owner to revoke his or her own owner status if there are other owners.</p>
  4413. <p>If an implementation does not allow one owner to revoke another user's owner status, the implementation MUST return a &notauthorized; error to the owner who made the request.</p>
  4414. <p>Note: Allowing an owner to remove another user's owner status can compromise the control model for room management; therefore this feature is OPTIONAL, and implementations are encouraged to support owner removal through an interface that is open only to individuals with service-wide admin status.</p>
  4415. <p>In all other cases, the service MUST remove the user from the owner list and then inform the owner of success:</p>
  4416. <example caption='Service Informs Owner of Success'><![CDATA[
  4417. <iq from='coven@chat.shakespeare.lit'
  4418. id='owner2'
  4419. to='crone1@shakespeare.lit/desktop'
  4420. type='result'/>
  4421. ]]></example>
  4422. <p>If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the loss of owner status by sending a presence element that contains an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value other than "owner" and the 'role' attribute set to an appropriate value:</p>
  4423. <example caption="Service Notes Loss of Owner Affiliation"><![CDATA[
  4424. <presence
  4425. from='coven@chat.shakespeare.lit/secondwitch'
  4426. to='crone1@shakespeare.lit/desktop'>
  4427. <x xmlns='http://jabber.org/protocol/muc#user'>
  4428. <item affiliation='admin'
  4429. jid='hecate@shakespeare.lit'
  4430. role='moderator'/>
  4431. </x>
  4432. </presence>
  4433. [ ... ]
  4434. ]]></example>
  4435. </section2>
  4436. <section2 topic='Modifying the Owner List' anchor='modifyowner'>
  4437. <p>If allowed by an implementation, a room owner might want to modify the owner list. To do so, the owner first requests the owner list by querying the room for all users with an affiliation of 'owner'.</p>
  4438. <example caption='Owner Requests Owner List'><![CDATA[
  4439. <iq from='bard@shakespeare.lit/globe'
  4440. id='owner3'
  4441. to='coven@chat.shakespeare.lit'
  4442. type='get'>
  4443. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4444. <item affiliation='owner'/>
  4445. </query>
  4446. </iq>
  4447. ]]></example>
  4448. <p>If the &lt;user@host&gt; of the 'from' address does not match the bare JID of a room owner, the service MUST return a &forbidden; error to the sender.</p>
  4449. <p>Otherwise, the service MUST then return the owner list to the owner; each item MUST include the 'affiliation' and 'jid' attributes and MAY include the 'nick' and 'role' attributes for any owner that is currently an occupant:</p>
  4450. <example caption='Service Sends Owner List to Owner'><![CDATA[
  4451. <iq from='coven@chat.shakespeare.lit'
  4452. id='owner3'
  4453. to='bard@shakespeare.lit/globe'
  4454. type='result'>
  4455. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4456. <item affiliation='owner'
  4457. jid='crone1@shakespeare.lit'/>
  4458. </query>
  4459. </iq>
  4460. ]]></example>
  4461. <p>The owner can then modify the owner list if desired. In order to do so, the owner MUST send the changed items (i.e., only the "delta") back to the service; <note>This is different from the behavior of room configuration, wherein the "muc#roomconfig_roomowners" field specifies the full list of room owners, not the delta.</note> each item MUST include the 'affiliation' and 'jid' attributes but SHOULD NOT include the 'nick' attribute and MUST NOT include the 'role' attribute (which is used to manage roles such as participant rather than affiliations such as owner):</p>
  4462. <example caption='Owner Sends Modified Owner List to Service'><![CDATA[
  4463. <iq from='bard@shakespeare.lit/globe'
  4464. id='owner4'
  4465. to='coven@chat.shakespeare.lit'
  4466. type='set'>
  4467. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4468. <item affiliation='owner'
  4469. jid='hecate@shakespeare.lit'/>
  4470. </query>
  4471. </iq>
  4472. ]]></example>
  4473. <p>Only owners shall be allowed to modify the owner list. If a non-owner attempts to view or modify the owner list, the service MUST deny the request and return a &forbidden; error to the sender:</p>
  4474. <example caption='Service Returns Error on Attempt by Non-Owner to Modify Owner List'><![CDATA[
  4475. <iq from='coven@chat.shakespeare.lit'
  4476. id='ownertest'
  4477. to='hag66@shakespeare.lit/pda'
  4478. type='error'>
  4479. <error type='auth'>
  4480. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4481. </error>
  4482. </iq>
  4483. ]]></example>
  4484. <p>A service MUST NOT allow an owner to revoke his or her own owner status if there are no other owners; if an owner attempts to do this, the service MUST return a &conflict; error to the owner. However, a service SHOULD allow an owner to revoke his or her own owner status if there are other owners.</p>
  4485. <p>In all other cases, the service MUST modify owner list and then inform the owner of success:</p>
  4486. <example caption='Service Informs Owner of Success'><![CDATA[
  4487. <iq from='coven@chat.shakespeare.lit'
  4488. id='owner4'
  4489. to='crone1@shakespeare.lit/desktop'
  4490. type='result'/>
  4491. ]]></example>
  4492. <p>The service MUST also send presence notifications related to any affiliation changes that result from modifying the owner list as previously described.</p>
  4493. </section2>
  4494. <section2 topic='Granting Admin Status' anchor='grantadmin'>
  4495. <p>An owner can grant admin status to a member or an unaffiliated user; this is done by changing the user's affiliation to "admin":</p>
  4496. <example caption='Owner Grants Admin Privileges'><![CDATA[
  4497. <iq from='crone1@shakespeare.lit/desktop'
  4498. id='admin1'
  4499. to='coven@chat.shakespeare.lit'
  4500. type='set'>
  4501. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4502. <item affiliation='admin'
  4503. jid='wiccarocks@shakespeare.lit'/>
  4504. </query>
  4505. </iq>
  4506. ]]></example>
  4507. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  4508. <example caption='Owner Grants Admin Privileges (With a Reason)'><![CDATA[
  4509. <iq from='crone1@shakespeare.lit/desktop'
  4510. id='admin1'
  4511. to='coven@chat.shakespeare.lit'
  4512. type='set'>
  4513. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4514. <item affiliation='admin'
  4515. jid='wiccarocks@shakespeare.lit'>
  4516. <reason>A worthy witch indeed!</reason>
  4517. </item>
  4518. </query>
  4519. </iq>
  4520. ]]></example>
  4521. <p>The service MUST add the user to the admin list and then inform the owner of success:</p>
  4522. <example caption='Service Informs Owner of Success'><![CDATA[
  4523. <iq from='coven@chat.shakespeare.lit'
  4524. id='admin1'
  4525. to='crone1@shakespeare.lit/desktop'
  4526. type='result'/>
  4527. ]]></example>
  4528. <p>If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the granting of admin status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "admin" and the 'role' attribute set to an appropriate value given the affiliation and room type (typically "moderator").</p>
  4529. <example caption="Service Sends Notice of Admin Status to All Occupants"><![CDATA[
  4530. <presence
  4531. from='coven@chat.shakespeare.lit/secondwitch'
  4532. to='crone1@shakespeare.lit/desktop'>
  4533. <x xmlns='http://jabber.org/protocol/muc#user'>
  4534. <item affiliation='admin'
  4535. jid='wiccarocks@shakespeare.lit'
  4536. role='moderator'/>
  4537. </x>
  4538. </presence>
  4539. [ ... ]
  4540. ]]></example>
  4541. <p>If the user is not in the room, the service MAY send a message from the room itself to the room occupants, indicating the granting of admin status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value of "admin".</p>
  4542. <example caption="Service Sends Notice of Admin Status to All Occupants"><![CDATA[
  4543. <message
  4544. from='chat.shakespeare.lit'
  4545. id='C75B919A-30B3-4233-AE89-6E9834E26929'
  4546. to='crone1@shakespeare.lit/desktop'>
  4547. <x xmlns='http://jabber.org/protocol/muc#user'>
  4548. <item affiliation='admin'
  4549. jid='wiccarocks@shakespeare.lit'
  4550. role='none'/>
  4551. </x>
  4552. </message>
  4553. [ ... ]
  4554. ]]></example>
  4555. </section2>
  4556. <section2 topic='Revoking Admin Status' anchor='revokeadmin'>
  4557. <p>An owner might want to revoke a user's admin status; this is done by changing the user's affiliation to something other than "admin" or "owner" (typically to "member" in a members-only room or to "none" in other types of room).</p>
  4558. <example caption='Owner Revokes Admin Status'><![CDATA[
  4559. <iq from='crone1@shakespeare.lit/desktop'
  4560. id='admin2'
  4561. to='coven@chat.shakespeare.lit'
  4562. type='set'>
  4563. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4564. <item affiliation='none'
  4565. jid='wiccarocks@shakespeare.lit'/>
  4566. </query>
  4567. </iq>
  4568. ]]></example>
  4569. <p>The &lt;reason/&gt; element is OPTIONAL.</p>
  4570. <example caption='Owner Revokes Admin Status (With a Reason)'><![CDATA[
  4571. <iq from='crone1@shakespeare.lit/desktop'
  4572. id='admin2'
  4573. to='coven@chat.shakespeare.lit'
  4574. type='set'>
  4575. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4576. <item affiliation='none'
  4577. jid='wiccarocks@shakespeare.lit'>
  4578. <reason>Not so worthy after all!</reason>
  4579. </item>
  4580. </query>
  4581. </iq>
  4582. ]]></example>
  4583. <p>The service MUST remove the user from the admin list and then inform the owner of success:</p>
  4584. <example caption='Service Informs Owner of Success'><![CDATA[
  4585. <iq from='coven@chat.shakespeare.lit'
  4586. id='admin2'
  4587. to='crone1@shakespeare.lit/desktop'
  4588. type='result'/>
  4589. ]]></example>
  4590. <p>If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the loss of admin status by sending a presence element that contains an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value other than "admin" or "owner" and the 'role' attribute set to an appropriate value given the affiliation level and the room type (typically "participant").</p>
  4591. <example caption="Service Notes Loss of Admin Affiliation"><![CDATA[
  4592. <presence
  4593. from='coven@chat.shakespeare.lit/secondwitch'
  4594. to='crone1@shakespeare.lit/desktop'>
  4595. <x xmlns='http://jabber.org/protocol/muc#user'>
  4596. <item affiliation='none'
  4597. jid='wiccarocks@shakespeare.lit'
  4598. role='participant'/>
  4599. </x>
  4600. </presence>
  4601. [ ... ]
  4602. ]]></example>
  4603. <p>If the user is not in the room, the service MAY send a message from the room itself to the room occupants, indicating the loss of admin status by including an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child with the 'affiliation' attribute set to a value other than "admin".</p>
  4604. <example caption="Service Notes Loss of Admin Affiliation"><![CDATA[
  4605. <message
  4606. from='chat.shakespeare.lit'
  4607. id='2CF9013B-E8A8-42A1-9633-85AD7CA12F40'
  4608. to='crone1@shakespeare.lit/desktop'>
  4609. <x xmlns='http://jabber.org/protocol/muc#user'>
  4610. <item affiliation='none'
  4611. jid='wiccarocks@shakespeare.lit'
  4612. role='none'/>
  4613. </x>
  4614. </message>
  4615. [ ... ]
  4616. ]]></example>
  4617. </section2>
  4618. <section2 topic='Modifying the Admin List' anchor='modifyadmin'>
  4619. <p>A room owner might want to modify the admin list. To do so, the owner first requests the admin list by querying the room for all users with an affiliation of 'admin'.</p>
  4620. <example caption='Owner Requests Admin List'><![CDATA[
  4621. <iq from='bard@shakespeare.lit/desktop'
  4622. id='admin3'
  4623. to='coven@chat.shakespeare.lit'
  4624. type='get'>
  4625. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4626. <item affiliation='admin'/>
  4627. </query>
  4628. </iq>
  4629. ]]></example>
  4630. <p>If the &lt;user@host&gt; of the 'from' address does not match the bare JID of a room owner, the service MUST return a &forbidden; error to the sender.</p>
  4631. <p>Otherwise, the service MUST then return the admin list to the owner; each item MUST include the 'affiliation' and 'jid' attributes and MAY include the 'nick' and 'role' attributes for any admin that is currently an occupant:</p>
  4632. <example caption='Service Sends Admin List to Owner'><![CDATA[
  4633. <iq from='coven@chat.shakespeare.lit'
  4634. id='admin3'
  4635. to='bard@shakespeare.lit/globe'
  4636. type='result'>
  4637. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4638. <item affiliation='admin'
  4639. jid='wiccarocks@shakespeare.lit'
  4640. nick='secondwitch'/>
  4641. <item affiliation='admin'
  4642. jid='hag66@shakespeare.lit'/>
  4643. </query>
  4644. </iq>
  4645. ]]></example>
  4646. <p>The owner can then modify the admin list if desired. In order to do so, the owner MUST send the changed items (i.e., only the "delta") back to the service; <note>This is different from the behavior of room configuration, wherein the "muc#roomconfig_roomadmins" field specifies the full list of room admins, not the delta.</note> each item MUST include the 'affiliation' attribute (normally set to a value of "admin" or "none") and 'jid' attribute but SHOULD NOT include the 'nick' attribute and MUST NOT include the 'role' attribute (which is used to manage roles such as participant rather than affiliations such as owner).</p>
  4647. <example caption='Owner Sends Modified Admin List to Service'><![CDATA[
  4648. <iq from='bard@shakespeare.lit/globe'
  4649. id='admin4'
  4650. to='coven@chat.shakespeare.lit'
  4651. type='set'>
  4652. <query xmlns='http://jabber.org/protocol/muc#admin'>
  4653. <item affiliation='none'
  4654. jid='hag66@shakespeare.lit'>
  4655. </item>
  4656. <item affiliation='admin'
  4657. jid='hecate@shakespeare.lit'>
  4658. </item>
  4659. </query>
  4660. </iq>
  4661. ]]></example>
  4662. <p>Only owners shall be allowed to modify the admin list. If a non-owner attempts to view or modify the admin list, the service MUST deny the request and return a &forbidden; error to the sender.</p>
  4663. <example caption='Service Returns Error on Attempt by Non-Owner to Modify Admin List'><![CDATA[
  4664. <iq from='coven@chat.shakespeare.lit'
  4665. id='admintest'
  4666. to='hag66@shakespeare.lit/pda'
  4667. type='error'>
  4668. <error type='auth'>
  4669. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4670. </error>
  4671. </iq>
  4672. ]]></example>
  4673. <p>Otherwise, the service MUST modify the admin list and then inform the owner of success:</p>
  4674. <example caption='Service Informs Owner of Success'><![CDATA[
  4675. <iq from='coven@chat.shakespeare.lit'
  4676. id='admin4'
  4677. to='crone1@shakespeare.lit/desktop'
  4678. type='result'/>
  4679. ]]></example>
  4680. <p>The service MUST also send presence notifications related to any affiliation changes that result from modifying the admin list as previously described.</p>
  4681. </section2>
  4682. <section2 topic='Destroying a Room' anchor='destroyroom'>
  4683. <p>A room owner MUST be able to destroy a room, especially if the room is persistent. The workflow is as follows:</p>
  4684. <ol start='1'>
  4685. <li><p>The room owner requests that the room be destroyed, optionally specifying a reason and an alternate venue.</p></li>
  4686. <li><p>The room removes all users from the room (including appropriate information about the alternate location and the reason for being removed) and destroys the room, even if it was defined as persistent.</p></li>
  4687. </ol>
  4688. <p>Other than the foregoing, this document does not specify what (if anything) a MUC service implementation shall do as a result of a room destruction request. For example, if the room was defined as persistent, an implementation MAY choose to lock the room ID so that it cannot be re-used, redirect enter requests to the alternate venue, or invite the current participants to the new room; however, such behavior is OPTIONAL.</p>
  4689. <p>In order to destroy a room, the room owner MUST send an IQ set to the address of the room to be destroyed. The &IQ; stanza shall contain a &QUERY; element qualified by the 'http://jabber.org/protocol/muc#owner' namespace, which in turn shall contain a &lt;destroy/&gt; element. The address of the alternate venue MAY be provided as the value of the &lt;destroy/&gt; element's 'jid' attribute. A password for the alternate venue MAY be provided as the XML character data of a &lt;password/&gt; child element of the &lt;destroy/&gt; element. The reason for the room destruction MAY be provided as the XML character data of a &lt;reason/&gt; child element of the &lt;destroy/&gt; element.</p>
  4690. <p>The following examples illustrate the protocol elements to be sent and received:</p>
  4691. <example caption='Owner Submits Room Destruction Request'><![CDATA[
  4692. <iq from='crone1@shakespeare.lit/desktop'
  4693. id='begone'
  4694. to='heath@chat.shakespeare.lit'
  4695. type='set'>
  4696. <query xmlns='http://jabber.org/protocol/muc#owner'>
  4697. <destroy jid='coven@chat.shakespeare.lit'>
  4698. <reason>Macbeth doth come.</reason>
  4699. </destroy>
  4700. </query>
  4701. </iq>
  4702. ]]></example>
  4703. <p>The service is responsible for removing all the occupants. It SHOULD NOT broadcast presence stanzas of type "unavailable" from all occupants, instead sending only one presence stanza of type "unavailable" to each occupant so that the user knows he or she has been removed from the room. If extended presence information specifying the JID of an alternate location and the reason for the room destruction was provided by the room owner, the presence stanza MUST include that information.</p>
  4704. <example caption='Service Removes Each Occupant'><![CDATA[
  4705. <presence
  4706. from='heath@chat.shakespeare.lit/firstwitch'
  4707. to='crone1@shakespeare.lit/desktop'
  4708. type='unavailable'>
  4709. <x xmlns='http://jabber.org/protocol/muc#user'>
  4710. <item affiliation='none' role='none'/>
  4711. <destroy jid='coven@chat.shakespeare.lit'>
  4712. <reason>Macbeth doth come.</reason>
  4713. </destroy>
  4714. </x>
  4715. </presence>
  4716. <presence
  4717. from='heath@chat.shakespeare.lit/secondwitch'
  4718. to='wiccarocks@shakespeare.lit/laptop'
  4719. type='unavailable'>
  4720. <x xmlns='http://jabber.org/protocol/muc#user'>
  4721. <item affiliation='none' role='none'/>
  4722. <destroy jid='coven@chat.shakespeare.lit'>
  4723. <reason>Macbeth doth come.</reason>
  4724. </destroy>
  4725. </x>
  4726. </presence>
  4727. <presence
  4728. from='heath@chat.shakespeare.lit/thirdwitch'
  4729. to='hag66@shakespeare.lit/pda'
  4730. type='unavailable'>
  4731. <x xmlns='http://jabber.org/protocol/muc#user'>
  4732. <item affiliation='none' role='none'/>
  4733. <destroy jid='coven@chat.shakespeare.lit'>
  4734. <reason>Macbeth doth come.</reason>
  4735. </destroy>
  4736. </x>
  4737. </presence>
  4738. ]]></example>
  4739. <example caption='Service Informs Owner of Successful Destruction'><![CDATA[
  4740. <iq from='heath@chat.shakespeare.lit'
  4741. id='begone'
  4742. to='crone1@shakespeare.lit/desktop'
  4743. type='result'/>
  4744. ]]></example>
  4745. <p>If the &lt;user@host&gt; of the 'from' address received on a destroy request does not match the bare JID of a room owner, the service MUST return a &forbidden; error to the sender:</p>
  4746. <example caption='Service Denies Destroy Request Submitted by Non-Owner'><![CDATA[
  4747. <iq from='heath@chat.shakespeare.lit'
  4748. id='destroytest'
  4749. to='wiccarocks@shakespeare.lit/laptop'
  4750. type='error'>
  4751. <query xmlns='http://jabber.org/protocol/muc#owner'>
  4752. <destroy jid='coven@chat.shakespeare.lit'>
  4753. <reason>Macbeth doth come.</reason>
  4754. </destroy>
  4755. </query>
  4756. <error type='auth'>
  4757. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  4758. </error>
  4759. </iq>
  4760. ]]></example>
  4761. </section2>
  4762. </section1>
  4763. <section1 topic='Service Use Cases' anchor='service'>
  4764. <section2 topic='Service removes user because of error response' anchor='service-error-kick'>
  4765. <p>A MUC service MAY support adding the 333 status code to presences when a user gets removed by the service due to a technical problem (e.g. s2s link failure).</p>
  4766. <p>If a MUC service supports this OPTIONAL feature, it MUST include the 333 status code in the resulting presence:</p>
  4767. <example caption='MUC service removes user because of error'><![CDATA[
  4768. <presence
  4769. from='harfleur@chat.shakespeare.lit/pistol'
  4770. to='pistol@shakespeare.lit/harfleur'
  4771. type='unavailable'>
  4772. <x xmlns='http://jabber.org/protocol/muc#user'>
  4773. <item affiliation='none' role='none' />
  4774. <status code='110'/>
  4775. <status code='307'/>
  4776. <status code='333'/>
  4777. </x>
  4778. </presence>
  4779. ]]></example>
  4780. <p>The status code MUST also be included in presences sent to other occupants:</p>
  4781. <example caption='MUC service informs other occupants of removal because of an error'><![CDATA[
  4782. <presence
  4783. from='harfleur@chat.shakespeare.lit/pistol'
  4784. to='gower@shakespeare.lit/cell'
  4785. type='unavailable'>
  4786. <x xmlns='http://jabber.org/protocol/muc#user'>
  4787. <item affiliation='none' role='none'/>
  4788. <status code='307'/>
  4789. <status code='333'/>
  4790. </x>
  4791. </presence>
  4792. ]]></example>
  4793. </section2>
  4794. </section1>
  4795. <section1 topic='Status Codes' anchor='statuscodes'>
  4796. <p>Multi-User Chat uses a &lt;status/&gt; element (specifically, the 'code' attribute of the &lt;status/&gt; element) to communicate information about a user's status in a room. Over time, the number of status codes has grown quite large, and new status codes continue to be requested of the author. Therefore, these codes are now documented in a registry maintained by the XMPP Registrar. For details, refer to the <link url='#registrar-statuscodes'>Status Codes Registry</link> section of this document.</p>
  4797. <p>Note: In general, MUC status codes tend to follow the "philosophy" of status codes that is implicit in &rfc2616; and &rfc1893; (1xx codes are informational, 2xx codes specify that it is fine to continue, 3xx codes specify redirects such as being kicked or banned, x3x codes refer to system status, x7x codes refer to security or policy matters, etc.).</p>
  4798. <p>Note: If the MUC protocol were being designed today, it would specify a more flexible, XML-friendly approach rather than hardcoded status numbers; however, at this point the pain of changing the status reporting system would be greater than the benefit of doing so, which is why the status code numbers remain in use. A future version of this document may define a more XMPP-like approach to status conditions, retaining the code numbers but supplementing them with more descriptive child elements as is done in <cite>RFC 6120</cite>.</p>
  4799. </section1>
  4800. <section1 topic='Internationalization Considerations' anchor='i18n'>
  4801. <p>As specified in <cite>RFC 6120</cite>, XMPP entities (including MUC rooms and MUC services) SHOULD respect the value of the 'xml:lang' attribute provided with any given stanza. However, simultaneous translation of groupchat messages is out of scope for this document (see &xep0171;).</p>
  4802. <p>The status and error codes defined herein enable a client implementation to present a localized interface; however, definition of the localized text strings for any given language community is out of scope for this document.</p>
  4803. <p>Although the labels for various data form fields are shown here in English, MUC clients SHOULD present localized text for these fields rather than the English text.</p>
  4804. <p>Nicknames can contain virtually any Unicode character. This introduces the possibility of nick spoofing; see &rfc6122; for a description of related security considerations.</p>
  4805. </section1>
  4806. <section1 topic='Security Considerations' anchor='security'>
  4807. <section2 topic='User Authentication and Authorization' anchor='security-auth'>
  4808. <p>No room entrance authentication or authorization method more secure than cleartext passwords is defined or required by this document. Although the risks involved can mitigated somewhat by the use of channel encryption and strong authentication via TLS and SASL as described in <cite>RFC 6120</cite>, an entity that joins a room has no way of knowing if its complete communication channel to the room is encrypted (thereby protecting the plaintext password). A future specification might define an XMPP profile of SASL for use with MUC, but currently there is no such specification.</p>
  4809. </section2>
  4810. <section2 topic='End-to-End Encryption' anchor='security-e2e'>
  4811. <p>No end-to-end message or session encryption method is specified herein. Users SHOULD NOT trust a service to keep secret any text sent through a room. A future specification might define a method for end-to-end encryption of MUC traffic, but currently there is no such specification.</p>
  4812. </section2>
  4813. <section2 topic='Privacy' anchor='security-privacy'>
  4814. <p>Depending on room configuration, a room might publicly log all discussions held in the room. A service MUST warn the user that the room is publicly logged by returning a status code of "170" with the user's initial presence, and the user's client MUST warn the user if the room discussion is logged (a user's client SHOULD also query the room for its configuration prior to allowing the user to enter in order to "pre-discover" whether the room is logged). A client MUST also warn the user if the room's configuration is subsequently modified to allow room logging (which the client will discover when the room sends status code 170).</p>
  4815. <p>Note: In-room history is different from public room logging, and naturally a room cannot effectively prevent occupants from separately maintaining their own room logs, which may become public; users SHOULD exercise due caution and consider any room discussions to be effectively public.</p>
  4816. </section2>
  4817. <section2 topic='Information Leaks' anchor='security-leaks'>
  4818. <p>The "roominfo" data form used in extended service discovery can result in information leaks, e.g., the current discussion topic (via the "roominfo_subject" field). The same is true of service discovery items (disco#items) requests from outside the room (which could be used to discover the list of room occupants).</p>
  4819. <p>Implementations and deployments are advised to carefully consider the possibility that this information might be leaked, and to turn off information sharing by default for sensitive data.</p>
  4820. </section2>
  4821. <section2 topic='Anonymity' anchor='security-anon'>
  4822. <p>Depending on room configuration, a room might expose each occupant's real JID to other occupants (if the room is non-anonymous). If real JIDs are exposed to all occupants in the room, the service MUST warn the user by returning a status code of "100" with the user's initial presence, and the user's client MUST warn the user (a user's client SHOULD also query the room for its configuration prior to allowing the user to enter in order to "pre-discover" whether real JIDs are exposed in the room). A client MUST also warn the user if the room's configuration is modified from semi-anonymous to non-anonymous (which the client will discover when the room sends status code 172).</p>
  4823. </section2>
  4824. <section2 topic='Denial of Service' anchor='security-dos'>
  4825. <p>Public MUC rooms can be subject to a number of attacks, most of which reduce to denial of service attacks. Such attacks include but are not limited to:</p>
  4826. <ol>
  4827. <li>Stuffing the room with a large number of illegitimate occupants and therefore preventing legitimate users from joining the room.</li>
  4828. <li>Sending abusive messages and then leaving the room before a kick or ban can be applied; such abusive messages include but are not limited to large messages that prevent participants from following the conversation thread or room history, personal attacks on participants (especially room administrators and moderators), offensive text, and links to spam sites.</li>
  4829. <li>Making rapid and repeated presence changes.</li>
  4830. <li>Using long nicknames to route around lack of voice.</li>
  4831. <li>Abusing the room administrators or other room occupants.</li>
  4832. <li>Registering multiple nicknames across a service and therefore denying the use of those nicknames.</li>
  4833. <li>Mimicking another occupant's roomnick (e.g., by adding a space at the end or substituting visually similar characters), then sending messages from that roomnick in an effort to confuse the occupants.</li>
  4834. </ol>
  4835. <p>These attacks can be mitigated but not completely prevented through the liberal use of administrative actions such as banning, the presence of automated room bots with admin status, implementation of intelligent content filtering, checking the IP addresses of connected users (not always possible in a distributed system), applying voice rules to presence as well as messaging, matching room nicks using more stringent rules than the Resourceprep profile of stringprep, etc. However, experience has shown that it is impossible to fully prevent attacks of this kind.</p>
  4836. <p>Public MUC services also can be subject to attacks, such as creating a large number of rooms on a service, leaving rooms in an unconfigured state, etc. Such service-level attacks can be mitigated by limiting the number of rooms that any given non-adminstrative user can own, deleting rooms if they remain in the unconfigured state for too long, etc.</p>
  4837. </section2>
  4838. <section2 topic='Other Considerations' anchor='security-other'>
  4839. <p>See <cite>XEP-0203</cite> for security considerations regarding the inclusion and processing of delayed delivery notations.</p>
  4840. </section2>
  4841. </section1>
  4842. <section1 topic='IANA Considerations' anchor='iana'>
  4843. <p>This document requires no interaction with &IANA;.</p>
  4844. </section1>
  4845. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  4846. <p>The &REGISTRAR; includes the following information in its registries.</p>
  4847. <section2 topic='Protocol Namespaces' anchor='registrar-protocol'>
  4848. <p>The XMPP Registrar includes the following MUC-related namespaces in its registry of protocol namespaces at &NAMESPACES;:</p>
  4849. <ul>
  4850. <li>http://jabber.org/protocol/muc</li>
  4851. <li>http://jabber.org/protocol/muc#admin</li>
  4852. <li>http://jabber.org/protocol/muc#owner</li>
  4853. <li>http://jabber.org/protocol/muc#user</li>
  4854. </ul>
  4855. </section2>
  4856. <section2 topic='Service Discovery Category/Type' anchor='registrar-discocat'>
  4857. <p>A Multi-User Chat service or room is identified by the "conference" category and the "text" type within Service Discovery.</p>
  4858. </section2>
  4859. <section2 topic='Service Discovery Features' anchor='registrar-features'>
  4860. <p>There are many features related to a MUC service or room that can be discovered by means of Service Discovery. The most fundamental of these is the 'http://jabber.org/protocol/muc' namespace. In addition, a MUC room SHOULD provide information about the specific room features it implements, such as password protection and room moderation.</p>
  4861. <code caption='Registry Submission'><![CDATA[
  4862. <var>
  4863. <name>http://jabber.org/protocol/muc#register</name>
  4864. <desc>Support for the muc#register FORM_TYPE</desc>
  4865. <doc>XEP-0045</doc>
  4866. </var>
  4867. <var>
  4868. <name>http://jabber.org/protocol/muc#roomconfig</name>
  4869. <desc>Support for the muc#roomconfig FORM_TYPE</desc>
  4870. <doc>XEP-0045</doc>
  4871. </var>
  4872. <var>
  4873. <name>http://jabber.org/protocol/muc#roominfo</name>
  4874. <desc>Support for the muc#roominfo FORM_TYPE</desc>
  4875. <doc>XEP-0045</doc>
  4876. </var>
  4877. <var>
  4878. <name>http://jabber.org/protocol/muc#stable_id</name>
  4879. <desc>This MUC will reflect the original message 'id' in 'groupchat' messages.</desc>
  4880. <doc>XEP-0045</doc>
  4881. </var>
  4882. <var>
  4883. <name>muc_hidden</name>
  4884. <desc>Hidden room in Multi-User Chat (MUC)</desc>
  4885. <doc>XEP-0045</doc>
  4886. </var>
  4887. <var>
  4888. <name>muc_membersonly</name>
  4889. <desc>Members-only room in Multi-User Chat (MUC)</desc>
  4890. <doc>XEP-0045</doc>
  4891. </var>
  4892. <var>
  4893. <name>muc_moderated</name>
  4894. <desc>Moderated room in Multi-User Chat (MUC)</desc>
  4895. <doc>XEP-0045</doc>
  4896. </var>
  4897. <var>
  4898. <name>muc_nonanonymous</name>
  4899. <desc>Non-anonymous room in Multi-User Chat (MUC)</desc>
  4900. <doc>XEP-0045</doc>
  4901. </var>
  4902. <var>
  4903. <name>muc_open</name>
  4904. <desc>Open room in Multi-User Chat (MUC)</desc>
  4905. <doc>XEP-0045</doc>
  4906. </var>
  4907. <var>
  4908. <name>muc_passwordprotected</name>
  4909. <desc>Password-protected room in Multi-User Chat (MUC)</desc>
  4910. <doc>XEP-0045</doc>
  4911. </var>
  4912. <var>
  4913. <name>muc_persistent</name>
  4914. <desc>Persistent room in Multi-User Chat (MUC)</desc>
  4915. <doc>XEP-0045</doc>
  4916. </var>
  4917. <var>
  4918. <name>muc_public</name>
  4919. <desc>Public room in Multi-User Chat (MUC)</desc>
  4920. <doc>XEP-0045</doc>
  4921. </var>
  4922. <var>
  4923. <name>muc_rooms</name>
  4924. <desc>List of MUC rooms (each as a separate item)</desc>
  4925. <doc>XEP-0045</doc>
  4926. </var>
  4927. <var>
  4928. <name>muc_semianonymous</name>
  4929. <desc>Semi-anonymous room in Multi-User Chat (MUC)</desc>
  4930. <doc>XEP-0045</doc>
  4931. </var>
  4932. <var>
  4933. <name>muc_temporary</name>
  4934. <desc>Temporary room in Multi-User Chat (MUC)</desc>
  4935. <doc>XEP-0045</doc>
  4936. </var>
  4937. <var>
  4938. <name>muc_unmoderated</name>
  4939. <desc>Unmoderated room in Multi-User Chat (MUC)</desc>
  4940. <doc>XEP-0045</doc>
  4941. </var>
  4942. <var>
  4943. <name>muc_unsecured</name>
  4944. <desc>Unsecured room in Multi-User Chat (MUC)</desc>
  4945. <doc>XEP-0045</doc>
  4946. </var>
  4947. ]]></code>
  4948. </section2>
  4949. <section2 topic='Well-Known Service Discovery Nodes' anchor='registrar-nodes'>
  4950. <p>The well-known Service Discovery node 'http://jabber.org/protocol/muc#rooms' enables discovery of the rooms in which a user is an occupant.</p>
  4951. <p>The well-known Service Discovery node 'x-roomuser-item' enables a user to discover his or her registered roomnick from outside the room.</p>
  4952. <p>The well-known Service Discovery node 'http://jabber.org/protocol/muc#traffic' enables discovery of the namespaces that are allowed in traffic sent through a room (see the <link url='#impl-service-traffic'>Allowable Traffic</link> section of this document).</p>
  4953. </section2>
  4954. <section2 topic='Field Standardization' anchor='registrar-formtype'>
  4955. <p>&xep0068; defines a process for standardizing the fields used within Data Forms qualified by a particular FORM_TYPE. Within MUC, there are four uses of such forms: room registration (the "muc#register" FORM_TYPE), requesting voice and approving voice requests ("muc#request"), room configuration ("muc#roomconfig"), and service discovery extensions for room information ("muc#roominfo"). The reserved fields are defined below.</p>
  4956. <section3 topic='muc#register FORM_TYPE' anchor='registrar-formtype-register'>
  4957. <code caption='Registry Submission'><![CDATA[
  4958. <form_type>
  4959. <name>http://jabber.org/protocol/muc#register</name>
  4960. <doc>XEP-0045</doc>
  4961. <desc>
  4962. Forms enabling user registration with a
  4963. Multi-User Chat (MUC) room or admin approval
  4964. of user registration requests.
  4965. </desc>
  4966. <field
  4967. var='muc#register_allow'
  4968. type='boolean'
  4969. label='Allow this person to register with the room?'/>
  4970. <field
  4971. var='muc#register_email'
  4972. type='text-single'
  4973. label='Email Address'/>
  4974. <field
  4975. var='muc#register_faqentry'
  4976. type='text-multi'
  4977. label='FAQ Entry'/>
  4978. <field
  4979. var='muc#register_first'
  4980. type='text-single'
  4981. label='Given Name'/>
  4982. <field
  4983. var='muc#register_last'
  4984. type='text-single'
  4985. label='Family Name'/>
  4986. <field
  4987. var='muc#register_roomnick'
  4988. type='text-single'
  4989. label='Desired Nickname'/>
  4990. <field
  4991. var='muc#register_url'
  4992. type='text-single'
  4993. label='A Web Page'/>
  4994. </form_type>
  4995. ]]></code>
  4996. </section3>
  4997. <section3 topic='muc#request FORM_TYPE' anchor='registrar-formtype-request'>
  4998. <code caption='Registry Submission'><![CDATA[
  4999. <form_type>
  5000. <name>http://jabber.org/protocol/muc#request</name>
  5001. <doc>XEP-0045</doc>
  5002. <desc>
  5003. Forms enabling voice requests in a
  5004. Multi-User Chat (MUC) room or admin
  5005. approval of such requests.
  5006. </desc>
  5007. <field var='muc#role'
  5008. type='list-single'
  5009. label='Requested role'/>
  5010. <field var='muc#jid'
  5011. type='jid-single'
  5012. label='User ID'/>
  5013. <field var='muc#roomnick'
  5014. type='text-single'
  5015. label='Room Nickname'/>
  5016. <field var='muc#request_allow'
  5017. type='boolean'
  5018. label='Whether to grant voice'/>
  5019. </form_type>
  5020. ]]></code>
  5021. </section3>
  5022. <section3 topic='muc#roomconfig FORM_TYPE' anchor='registrar-formtype-owner'>
  5023. <code caption='Registry Submission'><![CDATA[
  5024. <form_type>
  5025. <name>http://jabber.org/protocol/muc#roomconfig</name>
  5026. <doc>XEP-0045</doc>
  5027. <desc>
  5028. Forms enabling creation and configuration of
  5029. a Multi-User Chat (MUC) room.
  5030. </desc>
  5031. <field
  5032. var='muc#maxhistoryfetch'
  5033. type='text-single'
  5034. label='Maximum Number of History Messages Returned by Room'/>
  5035. <field
  5036. var='muc#roomconfig_allowpm'
  5037. type='list-single'
  5038. label='Roles that May Send Private Messages'/>
  5039. <field
  5040. var='muc#roomconfig_allowinvites'
  5041. type='boolean'
  5042. label='Whether to Allow Occupants to Invite Others'/>
  5043. <field
  5044. var='muc#roomconfig_changesubject'
  5045. type='boolean'
  5046. label='Whether to Allow Occupants to Change Subject'/>
  5047. <field
  5048. var='muc#roomconfig_enablelogging'
  5049. type='boolean'
  5050. label='Whether to Enable Public Logging of Room Conversations'/>
  5051. <field
  5052. var='muc#roomconfig_getmemberlist'
  5053. type='list-multi'
  5054. label='Roles and Affiliations that May Retrieve Member List'/>
  5055. <field
  5056. var='muc#roomconfig_lang'
  5057. type='text-single'
  5058. label='Natural Language for Room Discussions'/>
  5059. <field
  5060. var='muc#roomconfig_pubsub'
  5061. type='text-single'
  5062. label='XMPP URI of Associated Publish-Subscribe Node'/>
  5063. <field
  5064. var='muc#roomconfig_maxusers'
  5065. type='list-single'
  5066. label='Maximum Number of Room Occupants'/>
  5067. <field
  5068. var='muc#roomconfig_membersonly'
  5069. type='boolean'
  5070. label='Whether to Make Room Members-Only'/>
  5071. <field
  5072. var='muc#roomconfig_moderatedroom'
  5073. type='boolean'
  5074. label='Whether to Make Room Moderated'/>
  5075. <field
  5076. var='muc#roomconfig_passwordprotectedroom'
  5077. type='boolean'
  5078. label='Whether a Password is Required to Enter'/>
  5079. <field
  5080. var='muc#roomconfig_persistentroom'
  5081. type='boolean'
  5082. label='Whether to Make Room Persistent'/>
  5083. <field
  5084. var='muc#roomconfig_presencebroadcast'
  5085. type='list-multi'
  5086. label='Roles for which Presence is Broadcasted'/>
  5087. <field
  5088. var='muc#roomconfig_publicroom'
  5089. type='boolean'
  5090. label='Whether to Allow Public Searching for Room'/>
  5091. <field
  5092. var='muc#roomconfig_roomadmins'
  5093. type='jid-multi'
  5094. label='Full List of Room Admins'/>
  5095. <field
  5096. var='muc#roomconfig_roomdesc'
  5097. type='text-single'
  5098. label='Short Description of Room'/>
  5099. <field
  5100. var='muc#roomconfig_roomname'
  5101. type='text-single'
  5102. label='Natural-Language Room Name'/>
  5103. <field
  5104. var='muc#roomconfig_roomowners'
  5105. type='jid-multi'
  5106. label='Full List of Room Owners'/>
  5107. <field
  5108. var='muc#roomconfig_roomsecret'
  5109. type='text-single'
  5110. label='The Room Password'/>
  5111. <field
  5112. var='muc#roomconfig_whois'
  5113. type='list-single'
  5114. label='Affiliations that May Discover Real JIDs of Occupants'/>
  5115. </form_type>
  5116. ]]></code>
  5117. </section3>
  5118. <section3 topic='muc#roominfo FORM_TYPE' anchor='registrar-formtype-roominfo'>
  5119. <code caption='Registry Submission'><![CDATA[
  5120. <form_type>
  5121. <name>http://jabber.org/protocol/muc#roominfo</name>
  5122. <doc>XEP-0045</doc>
  5123. <desc>
  5124. Forms enabling the communication of extended service discovery
  5125. information about a Multi-User Chat (MUC) room.
  5126. </desc>
  5127. <field
  5128. var='muc#maxhistoryfetch'
  5129. type='text-single'
  5130. label='Maximum Number of History Messages Returned by Room'/>
  5131. <field
  5132. var='muc#roominfo_contactjid'
  5133. type='jid-multi'
  5134. label='Contact Addresses (normally, room owner or owners)'/>
  5135. <field
  5136. var='muc#roominfo_description'
  5137. type='text-single'
  5138. label='Short Description of Room'/>
  5139. <field
  5140. var='muc#roominfo_lang'
  5141. type='text-single'
  5142. label='Natural Language for Room Discussions'/>
  5143. <field
  5144. var='muc#roominfo_ldapgroup'
  5145. type='text-single'
  5146. label='An associated LDAP group that defines
  5147. room membership; this should be an LDAP
  5148. Distinguished Name according to an
  5149. implementation-specific or
  5150. deployment-specific definition of a
  5151. group.'/>
  5152. <field
  5153. var='muc#roominfo_logs'
  5154. type='text-single'
  5155. label='URL for Archived Discussion Logs'/>
  5156. <field
  5157. var='muc#roominfo_occupants'
  5158. type='text-single'
  5159. label='Current Number of Occupants in Room'/>
  5160. <field
  5161. var='muc#roominfo_subject'
  5162. type='text-single'
  5163. label='Current Discussion Topic'/>
  5164. <field
  5165. var='muc#roominfo_subjectmod'
  5166. type='boolean'
  5167. label='The room subject can be modified by participants'/>
  5168. </form_type>
  5169. ]]></code>
  5170. </section3>
  5171. </section2>
  5172. <section2 topic='Status Codes Registry' anchor='registrar-statuscodes'>
  5173. <section3 topic='Process' anchor='registrar-statuscodes-process'>
  5174. <p>The XMPP Registrar maintains a registry at &MUCSTATUS; that defines values for the 'code' attribute of the &lt;status/&gt; element when qualified by the 'http://jabber.org/protocol/muc#user' namespace.</p>
  5175. &REGPROCESS;
  5176. <code><![CDATA[
  5177. <statuscode>
  5178. <number>
  5179. the three-digit code number
  5180. </number>
  5181. <stanza>
  5182. the stanza type of which it is a child (message or presence)
  5183. </stanza>
  5184. <context>
  5185. the use case or situation in which the status is used
  5186. </context>
  5187. <purpose>
  5188. a natural-language description of the meaning
  5189. </purpose>
  5190. <child>
  5191. the descriptive child element (reserved for future use)
  5192. </child>
  5193. </statuscode>
  5194. ]]></code>
  5195. <p>The registrant may register more than one status code at a time, each contained in a separate &lt;statuscode/&gt; element.</p>
  5196. </section3>
  5197. <section3 topic='Initial Submission' anchor='registrar-statuscodes-init'>
  5198. <p>As part of this document, the following status codes are registered:</p>
  5199. <code><![CDATA[
  5200. <statuscode>
  5201. <number>100</number>
  5202. <stanza>message or presence</stanza>
  5203. <context>Entering a room</context>
  5204. <purpose>
  5205. Inform user that any occupant is allowed to see the user's full JID
  5206. </purpose>
  5207. </statuscode>
  5208. <statuscode>
  5209. <number>101</number>
  5210. <stanza>message (out of band)</stanza>
  5211. <context>Affiliation change</context>
  5212. <purpose>
  5213. Inform user that his or her affiliation changed while not in the room
  5214. </purpose>
  5215. </statuscode>
  5216. <statuscode>
  5217. <number>102</number>
  5218. <stanza>message</stanza>
  5219. <context>Configuration change</context>
  5220. <purpose>
  5221. Inform occupants that room now shows unavailable members
  5222. </purpose>
  5223. </statuscode>
  5224. <statuscode>
  5225. <number>103</number>
  5226. <stanza>message</stanza>
  5227. <context>Configuration change</context>
  5228. <purpose>
  5229. Inform occupants that room now does not show unavailable members
  5230. </purpose>
  5231. </statuscode>
  5232. <statuscode>
  5233. <number>104</number>
  5234. <stanza>message</stanza>
  5235. <context>Configuration change</context>
  5236. <purpose>
  5237. Inform occupants that a non-privacy-related room configuration change has occurred
  5238. </purpose>
  5239. </statuscode>
  5240. <statuscode>
  5241. <number>110</number>
  5242. <stanza>presence</stanza>
  5243. <context>Any room presence</context>
  5244. <purpose>
  5245. Inform user that presence refers to itself
  5246. </purpose>
  5247. </statuscode>
  5248. <statuscode>
  5249. <number>170</number>
  5250. <stanza>message or initial presence</stanza>
  5251. <context>Configuration change</context>
  5252. <purpose>
  5253. Inform occupants that room logging is now enabled
  5254. </purpose>
  5255. </statuscode>
  5256. <statuscode>
  5257. <number>171</number>
  5258. <stanza>message</stanza>
  5259. <context>Configuration change</context>
  5260. <purpose>
  5261. Inform occupants that room logging is now disabled
  5262. </purpose>
  5263. </statuscode>
  5264. <statuscode>
  5265. <number>172</number>
  5266. <stanza>message</stanza>
  5267. <context>Configuration change</context>
  5268. <purpose>
  5269. Inform occupants that the room is now non-anonymous
  5270. </purpose>
  5271. </statuscode>
  5272. <statuscode>
  5273. <number>173</number>
  5274. <stanza>message</stanza>
  5275. <context>Configuration change</context>
  5276. <purpose>
  5277. Inform occupants that the room is now semi-anonymous
  5278. </purpose>
  5279. </statuscode>
  5280. <statuscode>
  5281. <number>201</number>
  5282. <stanza>presence</stanza>
  5283. <context>Entering a room</context>
  5284. <purpose>
  5285. Inform user that a new room has been created
  5286. </purpose>
  5287. </statuscode>
  5288. <statuscode>
  5289. <number>210</number>
  5290. <stanza>presence</stanza>
  5291. <context>Entering a room, changing nickname, etc.</context>
  5292. <purpose>
  5293. Inform user that service has assigned or modified occupant's roomnick
  5294. </purpose>
  5295. </statuscode>
  5296. <statuscode>
  5297. <number>301</number>
  5298. <stanza>presence</stanza>
  5299. <context>Removal from room</context>
  5300. <purpose>
  5301. Inform user that he or she has been banned from the room
  5302. </purpose>
  5303. </statuscode>
  5304. <statuscode>
  5305. <number>303</number>
  5306. <stanza>presence</stanza>
  5307. <context>Exiting a room</context>
  5308. <purpose>
  5309. Inform all occupants of new room nickname
  5310. </purpose>
  5311. </statuscode>
  5312. <statuscode>
  5313. <number>307</number>
  5314. <stanza>presence</stanza>
  5315. <context>Removal from room</context>
  5316. <purpose>
  5317. Inform user that he or she has been kicked from the room
  5318. </purpose>
  5319. </statuscode>
  5320. <statuscode>
  5321. <number>321</number>
  5322. <stanza>presence</stanza>
  5323. <context>Removal from room</context>
  5324. <purpose>
  5325. Inform user that he or she is being removed from the room
  5326. because of an affiliation change
  5327. </purpose>
  5328. </statuscode>
  5329. <statuscode>
  5330. <number>322</number>
  5331. <stanza>presence</stanza>
  5332. <context>Removal from room</context>
  5333. <purpose>
  5334. Inform user that he or she is being removed from the room
  5335. because the room has been changed to members-only and the
  5336. user is not a member
  5337. </purpose>
  5338. </statuscode>
  5339. <statuscode>
  5340. <number>332</number>
  5341. <stanza>presence</stanza>
  5342. <context>Removal from room</context>
  5343. <purpose>
  5344. Inform user that he or she is being removed from the room
  5345. because the MUC service is being shut down
  5346. </purpose>
  5347. </statuscode>
  5348. <statuscode>
  5349. <number>333</number>
  5350. <stanza>presence</stanza>
  5351. <context>Removal from room</context>
  5352. <purpose>
  5353. Inform users that a user was removed because of an error reply (for example
  5354. when an s2s link fails between the MUC and the removed users server).
  5355. </purpose>
  5356. </statuscode>
  5357. ]]></code>
  5358. </section3>
  5359. </section2>
  5360. <section2 topic='URI Query Types' anchor='registrar-querytypes'>
  5361. <p>As authorized by &xep0147;, the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see &QUERYTYPES;).</p>
  5362. <section3 topic='join' anchor='registrar-querytypes-join'>
  5363. <p>The "join" querytype is registered as a MUC-related action, with an optional key of "password".</p>
  5364. <example caption='Join Action: IRI/URI'><![CDATA[
  5365. xmpp:coven@chat.shakespeare.lit?join
  5366. ]]></example>
  5367. <p>The application MUST either present an interface enabling the user to provide a room nickname or populate the room nickname based on configured preferences or nickname discovery.</p>
  5368. <example caption='Join Action: Resulting Stanza'><![CDATA[
  5369. <presence to='coven@chat.shakespeare.lit/thirdwitch'>
  5370. <x xmlns='http://jabber.org/protocol/muc'/>
  5371. </presence>
  5372. ]]></example>
  5373. <p>The join action MAY include a password for the room. Naturally, access to a URI that includes a room password MUST be appropriately controlled.</p>
  5374. <example caption='Join Action with Password: IRI/URI'><![CDATA[
  5375. xmpp:coven@chat.shakespeare.lit?join;password=cauldronburn
  5376. ]]></example>
  5377. <example caption='Join Action with Password: Resulting Stanza'><![CDATA[
  5378. <presence to='coven@chat.shakespeare.lit/thirdwitch'>
  5379. <x xmlns='http://jabber.org/protocol/muc'>
  5380. <password>cauldronburn</password>
  5381. </x>
  5382. </presence>
  5383. ]]></example>
  5384. <p>The following submission registers the "join" querytype.</p>
  5385. <code><![CDATA[
  5386. <querytype>
  5387. <name>join</name>
  5388. <proto>http://jabber.org/protocol/muc</proto>
  5389. <desc>enables joining a multi-user chat room</desc>
  5390. <doc>XEP-0045</doc>
  5391. <keys>
  5392. <key>
  5393. <name>password</name>
  5394. <desc>the password required to enter the room</desc>
  5395. </key>
  5396. </keys>
  5397. </querytype>
  5398. ]]></code>
  5399. </section3>
  5400. <section3 topic='invite' anchor='registrar-querytypes-invite'>
  5401. <p>The "invite" querytype is registered as a MUC-related action, with an optional key of "jid".</p>
  5402. <example caption='Invite Action: IRI/URI'><![CDATA[
  5403. xmpp:coven@chat.shakespeare.lit?invite;jid=hecate@shakespeare.lit
  5404. ]]></example>
  5405. <p>If the joining user is not yet in the room, the application MUST send two stanzas: the first to join the room and the second to invite the other individual. If the joining user is in the room already, the application shall send only the invitation stanza.</p>
  5406. <example caption='Invite Action: Resulting Stanza(s)'><![CDATA[
  5407. <presence to='coven@chat.shakespeare.lit/thirdwitch'>
  5408. <x xmlns='http://jabber.org/protocol/muc'/>
  5409. </presence>
  5410. <message to='coven@chat.shakespeare.lit'>
  5411. <x xmlns='http://jabber.org/protocol/muc#user'>
  5412. <invite to='hecate@shakespeare.lit'/>
  5413. </x>
  5414. </message>
  5415. ]]></example>
  5416. <p>The URI can include multiple invitees:</p>
  5417. <example caption='Invite Action With Multiple Invitees: IRI/URI'><![CDATA[
  5418. xmpp:coven@chat.shakespeare.lit?invite;jid=hecate@shakespeare.lit;jid=bard@shakespeare.lit
  5419. ]]></example>
  5420. <example caption='Invite Action With Multiple Invitees: Resulting Stanza'><![CDATA[
  5421. <message to='coven@chat.shakespeare.lit'>
  5422. <x xmlns='http://jabber.org/protocol/muc#user'>
  5423. <invite to='hecate@shakespeare.lit'/>
  5424. <invite to='bard@shakespeare.lit'/>
  5425. </x>
  5426. </message>
  5427. ]]></example>
  5428. <p>The URI can also include a password:</p>
  5429. <example caption='Invite Action With Password: IRI/URI'><![CDATA[
  5430. xmpp:coven@chat.shakespeare.lit?invite;jid=hecate@shakespeare.lit;password=cauldronburn
  5431. ]]></example>
  5432. <example caption='Invite Action With Password: Resulting Stanza(s)'><![CDATA[
  5433. <presence to='coven@chat.shakespeare.lit/thirdwitch'>
  5434. <x xmlns='http://jabber.org/protocol/muc'/>
  5435. </presence>
  5436. <message to='coven@chat.shakespeare.lit'>
  5437. <x xmlns='http://jabber.org/protocol/muc#user'>
  5438. <invite to='hecate@shakespeare.lit'/>
  5439. <password>cauldronburn</password>
  5440. </x>
  5441. </message>
  5442. ]]></example>
  5443. <p>The following submission registers the "invite" querytype.</p>
  5444. <code><![CDATA[
  5445. <querytype>
  5446. <name>invite</name>
  5447. <proto>http://jabber.org/protocol/muc</proto>
  5448. <desc>enables simultaneously joining a groupchat room and inviting others</desc>
  5449. <doc>XEP-0045</doc>
  5450. <keys>
  5451. <key>
  5452. <name>jid</name>
  5453. <desc>the Jabber ID of the invitee</desc>
  5454. </key>
  5455. <key>
  5456. <name>password</name>
  5457. <desc>the password required to enter a multi-user chat room</desc>
  5458. </key>
  5459. </keys>
  5460. </querytype>
  5461. ]]></code>
  5462. </section3>
  5463. </section2>
  5464. </section1>
  5465. <section1 topic='Business Rules' anchor='bizrules'>
  5466. <section2 topic='Addresses' anchor='bizrules-jids'>
  5467. <p>In order to provide consistency regarding the addresses captured in room JIDs and occupant JIDs, Room IDs MUST match the Nodeprep profile of Stringprep and Room Nicknames MUST match the Resourceprep profile of Stringprep (both of these are defined in <cite>RFC 6122</cite>). As explicitly stated in <cite>RFC 6122</cite>, both the Room ID (node) and Room Nickname (resource) portions of an Occupant JID MUST be of non-zero length. In addition, a MUC service MUST NOT allow empty or invisible Room Nicknames (i.e., Room Nicknames that consist only of one or more space characters).</p>
  5468. <p>It is up to the service implementation whether it will further restrict roomnicks (e.g., by applying case folding routines, the Nodeprep profile of stringprep, or other restrictions).</p>
  5469. </section2>
  5470. <section2 topic='Message' anchor='bizrules-message'>
  5471. <ol start='1'>
  5472. <li><p>If an occupant wants to send a message to all other occupants, a MUC client MUST set the 'type' attribute to a value of "groupchat". A service MAY ignore messages that are improperly typed, or reject them with a &badrequest; error.</p></li>
  5473. <li><p>If a MUC service receives a message directed to the room or to a single occupant from a user who has a role of "none", the service MUST NOT deliver the message and SHOULD return the message to the sender with a &forbidden; error.</p></li>
  5474. <li><p>If a MUC service receives a message directed to a room that does not exist or is not yet unlocked, the service SHOULD return the message to the sender with an &notfound; error.</p></li>
  5475. <li><p>A MUC service SHOULD pass extended information (e.g., an XHTML version of the message body) through to occupants unchanged; however, a MUC service MAY disallow message specific extensions (see the <link url='#impl-service-traffic'>Allowable Traffic</link> section of this document).</p></li>
  5476. <li><p>A MUC client MAY generate extensions that conform to &xep0085; specification; however, a MUC service MAY disallow these extensions (see the <link url='#impl-service-traffic'>Allowable Traffic</link> section of this document).</p></li>
  5477. </ol>
  5478. </section2>
  5479. <section2 topic='Presence' anchor='bizrules-presence'>
  5480. <ol start='1'>
  5481. <li><p>The presence stanza used to join a room MUST NOT possess a 'type' attribute, i.e., it must be available presence. A MUC service MUST NOT treat a presence stanza with a 'type' attribute (e.g., a presence probe) as a request to join the room.</p></li>
  5482. <li><p>The presence stanza used to exit a room MUST possess a 'type' attribute whose value is "unavailable". A MUC service MUST NOT treat a presence stanza with a 'type' attribute whose value is other than "unavailable" (e.g., a presence probe) as a request to exit the room.</p></li>
  5483. <li><p>If a MUC service receives a Basic MUC Protocol join request from a client that is already joined, it MUST treat it as a full synchronization request, and send to the client everything that would be sent to it on a normal join. The MUC service SHOULD send a presence update to the other participants if the join presence is different from the client's previous presence.</p></li>
  5484. <li><p>A MUC service MAY handle presence probes sent to the room JID &ROOMJID; or an occupant JID &OCCUPANTJID; (e.g, these might be sent by an occupant's home server to determine if the room is still online or to synchronize presence information if the user or the user's server has gone offline temporarily or has started sharing presence again, as for instance when &xep0273; is used).</p></li>
  5485. <li><p>A room MUST silently ignore unavailable presence received from a user who has a role of "none".</p></li>
  5486. <li><p>Only the MUC service itself SHOULD generate data about roles, affiliations, full JIDs, or status codes qualified by the 'http://jabber.org/protocol/muc#user' namespace (based on information the service knows about occupants, e.g., roles, or as a result of actions taken by a moderator or room administrator). A client SHOULD NOT presume to generate such information. If a MUC service receives such extended presence information from an occupant, it MUST NOT reflect it to other occupants. (A client MAY generate extended presence information qualified by the 'http://jabber.org/protocol/muc#user' namespace in order to supply a password, but naturally this is not reflected to other occupants.)</p></li>
  5487. <li><p>A MUC service SHOULD allow all other presence information to pass through, although it MAY choose to block extended presence information; see the <link url='#impl-service-traffic'>Allowable Traffic</link> section of this document.</p></li>
  5488. <li><p>In order to inform occupants of room roles and affiliations, and to make it easier for clients to track the current state of all users in the room, MUC service implementations MUST provide role and affiliation data (and, if allowed by the room configuration, full JID) in all presence stanzas, including presence stanzas of type "unavailable" sent when a user exits the room for any reason.</p></li>
  5489. <li><p>If a role or affiliation is revoked, the service MUST note that fact by sending an &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an &lt;item/&gt; child element with the 'role' and/or 'affiliation' attributes set to a value that indicates the loss of the relevant status. All future presence stanzas for the occupant MUST include the updated role and affiliation, until and unless they change again.</p></li>
  5490. <li><p>A MUC service MUST include the MUC extensions even if the client did not send an empty &lt;x/&gt; element qualified by the 'http://jabber.org/protocol/muc' namespace on entering the room; naturally, a client MUST ignore such information if it does not understand it (in accordance with <cite>RFC 6120</cite>).</p></li>
  5491. <li><p>If the service includes an occupant's JabberID in the MUC presence extension, the value of the 'jid' attribute MUST be the full JID (not the bare JID).</p></li>
  5492. <li><p>A client MAY send a custom exit message if desired (as is often done in IRC channels) by including a &lt;status/&gt; element in the presence stanza of type "unavailable" sent when <link url='#exit'>exiting a room</link>.</p></li>
  5493. </ol>
  5494. </section2>
  5495. <section2 topic='IQ' anchor='bizrules-iq'>
  5496. <ol start='1'>
  5497. <li><p>MUC is designed for sharing of messages and presence, not IQs. An IQ sent to the JID of the room itself is handled by the room and is not reflected to all of the room occupants.</p></li>
  5498. <li><p>If an occupant wants to send an IQ stanza to another user in a non-anonymous room, the sender SHOULD send the request directly to the recipient's bare JID or full JID, rather than attempting to send the request through the room (i.e., via the recipient's occupant JID).</p></li>
  5499. <li><p>If an occupant wants to send an IQ stanza to another user in a semi-anonymous room, the sender can direct the stanza to the recipient's occupant JID and the service SHOULD forward the stanza to the recipient's real JID. However, the MUC service MUST NOT reveal the sender's real JID to the recipient at any time, nor reveal the recipient's real JID to the sender.</p></li>
  5500. <li><p>A MUC client MUST send only the 'affiliation' attribute or the 'role' attribute in the &lt;item/&gt; element contained within an IQ set qualified by the 'http://jabber.org/protocol/muc#admin' namespace; if a moderator, admin, or owner attempts to modify both the affiliation and role of the same item in the same IQ set, the service MUST return a &badrequest; error to the sender. However, the MUC service MAY modify a role based on a change to an affiliation and thus MAY send presence updates that include both a modified role and a modified affiliation.</p></li>
  5501. <li><p>In IQ sets regarding roles, a MUC client MUST include the 'nick' attribute only; in IQ results regarding roles, a MUC service MUST include the 'nick', 'role', 'affiliation', and 'jid' attributes (with the value of the latter set to the user's full JID).</p></li>
  5502. <li><p>In IQ sets regarding affiliations, a MUC client MUST include the 'jid' attribute only (with the value set to the bare JID); in IQ results regarding affiliations, a MUC service MUST NOT include the 'role' attribute, MUST include the 'affiliation' attribute and the 'jid' attribute (with the value set to the bare JID), and SHOULD include the 'nick' attribute (except if the affiliation is "outcast", since outcasts SHOULD NOT have reserved nicknames).</p></li>
  5503. </ol>
  5504. </section2>
  5505. </section1>
  5506. <section1 topic='Implementation Notes' anchor='impl'>
  5507. <p>The following guidelines are intended to assist client and service developers in creating MUC implementations.</p>
  5508. <section2 topic='Services' anchor='impl-service'>
  5509. <ol start='1'>
  5510. <li><p>In handling messages sent by visitors in a moderated room, a MUC service MAY queue each message for approval by a moderator and MAY inform the sender that the message is being held for approval; however, such behavior is OPTIONAL, and definition of a message approval protocol (e.g., using Data Forms as defined in <cite>XEP-0004</cite>) is out of scope for this document.</p></li>
  5511. <li><p>Out of courtesy, a MUC service MAY send an out-of-room &lt;message/&gt; if a user's affiliation changes while the user is not in the room; the message SHOULD be sent from the room to the user's bare JID, MAY contain a &lt;body/&gt; element describing the affiliation change, and MUST contain a status code of 101.</p></li>
  5512. <li><p>There is no requirement that a MUC service shall provide special treatment for users of the older groupchat 1.0 protocol, such as messages that contain equivalents to the extended presence information that is qualified by the 'http://jabber.org/protocol/muc#user' namespace.</p></li>
  5513. <li><p>Room types MAY be configured in any combination. A MUC service MAY support or allow any desired room types or combinations thereof. There is no guarantee that any such combination is sensible.</p></li>
  5514. <li><p>A MUC service MAY limit the number of configuration options presented to an owner after initial configuration has been completed, e.g. because certain options cannot take effect without restarting the service.</p></li>
  5515. <li><p>A MUC service MAY provide an interface to room creation and configuration (e.g., in the form of a special XMPP entity or a Web page), so that the ostensible room owner is actually the application instead of a human user.</p></li>
  5516. <li><p>A MUC service MAY choose to make available a special in-room resource that provides an interface to administrative functionality (e.g., a "user" named "ChatBot"), which occupants could interact with directly, thus enabling admins to type <tt>'/command parameter'</tt> in a private message to that "user". Obviously this kind of implementation would require the service to add a 'ChatBot' user to the room when it is created, and to prevent any occupant from having the nickname 'ChatBot' in the room. This might be difficult to ensure in some implementations or deployments. In any case, any such interface is OPTIONAL.</p></li>
  5517. <li><p>A MUC service MAY choose to discard extended presence information that is attached to a &PRESENCE; stanza before reflecting the presence change to the occupants of a room. That is, an implementation MAY choose to reflect only the &lt;show/&gt;, &lt;status/&gt;, and &lt;priority/&gt; child elements of the presence element as specified in the XML schema for the 'jabber:client' namespace, with the result that presence "changes" in extended namespaces (e.g., gabber:x:music:info) are not passed through to occupants. If a service prohibits certain extended namespaces, it SHOULD provide a description of allowable traffic at the well-known Service Discovery node 'http://jabber.org/protocol/muc#traffic' as described in the <link url='#impl-service-traffic'>Allowable Traffic</link> section of this document.</p></li>
  5518. <li><p>A MUC service MAY choose to discard extended information attached to a &MESSAGE; stanza before reflecting the message to the occupants of a room. An example of such extended information is the lightweight text markup specified by &xep0071;. If a service prohibits certain extended namespaces, it SHOULD provide a description of allowable traffic at the well-known Service Discovery node 'http://jabber.org/protocol/muc#traffic' as described in the <link url='#impl-service-traffic'>Allowable Traffic</link> section of this document.</p></li>
  5519. <li><p>A MUC service MAY choose to "lock down" room nicknames (e.g., hardcoding the room nickname to the bare JID of the occupant). If so, the service MUST treat the locked nickname as a reserved room nickname and MUST support the protocol specified in the <link url='#reservednick'>Discovering Reserved Room Nickname</link> section of this document.</p></li>
  5520. </ol>
  5521. <section3 topic='Allowable Traffic' anchor='impl-service-traffic'>
  5522. <p>As noted, a service (more precisely, a properly-configured room) MAY discard some or all extended namespaces attached to &MESSAGE; and &PRESENCE; stanzas that are intended for reflection from the sender through the room to all of the room occupants. If the room does so, it SHOULD enable senders to discover the list of allowable extensions by sending a disco#info query to the well-known Service Discovery node 'http://jabber.org/protocol/muc#traffic', returning one &lt;feature/&gt; element for each namespace supported in the result. If the room does not allow any extended namespaces, it MUST return an empty query as specified in <cite>XEP-0030</cite>. If the room does not support the "#traffic" node, it MUST return a &feature; error in response to queries sent to the 'http://jabber.org/protocol/muc#traffic' node.</p>
  5523. <p>The following example shows a room that allows the 'http://jabber.org/protocol/xhtml-im' and 'http://jabber.org/protocol/rosterx' namespaces only, but no other extended namespaces.</p>
  5524. <example caption='User Queries Service Regarding Allowable Namespaces'><![CDATA[
  5525. <iq from='wiccarocks@shakespeare.lit/laptop'
  5526. to='heath@chat.shakespeare.lit'
  5527. id='allow1'
  5528. type='get'>
  5529. <query xmlns='http://jabber.org/protocol/disco#info'
  5530. node='http://jabber.org/protocol/muc#traffic'/>
  5531. </iq>
  5532. ]]></example>
  5533. <example caption='Service Returns Allowable Namespaces'><![CDATA[
  5534. <iq from='heath@chat.shakespeare.lit'
  5535. to='wiccarocks@shakespeare.lit/laptop'
  5536. id='allow1'
  5537. type='result'>
  5538. <query xmlns='http://jabber.org/protocol/disco#info'
  5539. node='http://jabber.org/protocol/muc#traffic'>
  5540. <feature var='http://jabber.org/protocol/xhtml-im'/>
  5541. <feature var='http://jabber.org/protocol/rosterx'/>
  5542. </query>
  5543. </iq>
  5544. ]]></example>
  5545. <p>If a service does not discard any namespaces, it MUST return a &unavailable; error:</p>
  5546. <example caption='Service Returns Service Unavailable'><![CDATA[
  5547. <iq from='heath@chat.shakespeare.lit'
  5548. to='wiccarocks@shakespeare.lit/laptop'
  5549. id='allow1'
  5550. type='error'>
  5551. <error type='cancel'>
  5552. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  5553. </error>
  5554. </iq>
  5555. ]]></example>
  5556. </section3>
  5557. <section3 topic='Ghost Users' anchor='impl-service-ghosts'>
  5558. <p>Deployment experience has shown that sometimes a user can appear to be an occupant in a room even though the user's real JID has gone offline since joining. Such users are called "ghosts". To help prevent ghost users, a MUC service SHOULD remove a user if the service receives a delivery-related error in relation to a stanza it has previously sent to the user (in this context, the delivery-related errors are &gone;, &notfound;, &recipient;, &redirect;, &remoteserver;, and &timeout;). A MUC service MAY also use &xep0199; or similar methods to periodically check the availability of room occupants. If the MUC service determines that the user has gone offline, it must treat the user as if the user had itself sent unavailable presence.</p>
  5559. </section3>
  5560. </section2>
  5561. <section2 topic='Clients' anchor='impl-client'>
  5562. <ol start='1'>
  5563. <li><p>Clients MAY present room roles by showing ad-hoc groups for each role within a room roster. This will enable occupants to clearly visualize which occupants are moderators, participants, and visitors. However, such a representation is OPTIONAL.</p></li>
  5564. <li><p>Clients MAY implement a variety of interface styles that provide "shortcuts" to functionality such as changing one's nickname, kicking or banning users, discovering an occupant's full JID, or changing the subject. One option consists of IRC-style commands such as '/nick', '/kick', '/ban', and '/whois'; another is to enable a user to right-click items in a room roster. All such interface styles are OPTIONAL. However, for convenience, a mapping of IRC commands to MUC protocols is provided below.</p></li>
  5565. </ol>
  5566. <section3 topic='IRC Command Mapping' anchor='impl-client-irc'>
  5567. <p>Internet Relay Chat clients use a number of common "shortcut" commands that begin with a forward slash, such as '/nick' and '/ban'. The following table provides a mapping of IRC-style commands to MUC protocols, for use by clients that wish to support such functionality.</p>
  5568. <table caption='IRC Command Mapping'>
  5569. <tr>
  5570. <th>Command</th>
  5571. <th>Function</th>
  5572. <th>MUC protocol</th>
  5573. </tr>
  5574. <tr>
  5575. <td>/ban &lt;roomnick&gt; [comment]</td>
  5576. <td>bans user with that roomnick from this room (client translates roomnick to bare JID)</td>
  5577. <td><code><![CDATA[
  5578. <iq id='someid'
  5579. to='room@service'
  5580. type='set'>
  5581. <query xmlns='http://jabber.org/protocol/muc#admin'>
  5582. <item affiliation='outcast'
  5583. jid='bare-jid-of-user'>
  5584. <reason>comment</reason>
  5585. </item>
  5586. </query>
  5587. </iq>
  5588. ]]></code></td>
  5589. </tr>
  5590. <tr>
  5591. <td>/invite &lt;jid&gt; [comment]</td>
  5592. <td>invites user with that JID to this room</td>
  5593. <td><code><![CDATA[
  5594. <message to='room@service'>
  5595. <x xmlns='http://jabber.org/protocol/muc#user'>
  5596. <invite to='jid'>
  5597. <reason>comment</reason>
  5598. </invite>
  5599. </x>
  5600. </message>
  5601. ]]></code></td>
  5602. </tr>
  5603. <tr>
  5604. <td>/join &lt;roomname&gt; [pass]</td>
  5605. <td>joins room on this service (roomnick is same as nick in this room)</td>
  5606. <td><code><![CDATA[
  5607. <presence to='room@service/nick'>
  5608. <x xmlns='http://jabber.org/protocol/muc#user'>
  5609. <password>pass</password>
  5610. </x>
  5611. </presence>
  5612. ]]></code></td>
  5613. </tr>
  5614. <tr>
  5615. <td>/kick &lt;roomnick&gt; [comment]</td>
  5616. <td>kicks user with that roomnick from this room</td>
  5617. <td><code><![CDATA[
  5618. <iq id='someid'
  5619. to='room@service'
  5620. type='set'>
  5621. <query xmlns='http://jabber.org/protocol/muc#admin'>
  5622. <item nick='roomnick' role='none'>
  5623. <reason>comment</reason>
  5624. </item>
  5625. </query>
  5626. </iq>
  5627. ]]></code></td>
  5628. </tr>
  5629. <tr>
  5630. <td>/msg &lt;roomnick&gt; &lt;foo&gt;</td>
  5631. <td>sends private message "foo" to roomnick</td>
  5632. <td><code><![CDATA[
  5633. <message to='room@service/nick' type='chat'>
  5634. <body>foo</body>
  5635. </message>
  5636. ]]></code></td>
  5637. </tr>
  5638. <tr>
  5639. <td>/nick &lt;newnick&gt;</td>
  5640. <td>changes nick in this room to "newnick"</td>
  5641. <td><code><![CDATA[
  5642. <presence to='room@service/newnick'/>
  5643. ]]></code></td>
  5644. </tr>
  5645. <tr>
  5646. <td>/part [comment]</td>
  5647. <td>exits this room (some IRC clients also support /leave)</td>
  5648. <td><code><![CDATA[
  5649. <presence to='room@service/nick'
  5650. type='unavailable'>
  5651. <status>comment</status>
  5652. </presence>
  5653. ]]></code></td>
  5654. </tr>
  5655. <tr>
  5656. <td>/topic &lt;foo&gt;</td>
  5657. <td>changes subject of this room to "foo"</td>
  5658. <td><code><![CDATA[
  5659. <message to='room@service' type='groupchat'>
  5660. <subject>foo</subject>
  5661. </message>
  5662. ]]></code></td>
  5663. </tr>
  5664. </table>
  5665. <p>Note: Because MUC roomnicks follow the Resourceprep profile of stringprep, they are allowed to contain a space character, whereas IRC nicknames do not. Although a given client MAY support quotation characters for this purpose (resulting in commands such as '/ban "king lear" insanity is no defense'), most common quotation characters (such as " and ') are also allowed by Resourceprep, thus leading to added complexity and potential problems with quotation of roomnicks that contain both spaces and quotation characters. Therefore it is NOT RECOMMENDED for XMPP clients to support IRC-style shortcut commands with roomnicks that contain space characters.</p>
  5666. <p>Note: Many XMPP clients also implement a '/me ' command as described in &xep0245;. This command does not result in any MUC or IRC protocol action and is therefore not shown in the foregoing table.</p>
  5667. </section3>
  5668. <section3 topic='Presence Subscriptions' anchor='impl-client-presence'>
  5669. <p>In XMPP, presence subscriptions are used to share network availability information between end users (see &rfc6121;). In XMPP groupchat, the presence employed is of a special type: directed presence rather than presence subscriptions. However, an IM user can also subscribe to the presence of a chatroom, which introduces the useful property that the user will be notified when a room comes back online after a crash or other outage, thus facilitating the feature of automatically re-joining the room. Although MUC clients and servers have not traditionally implemented presence subscriptions, developers are encouraged to consider adding such support.</p>
  5670. </section3>
  5671. </section2>
  5672. </section1>
  5673. <section1 topic='XML Schemas' anchor='schemas'>
  5674. <section2 topic='http://jabber.org/protocol/muc' anchor='schemas-muc'>
  5675. <code><![CDATA[
  5676. <?xml version='1.0' encoding='UTF-8'?>
  5677. <xs:schema
  5678. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  5679. targetNamespace='http://jabber.org/protocol/muc'
  5680. xmlns='http://jabber.org/protocol/muc'
  5681. elementFormDefault='qualified'>
  5682. <xs:annotation>
  5683. <xs:documentation>
  5684. The protocol documented by this schema is defined in
  5685. XEP-0045: http://www.xmpp.org/extensions/xep-0045.html
  5686. </xs:documentation>
  5687. </xs:annotation>
  5688. <xs:element name='x'>
  5689. <xs:complexType>
  5690. <xs:sequence>
  5691. <xs:element ref='history' minOccurs='0'/>
  5692. <xs:element name='password' type='xs:string' minOccurs='0'/>
  5693. </xs:sequence>
  5694. </xs:complexType>
  5695. </xs:element>
  5696. <xs:element name='history'>
  5697. <xs:complexType>
  5698. <xs:simpleContent>
  5699. <xs:extension base='empty'>
  5700. <xs:attribute name='maxchars' type='xs:int' use='optional'/>
  5701. <xs:attribute name='maxstanzas' type='xs:int' use='optional'/>
  5702. <xs:attribute name='seconds' type='xs:int' use='optional'/>
  5703. <xs:attribute name='since' type='xs:dateTime' use='optional'/>
  5704. </xs:extension>
  5705. </xs:simpleContent>
  5706. </xs:complexType>
  5707. </xs:element>
  5708. <xs:simpleType name='empty'>
  5709. <xs:restriction base='xs:string'>
  5710. <xs:enumeration value=''/>
  5711. </xs:restriction>
  5712. </xs:simpleType>
  5713. </xs:schema>
  5714. ]]></code>
  5715. </section2>
  5716. <section2 topic='http://jabber.org/protocol/muc#user' anchor='schemas-user'>
  5717. <code><![CDATA[
  5718. <?xml version='1.0' encoding='UTF-8'?>
  5719. <xs:schema
  5720. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  5721. targetNamespace='http://jabber.org/protocol/muc#user'
  5722. xmlns='http://jabber.org/protocol/muc#user'
  5723. elementFormDefault='qualified'>
  5724. <xs:annotation>
  5725. <xs:documentation>
  5726. The protocol documented by this schema is defined in
  5727. XEP-0045: http://www.xmpp.org/extensions/xep-0045.html
  5728. </xs:documentation>
  5729. </xs:annotation>
  5730. <xs:element name='x'>
  5731. <xs:complexType>
  5732. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  5733. <xs:element ref='decline' minOccurs='0'/>
  5734. <xs:element ref='destroy' minOccurs='0'/>
  5735. <xs:element ref='invite' minOccurs='0' maxOccurs='unbounded'/>
  5736. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  5737. <xs:element name='password' type='xs:string' minOccurs='0'/>
  5738. <xs:element ref='status' minOccurs='0' maxOccurs='unbounded'/>
  5739. </xs:choice>
  5740. </xs:complexType>
  5741. </xs:element>
  5742. <xs:element name='decline'>
  5743. <xs:complexType>
  5744. <xs:sequence>
  5745. <xs:element ref='reason' minOccurs='0'/>
  5746. </xs:sequence>
  5747. <xs:attribute name='from' type='xs:string' use='optional'/>
  5748. <xs:attribute name='to' type='xs:string' use='optional'/>
  5749. </xs:complexType>
  5750. </xs:element>
  5751. <xs:element name='destroy'>
  5752. <xs:complexType>
  5753. <xs:sequence>
  5754. <xs:element ref='reason' minOccurs='0'/>
  5755. </xs:sequence>
  5756. <xs:attribute name='jid' type='xs:string' use='optional'/>
  5757. </xs:complexType>
  5758. </xs:element>
  5759. <xs:element name='invite'>
  5760. <xs:complexType>
  5761. <xs:sequence>
  5762. <xs:element ref='reason' minOccurs='0'/>
  5763. </xs:sequence>
  5764. <xs:attribute name='from' type='xs:string' use='optional'/>
  5765. <xs:attribute name='to' type='xs:string' use='optional'/>
  5766. </xs:complexType>
  5767. </xs:element>
  5768. <xs:element name='item'>
  5769. <xs:complexType>
  5770. <xs:sequence>
  5771. <xs:element ref='actor' minOccurs='0'/>
  5772. <xs:element ref='continue' minOccurs='0'/>
  5773. <xs:element ref='reason' minOccurs='0'/>
  5774. </xs:sequence>
  5775. <xs:attribute name='affiliation' use='optional'>
  5776. <xs:simpleType>
  5777. <xs:restriction base='xs:NCName'>
  5778. <xs:enumeration value='admin'/>
  5779. <xs:enumeration value='member'/>
  5780. <xs:enumeration value='none'/>
  5781. <xs:enumeration value='outcast'/>
  5782. <xs:enumeration value='owner'/>
  5783. </xs:restriction>
  5784. </xs:simpleType>
  5785. </xs:attribute>
  5786. <xs:attribute name='jid' type='xs:string' use='optional'/>
  5787. <xs:attribute name='nick' type='xs:string' use='optional'/>
  5788. <xs:attribute name='role' use='optional'>
  5789. <xs:simpleType>
  5790. <xs:restriction base='xs:NCName'>
  5791. <xs:enumeration value='moderator'/>
  5792. <xs:enumeration value='none'/>
  5793. <xs:enumeration value='participant'/>
  5794. <xs:enumeration value='visitor'/>
  5795. </xs:restriction>
  5796. </xs:simpleType>
  5797. </xs:attribute>
  5798. </xs:complexType>
  5799. </xs:element>
  5800. <xs:element name='actor'>
  5801. <xs:complexType>
  5802. <xs:simpleContent>
  5803. <xs:extension base='empty'>
  5804. <xs:attribute name='jid' type='xs:string' use='optional'/>
  5805. <xs:attribute name='nick' type='xs:string' use='optional'/>
  5806. </xs:extension>
  5807. </xs:simpleContent>
  5808. </xs:complexType>
  5809. </xs:element>
  5810. <xs:element name='continue'>
  5811. <xs:complexType>
  5812. <xs:simpleContent>
  5813. <xs:extension base='empty'>
  5814. <xs:attribute name='thread' type='xs:string' use='optional'/>
  5815. </xs:extension>
  5816. </xs:simpleContent>
  5817. </xs:complexType>
  5818. </xs:element>
  5819. <xs:element name='status'>
  5820. <xs:complexType>
  5821. <xs:attribute name='code' use='required'>
  5822. <xs:simpleType>
  5823. <xs:restriction base='xs:int'>
  5824. <xs:minInclusive value='100'/>
  5825. <xs:maxInclusive value='999'/>
  5826. </xs:restriction>
  5827. </xs:simpleType>
  5828. </xs:attribute>
  5829. </xs:complexType>
  5830. </xs:element>
  5831. <xs:element name='reason' type='xs:string'/>
  5832. <xs:simpleType name='empty'>
  5833. <xs:restriction base='xs:string'>
  5834. <xs:enumeration value=''/>
  5835. </xs:restriction>
  5836. </xs:simpleType>
  5837. </xs:schema>
  5838. ]]></code>
  5839. </section2>
  5840. <section2 topic='http://jabber.org/protocol/muc#admin' anchor='schemas-admin'>
  5841. <code><![CDATA[
  5842. <?xml version='1.0' encoding='UTF-8'?>
  5843. <xs:schema
  5844. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  5845. targetNamespace='http://jabber.org/protocol/muc#admin'
  5846. xmlns='http://jabber.org/protocol/muc#admin'
  5847. elementFormDefault='qualified'>
  5848. <xs:annotation>
  5849. <xs:documentation>
  5850. The protocol documented by this schema is defined in
  5851. XEP-0045: http://www.xmpp.org/extensions/xep-0045.html
  5852. </xs:documentation>
  5853. </xs:annotation>
  5854. <xs:element name='query'>
  5855. <xs:complexType>
  5856. <xs:sequence>
  5857. <xs:element ref='item' maxOccurs='unbounded'/>
  5858. </xs:sequence>
  5859. </xs:complexType>
  5860. </xs:element>
  5861. <xs:element name='item'>
  5862. <xs:complexType>
  5863. <xs:sequence>
  5864. <xs:element ref='actor' minOccurs='0'/>
  5865. <xs:element ref='reason' minOccurs='0'/>
  5866. </xs:sequence>
  5867. <xs:attribute name='affiliation' use='optional'>
  5868. <xs:simpleType>
  5869. <xs:restriction base='xs:NCName'>
  5870. <xs:enumeration value='admin'/>
  5871. <xs:enumeration value='member'/>
  5872. <xs:enumeration value='none'/>
  5873. <xs:enumeration value='outcast'/>
  5874. <xs:enumeration value='owner'/>
  5875. </xs:restriction>
  5876. </xs:simpleType>
  5877. </xs:attribute>
  5878. <xs:attribute name='jid' type='xs:string' use='optional'/>
  5879. <xs:attribute name='nick' type='xs:string' use='optional'/>
  5880. <xs:attribute name='role' use='optional'>
  5881. <xs:simpleType>
  5882. <xs:restriction base='xs:NCName'>
  5883. <xs:enumeration value='moderator'/>
  5884. <xs:enumeration value='none'/>
  5885. <xs:enumeration value='participant'/>
  5886. <xs:enumeration value='visitor'/>
  5887. </xs:restriction>
  5888. </xs:simpleType>
  5889. </xs:attribute>
  5890. </xs:complexType>
  5891. </xs:element>
  5892. <xs:element name='actor'>
  5893. <xs:complexType>
  5894. <xs:simpleContent>
  5895. <xs:extension base='empty'>
  5896. <xs:attribute name='jid' type='xs:string' use='optional'/>
  5897. <xs:attribute name='nick' type='xs:string' use='optional'/>
  5898. </xs:extension>
  5899. </xs:simpleContent>
  5900. </xs:complexType>
  5901. </xs:element>
  5902. <xs:element name='reason' type='xs:string'/>
  5903. <xs:simpleType name='empty'>
  5904. <xs:restriction base='xs:string'>
  5905. <xs:enumeration value=''/>
  5906. </xs:restriction>
  5907. </xs:simpleType>
  5908. </xs:schema>
  5909. ]]></code>
  5910. </section2>
  5911. <section2 topic='http://jabber.org/protocol/muc#owner' anchor='schemas-owner'>
  5912. <code><![CDATA[
  5913. <?xml version='1.0' encoding='UTF-8'?>
  5914. <xs:schema
  5915. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  5916. targetNamespace='http://jabber.org/protocol/muc#owner'
  5917. xmlns='http://jabber.org/protocol/muc#owner'
  5918. elementFormDefault='qualified'>
  5919. <xs:annotation>
  5920. <xs:documentation>
  5921. The protocol documented by this schema is defined in
  5922. XEP-0045: http://www.xmpp.org/extensions/xep-0045.html
  5923. </xs:documentation>
  5924. </xs:annotation>
  5925. <xs:import
  5926. namespace='jabber:x:data'
  5927. schemaLocation='http://www.xmpp.org/schemas/x-data.xsd'/>
  5928. <xs:element name='query'>
  5929. <xs:complexType>
  5930. <xs:choice xmlns:xdata='jabber:x:data' minOccurs='0'>
  5931. <xs:element ref='xdata:x'/>
  5932. <xs:element ref='destroy'/>
  5933. </xs:choice>
  5934. </xs:complexType>
  5935. </xs:element>
  5936. <xs:element name='destroy'>
  5937. <xs:complexType>
  5938. <xs:sequence>
  5939. <xs:element name='password' type='xs:string' minOccurs='0'/>
  5940. <xs:element name='reason' type='xs:string' minOccurs='0'/>
  5941. </xs:sequence>
  5942. <xs:attribute name='jid' type='xs:string' use='optional'/>
  5943. </xs:complexType>
  5944. </xs:element>
  5945. <xs:simpleType name='empty'>
  5946. <xs:restriction base='xs:string'>
  5947. <xs:enumeration value=''/>
  5948. </xs:restriction>
  5949. </xs:simpleType>
  5950. </xs:schema>
  5951. ]]></code>
  5952. </section2>
  5953. </section1>
  5954. <section1 topic='Acknowledgements' anchor='ack'>
  5955. <p>The author would like to especially recognize the following individuals for their many helpful comments on various drafts of this proposal: Gaston Dombiak, Joe Hildebrand, Craig Kaes, Jacek Konieczny, Peter Millard, Jean-Louis Seguineau, Alexey Shchepin, David Sutton, and David Waite. Thanks also to members of the XSF Technical Review Team for their edits and suggestions, in particular Peter Mount and Luca Tagliaferri. In addition, more people than the author can count have have provided feedback in the jdev@conference.jabber.org chat room and on the standards@xmpp.org and muc@xmpp.org mailing lists.</p>
  5956. </section1>
  5957. </xep>