Difference between revisions of "Muting Objects and Agents"

From Second Life Wiki
Jump to navigation Jump to search
m
m (mute list messages)
Line 13: Line 13:


== Managing the Mute List ==
== Managing the Mute List ==
The viewer's mute list is internally represented by the global ''LLMuteList* gMuteListp''.  
The viewer's mute list is internally represented by the global ''LLMuteList* gMuteListp''. For more information about the format of the mute list file, see [[Mute List]].


=== Requesting the Mute List from the service ===
=== Requesting the Mute List from the service ===
Line 48: Line 48:
** If the agent or object is already muted, the mute is removed from the mute list
** If the agent or object is already muted, the mute is removed from the mute list
** If the agent or object is not muted, the mute is added to the mute list and the mute list floater is shown
** If the agent or object is not muted, the mute is added to the mute list and the mute list floater is shown
== Mute List Messages ==
{{MuteListMessages}}

Revision as of 11:11, 13 June 2007

The viewer is responsible for implementing the muting on agents and objects. When the viewer initiates a new session, it requests the Mute List from the Second Life service. Once this list has been received and processed, each chat message that the viewer receives is compared against a list of muted items. If a chat message originates from a muted item, it is suppressed.

Mute List Classes

There are two primary classes that are used to implement and manage the viewer's mute list:

  • LLMute -- each muted object or agent is represented by an instance of this class
  • LLMuteList -- a single global instance of this class is used to manage the list of object and agents that are muted

Both of these classes are declared in llmutelist.h and implemented in llmutelist.cpp.

There are two classes that are used to manage the UI related to the mute list:

  • LLObjectMute -- handles the "Mute" menu items in the Object and Avatar pie menus (implemented in llviewermenu.cpp)
  • LLFloaterMute -- manages the display of the "Muted Residents & Objects" floater (declared in llfloatermute.h, implemented in llfloatermute.cpp and in floater_mute.xml)

Managing the Mute List

The viewer's mute list is internally represented by the global LLMuteList* gMuteListp. For more information about the format of the mute list file, see Mute List.

Requesting the Mute List from the service

  1. The viewer requests the agent's mute list by calling LLMuteList::requestFromServer() in llmutelist.cpp
  2. The viewer sends a MuteListRequest message to the service
  3. The service replies with either:
    • A MuteListUpdate message, indicating that the viewer should request a new mute list file from the service, or
    • A UseCachedMuteList message, indicating that the viewer should use its cached copy of the mute list file

Loading a new Mute List

  1. The viewer recevies a MuteListUpdate message from the serice
  2. The mute list file specified in the message is requested by the viewer
  3. Upon receipt of the mute list file, the callback LLMuteList::onFileMuteList() is invoked
  4. The viewer opens the received file, and invokes LLMuteList::loadFromFile() to parse it

Loading a cached Mute List

  1. The viewer receives a UseCachedMuteList message from the service
  2. The viewer opens the cached file, and invokes LLMuteList::loadFromFile() to parse it

Populating the Global Mute List

  1. The mute list file, whether new or cached, is opened by LLMuteList::loadFromFile()
  2. Each mute entry in the pipe-delimited list is parsed
  3. A new LLMute instance is created for each entry, and this instance is added to gMuteListp.

Updating the Mute List

  • When a new agent or object is added to the mute list, the viewer sends an UpdateMuteListEntry message to the service by LLMuteList::updateAdd()
  • When an agent or object is removed from the mute list, the viewer sends a RemoveMuteListEntry message to the service by LLMuteList::updateRemove()

Mute List UI

  • The "Muted Residents & Objects" floater is managed by the LLFloaterMute class, implemented in llfloatermute.cpp. This floater is displayed by the "Mute List" entry on the "Tools" menu, as well as by the "Mute" menu items on the object and agent pie menus.
  • The "Mute List" entry on the "Tools" menu is handled by LLShowFloater::handleEvent() (implemented in llviewermenu.cpp), which shows the mute list floater.
  • The "Mute" (or "Unmute") entries in both the agent and object pie menus are handled by LLObjectMute::handleEvent() (implemented in llviewermenu.cpp)
    • The handler creates a new LLMute instance based on the agent or object that was selected
    • If the agent or object is already muted, the mute is removed from the mute list
    • If the agent or object is not muted, the mute is added to the mute list and the mute list floater is shown

Mute List Messages

Message From To Description Handler / Sender
MuteListRequest viewer service Requests a mute list for the current agent sent by LLMuteList::requestFromServer()
UpdateMuteListEntry viewer service Adds a new mute entry to the mute list sent by LLMuteList::updateAdd()
RemoveMuteListEntry viewer service Removes a mute entry from the mute list sent by LLMuteList::updateRemove()
MuteListUpdate service viewer Tells the viewer the filename of the mute list to request
  • hooked up by the LLMuteList constructor
  • handled handled by LLMuteList::processMuteListUpdate()
UseCachedMuteList service viewer Tells the viewer to use its cached copy of the mute list
  • hooked up by the LLMuteList' constructor
  • handled by LLMuteList::processUseCachedMuteList()