home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 January
/
01_02.iso
/
software
/
netscape62win
/
nim.xpi
/
bin
/
components
/
nsJSAimChatRendezvous.js
< prev
next >
Wrap
Text File
|
2001-04-16
|
4KB
|
119 lines
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Probably need some copyright here!
*/
function nsJSAimChatRendezvous() {
dump("creating new nsJSAimChatRendezvous\n");
}
nsJSAimChatRendezvous.prototype = {
// we just implement one function!
OnProposalReceived : function (screenname, proposal)
{
dump ("got a proposal from " + screenname + "\n");
inviteArgsObj = {
inviteProposalScreenName: screenname,
inviteProposalObj: proposal,
invitedScreenNames: '',
inviteToExistingWindow: false,
inviteMode: 'incomingchat'
}
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindow = windowManagerInterface.getMostRecentWindow(null);
//topWindow.focus();
topWindow.openDialog('chrome://aim/content/chatInviteBuddy.xul','_blank','chrome,all,dialog=no',inviteArgsObj);
},
ChatInvite : function (roomname, screennamelist, msg)
{
// XXX hardcoding en for now, we have no way of
// determining what this might be from the URL
inviteArgsObj = {
invitedScreenNames: screennamelist,
inviteToExistingRoom: roomname,
inviteLanguage: "en",
inviteToExistingWindow: false,
inviteMode: 'outgoingchat',
invitationmsg: msg
}
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindow = windowManagerInterface.getMostRecentWindow(null);
topWindow.openDialog('chrome://aim/content/chatInviteBuddy.xul','_blank','chrome,all,dialog=no',inviteArgsObj);
},
GoChat : function (roomname, exchange, instance)
{
var language = "en";
chatContentArgsObj = {
chatRoomName : roomname,
chatLanguage : language,
incomingChat : false,
instance : instance,
exchange : exchange,
fromurl : true
}
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindow = windowManagerInterface.getMostRecentWindow(null);
topWindow.openDialog('chrome://aim/content/chatContent.xul','','chrome,all,dialog=no',chatContentArgsObj);
}
}
var module = {
registerSelf: function (compMgr, fileSpec, location, type) {
compMgr.registerComponentWithType(this.myCID,
"nsJSAimChatRendezvous",
"@netscape.com/js/aim/chatrendezvous;1",
fileSpec, location, true, true, type);
},
getClassObject: function (compMgr, cid, iid) {
if (!cid.equals(this.myCID))
throw Components.results.NS_ERROR_NO_INTERFACE;
if (!iid.equals(Components.interfaces.nsIFactory))
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
return this.myFactory;
},
canUnload: function () {
},
myCID: Components.ID("{38E07345-2DC7-11d4-BA1A-0010833594E9}"),
myFactory: {
createInstance: function (outer, iid) {
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
if (!(iid.equals(Components.interfaces.nsIAimChatRendezvousCallback) || iid.equals(Components.interfaces.nsISupports))) {
throw Components.results.NS_ERROR_INVALID_ARG;
}
return new nsJSAimChatRendezvous();
}
}
};
function NSGetModule(compMgr, fileSpec) { return module; }