Change population of domain user list for chat
Question asked by Erik White - 5/13/2017 at 4:45 PM
Goal: Have the chat availability bar show only the names of contacts the user has added
Reason: We don't want every new user to have default access to a full list of all other users within a domain
Progress: While digging in source I found ChatView.aspx, which has the function 'GetContactsFromRoot' which populates the list of contacts for the chat window with the list of all users within the domain. Upon investigation into the this function I noticed that the 'users' (jid, name, group, subscriptions, etc) aren't denoted by the belonging of any particular contact list. I then went digging into the contact list page to find it populated by 'LoadFuncctl00_Split_LP_ctl01_grdContacts();' and I have to stop here for today. I'd like to know how a 'contact' is defined with respect to the logged in user. Populating this list is a simple iteration function of the same array in javascript placed in the chatview.aspx
Although it is not a 'feature' of smartermail, if a programmer could simply divulge the appropriate definition of this contact list it would save large headaches and hours digging to figure it out the hard way, as well as expand the functionality and practicality of this software (the inability to do this limits smartermail to a strictly internal network application, essentially)

2 Replies

Reply to Thread
Erik White Replied
var ctl00_Split_LP_ctl01_grdContacts = null;
            function LoadFuncctl00_Split_LP_ctl01_grdContacts() {
                var dataSource = {"additionalJavascript":null,"checkedRows":["Abuse|FB69835B-CD36-6D71-78B6-7DF38498389D"],"dirtyKey":"0","labelText":null,"rows":[{"columns":[{"c":"checkable multiline","v":"\u003cinput type=checkbox /\u003e"},{"c":"al emphasize","v":"\u003cdiv class=\"multiline line1 shrink\"\u003edancelance\u003c/div\u003e\u003cdiv class=\"multiline line2 shrink\"\u003einfo@palmbeachcuisine.com\u003c/div\u003e\u003cdiv class=\"multiline line3 shrink\"\u003ehandleit\u003c/div\u003e\u003cdiv class=\"multiline line4 shrink nodata\"\u003eWork Phone\u003c/div\u003e\u003cdiv class=\"multiline line5 shrink nodata\"\u003eMobile Phone\u003c/div\u003e\u003cdiv class=\"multiline line6 shrink\"\u003eAccount: My Contacts\u003c/div\u003e"}],"d":false,"n":false,"rowNumber":0,"uid":"Abuse|FB69835B-CD36-6D71-78B6-7DF38498389D","urls":["/Main/frmContactView.aspx?guid=FB69835B-CD36-6D71-78B6-7DF38498389D\u0026user=Abuse\u0026mapped=true","/Main/frmContact.aspx?guid=FB69835B-CD36-6D71-78B6-7DF38498389D\u0026user=Abuse\u0026mapped=true"]}],"totalRows":1};
                ctl00_Split_LP_ctl01_grdContacts = new SuperHyperGrid('ctl00_Split_LP_ctl01_grdContacts', 1, 2, SMWeb.Services.svcSuperHyperGrid.GetData, 'ContactsView', 'Loading...', dataSource, -1, 1, 0, NavPreviewPane, -1, showContext_ctl00_Split_LP_ctl01_contextContacts, DoubleClick, DoDelete, false, 2, '\x7b0\x7d\x20selected\x20items', false, false, '8267acd5c3924bd386ed87bac81351a5', -1, '', '', false, '', [{"locked":true,"max":25,"min":25,"percent":false,"width":25},{"locked":false,"max":400,"min":100,"percent":false,"width":0}], '/Main/frmEmptyPreviewOuter.aspx?type=contacts', SMWeb.Services.svcSuperHyperGrid.MarkRead, false, false);
                dataSource = null;
                    self.finishLoadingFunction = function(){ctl00_Split_LP_ctl01_grdContacts.AutoSelect();};
                else if (self.isCallback)
                self.isCallback = true;
Erik White Replied
pretty bad formatting after the paste lol.. 
var dataSource = {     //some object of dynamically defined parameters
"checkedRows":["Abuse|FB84325B-CD56-6D61-78B6-7DF38423384D"]     //checked rows must be how the function identifys which user to grab contacts from, as abuse (dont ask) is the name of the user im logged in as.. plus the key (i changed the numbers/letters after pasting)
new SuperHyperGrid(    //some function to accept inputs and display a formatted div, which I do not need for my purposes
So it is clear that there is a way to identify the user that is logged on, and then display that user's contact list.. I just really want to be able to do this on the chat window... should this be a support ticket? I'd pay for the solution if necessary

Reply to Thread