home *** CD-ROM | disk | FTP | other *** search
- /* -*- 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);
-
- }
- }
-
- 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; }
-