Esempio n. 1
0
        public static void AddChannel(Channel channel)
        {
            if (ConnectionFile.Instance().Connections.FirstOrDefault(p => (p is Channel && ((Channel)p).Name == channel.Name)
            && (p is Connection && channel.ParentConnection.Name == ((Connection)p).Name)) == null)
            {
                MainPage.RunActionOnUiThread(() =>
                {
                    ObservableCollection<AHistory> col = ConnectionFile.Instance().Connections;

                    col.Insert(col.IndexOf(channel.ParentConnection) + 1, channel);
                    ((BIRCViewModel)MainPage.currentDataContext).ServerSelection = channel;
                });
            }
        }
Esempio n. 2
0
        public static bool IsUserIgnored(Channel channel, string nickname)
        {
            if (channel.Users == null || channel.Users.Count == 0)
            {
                if (channel.Ignored == Channel.IGNORED)
                    return true;
                else
                    return false;
            }

            Channel user = channel.Users.FirstOrDefault(p => p.Name == nickname);
            if (user == null)
                return false;
            if (user.Ignored == Channel.IGNORED)
                return true;
            else
                return false;
        }
Esempio n. 3
0
 public void RemoveUser(Channel user)
 {
     MainPage.RunActionOnUiThread(() =>
     {
         Users.Remove(user);
     });
 }
Esempio n. 4
0
 public void AddUser(Channel user)
 {
     MainPage.RunActionOnUiThread(() =>
     {
         Users.Add(user);
     });
 }
Esempio n. 5
0
        public static void RemoveChannel(Channel channel)
        {
            MainPage.RunActionOnUiThread(() =>
            {
                ObservableCollection<AHistory> col = ConnectionFile.Instance().Connections;

                ((BIRCViewModel)MainPage.currentDataContext).ServerSelection = channel.ParentConnection;
                col.Remove(channel);
            });
        }
Esempio n. 6
0
 public static void UnreadChannelOnInactive(Channel curChannel)
 {
     if (!curChannel.IsActive)
     {
         MainPage.RunActionOnUiThread(() =>
         {
             if (curChannel.Unread == 1)
                 curChannel.Unread = 2;
             else
                 curChannel.Unread = 1;
         });
     }
 }
Esempio n. 7
0
 public void AddChannel(Channel channel)
 {
     Channels.Add(channel);
     MainPage.RunActionOnUiThread(() =>
     {
         MainPage.currentDataContext.Changed("");
     });
 }
Esempio n. 8
0
        private void LocalUser_JoinedChannel(object sender, IrcChannelEventArgs e)
        {
            e.Channel.MessageReceived += Channel_MessageReceived;
            e.Channel.ModesChanged += Channel_ModesChanged;
            e.Channel.NoticeReceived += Channel_NoticeReceived;
            e.Channel.TopicChanged += Channel_TopicChanged;
            e.Channel.UserInvited += Channel_UserInvited;
            e.Channel.UserJoined += Channel_UserJoined;
            e.Channel.UserKicked += Channel_UserKicked;
            e.Channel.UserLeft += Channel_UserLeft;
            e.Channel.UsersListReceived += Channel_UsersListReceived;

            Channel channel = new Channel()
            {
                Name = "   " + e.Channel.Name,
                RealName = e.Channel.Name,
                ParentConnection = connection,
                Command = connection.Command
            };
            ConnectionUtils.AddChannel(channel);
            connection.AddChannel(channel);
        }