AddFriends
How do I use Add Friends
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
303 | this.chatClient.AddFriends(new string[] {"tobi", "ilya"}); // Add some users to the server-list to get their status updates | 1 |
433 | public bool AddFriends(string[] friends) | 2 |
File name: ChatGui.cs
Copy
296 public void OnConnected()
297 {
298 if (this.ChannelsToJoinOnConnect != null && this.ChannelsToJoinOnConnect.Length > 0)
299 {
300 this.chatClient.Subscribe(this.ChannelsToJoinOnConnect, this.HistoryLengthToFetch);
301 }
302
303 this.chatClient.AddFriends(new string[] {"tobi", "ilya"}); // Add some users to the server-list to get their status updates
304 this.chatClient.SetOnlineStatus(ChatUserStatus.Online); // You can set your online state (without a mesage).
305 }
File name: ChatClient.cs
Copy
433 public bool AddFriends(string[] friends)
434 {
435 if (!this.CanChat)
436 {
437 // TODO: log error
438 return false;
439 }
440
441 if (friends == null || friends.Length == 0)
442 {
443 this.LogWarning("AddFriends can't be called for empty or null list.");
444 return false;
445 }
446
447 Dictionary
448 {
449 { ChatParameterCode.Friends, friends },
450 };
451 return this.chatPeer.OpCustom(ChatOperationCode.AddFriends, parameters, true);
452 }
AddFriends 129 lượt xem
Gõ tìm kiếm nhanh...