Contents Index Topic Contents | ||
Previous Topic: KillChannel Method Next Topic: ListUsers Method |
ListChannels Method
Lists channels on the chat server.
Syntax
object.ListChannels ChannelQueryItems
Parameters
object Required. An object expression that evaluates to an MsChatPr control. ChannelQueryItems Required. An object expression that evaluates to a ChatItems object. Remarks
The ChannelQueryItems parameter can restrict the listing to a subset of channels.
The IRC protocol is limited to listing all the server channels or only one specific channel. On an IRC server, the valid item name for ChannelQueryItems is "Name".
For an IRCX server, the valid item names are listed in the following table.
See Note for an explanation of the "Op" endings.
Item name Type Usage Name String Sets listing criteria based on the name of the channel. NameOp String Sets listing criteria based on the name of the channel. Topic String Sets listing criteria based on the topic of the channel. TopicOp String Sets listing criteria based on the topic of the channel. Language String Sets listing criteria based on the language of the channel. LanguageOp String Sets listing criteria based on the language of the channel. Subject String Sets listing criteria based on the subject of the channel. SubjectOp String Sets listing criteria based on the subject of the channel. ChannelAgeMax Long Sets listing criteria based on the creation time of the channel. ChannelAgeMin Long Sets listing criteria based on the creation time of the channel. ListCount Long Limits the number of listed channels to a certain value. MemberCount Long Sets listing criteria based on the member count of the channel. MemberCountMax Long Sets listing criteria based on the member count of the channel. MemberCountMin Long Sets listing criteria based on the member count of the channel. TopicAgeMax Long Sets listing criteria based on the latest topic change of the channel. TopicAgeMin Long Sets listing criteria based on the latest topic change of the channel. Registered Boolean Limits the listed channels to registered channels only. The channels are filtered depending on their PICS rating and the user's ratings settings. For example, if the user cannot view unrated content, the ListChannels call fails on an IRC connection or shows only the rated channels on an IRCX connection. If the user has some specific PICS ratings settings, only the channels that are appropriately rated are exposed to the user.
A successful ListChannels call results in a succession of events. First, an OnBeginEnumeration event to mark the beginning of the channel listing is fired. Then, one OnChannelProperty event for each channel listed transpires and the ChannelItems parameter exposes all the known channel properties. Finally, an OnEndEnumeration with the etChannels parameter event is fired to mark the end of the channel listing.
If a listing is stopped because of a limitation set by the ListCount item, an OnEndEnumeration with the etChannelsTruncated parameter event is fired instead.
The IRC protocol is limited to listing all the server channels or only one specific channel.
Examples
1. On an IRC/IRCX server:
'List all the channels: Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" MsChatPr1.ListChannels chatitemobj Set chatitemobj = Nothing 'List one specific channel: Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("Name") = "#Comic_Chat" MsChatPr1.ListChannels chatitemobj Set chatitemobj = Nothing2. On an IRCX server, list all the channels that have been created in the last hour, and limit the listing to 100 channels:
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("ChannelAgeMax") = 60 chatitemobj.Item("ListCount") = 100 MsChatPr1.ListChannels chatitemobj Set chatitemobj = Nothing3. On an IRCX server, list all the channels that have between 10 and 50 members, in which the Topic includes the word "Corvette":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("MemberCountMin") = 10 chatitemobj.Item("MemberCountMax") = 50 chatitemobj.Item("TopicOp") = "Contains" chatitemobj.Item("Topic") = "Corvette" MsChatPr1.ListChannels chatitemobj Set chatitemobj = Nothing4. On an IRCX server, list all the registered channels that start with "#F" and have a Language property that contains "FR":
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("Registered") = True chatitemobj.Item("NameOp") = "StartsWith" chatitemobj.Item("Name") = "#F" chatitemobj.Item("LanguageOp") = "Contains" chatitemobj.Item("Language") = "FR" MsChatPr1.ListChannels chatitemobj Set chatitemobj = Nothing5. On an IRCX server, list all the channels that have "real estate" in their Subject property:
Dim chatitemobj As ChatItems Set chatitemobj = New ChatItems chatitemobj.AssociatedType = "Query" chatitemobj.Item("SubjectOp") = "Contains" chatitemobj.Item("Subject") = "real estate" MsChatPr1.ListChannels chatitemobj Set chatitemobj = Nothing
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.