Revision: 916
http://vision.svn.sourceforge.net/vision/?rev=916&view=rev
Author: anevilyak
Date: 2010-06-14 00:18:28 +0000 (Mon, 14 Jun 2010)
Log Message:
-----------
- spaces -> tabs
- theoretically we have reconnect support with the new stack.
- Makefile modified - binarchive no longer creates the directory with the full version appended to the directory name.
Modified Paths:
--------------
trunk/Vision/Makefile.gcc2
trunk/Vision/Makefile.gcc4
trunk/Vision/src/AboutWindow.cpp
trunk/Vision/src/AboutWindow.h
trunk/Vision/src/ChannelAgent.cpp
trunk/Vision/src/ChannelAgent.h
trunk/Vision/src/ChannelOptions.cpp
trunk/Vision/src/ChannelOptions.h
trunk/Vision/src/ClickView.cpp
trunk/Vision/src/ClickView.h
trunk/Vision/src/ClientAgent.cpp
trunk/Vision/src/ClientAgent.h
trunk/Vision/src/ClientAgentInputFilter.cpp
trunk/Vision/src/ClientAgentInputFilter.h
trunk/Vision/src/ClientAgentLogger.cpp
trunk/Vision/src/ClientAgentLogger.h
trunk/Vision/src/ClientWindow.cpp
trunk/Vision/src/ClientWindow.h
trunk/Vision/src/ClientWindowDock.cpp
trunk/Vision/src/ClientWindowDock.h
trunk/Vision/src/ColorSelector.cpp
trunk/Vision/src/ColorSwatch.cpp
trunk/Vision/src/ColorSwatch.h
trunk/Vision/src/ColorTools.cpp
trunk/Vision/src/ColorTools.h
trunk/Vision/src/ColumnListView.cpp
trunk/Vision/src/ColumnListView.h
trunk/Vision/src/ColumnTypes.cpp
trunk/Vision/src/ColumnTypes.h
trunk/Vision/src/DCCConnect.cpp
trunk/Vision/src/DCCConnect.h
trunk/Vision/src/DCCFileWindow.cpp
trunk/Vision/src/DCCFileWindow.h
trunk/Vision/src/DCCHandler.cpp
trunk/Vision/src/HistoryList.cpp
trunk/Vision/src/HistoryList.h
trunk/Vision/src/IconMenu.cpp
trunk/Vision/src/IconMenu.h
trunk/Vision/src/ListAgent.cpp
trunk/Vision/src/ListAgent.h
trunk/Vision/src/LuaScript.cpp
trunk/Vision/src/LuaScript.h
trunk/Vision/src/MessageAgent.cpp
trunk/Vision/src/MessageAgent.h
trunk/Vision/src/NameItem.cpp
trunk/Vision/src/Names.h
trunk/Vision/src/NamesView.cpp
trunk/Vision/src/NetPrefsServerView.cpp
trunk/Vision/src/NetPrefsServerView.h
trunk/Vision/src/NetworkManager.cpp
trunk/Vision/src/NetworkManager.h
trunk/Vision/src/NetworkMenu.cpp
trunk/Vision/src/NetworkMenu.h
trunk/Vision/src/NetworkPrefsView.cpp
trunk/Vision/src/NetworkPrefsView.h
trunk/Vision/src/NetworkWindow.cpp
trunk/Vision/src/NetworkWindow.h
trunk/Vision/src/NotifyList.cpp
trunk/Vision/src/NotifyList.h
trunk/Vision/src/NumericFilter.cpp
trunk/Vision/src/NumericFilter.h
trunk/Vision/src/ObjectList.h
trunk/Vision/src/ParseCTCP.cpp
trunk/Vision/src/ParseCmd.cpp
trunk/Vision/src/ParseENums.cpp
trunk/Vision/src/ParseENums.h
trunk/Vision/src/ParseEvents.cpp
trunk/Vision/src/PlayButton.cpp
trunk/Vision/src/PlayButton.h
trunk/Vision/src/PrefAliases.cpp
trunk/Vision/src/PrefAliases.h
trunk/Vision/src/PrefApp.cpp
trunk/Vision/src/PrefApp.h
trunk/Vision/src/PrefColor.cpp
trunk/Vision/src/PrefColor.h
trunk/Vision/src/PrefCommand.cpp
trunk/Vision/src/PrefCommand.h
trunk/Vision/src/PrefDCC.cpp
trunk/Vision/src/PrefDCC.h
trunk/Vision/src/PrefEvent.cpp
trunk/Vision/src/PrefEvent.h
trunk/Vision/src/PrefFont.cpp
trunk/Vision/src/PrefFont.h
trunk/Vision/src/PrefGeneral.cpp
trunk/Vision/src/PrefGeneral.h
trunk/Vision/src/PrefLog.cpp
trunk/Vision/src/PrefLog.h
trunk/Vision/src/PrefsWindow.cpp
trunk/Vision/src/PrefsWindow.h
trunk/Vision/src/Prompt.cpp
trunk/Vision/src/Prompt.h
trunk/Vision/src/ResizeView.cpp
trunk/Vision/src/ResizeView.h
trunk/Vision/src/RunView.cpp
trunk/Vision/src/RunView.h
trunk/Vision/src/ServerAgent.cpp
trunk/Vision/src/ServerAgent.h
trunk/Vision/src/ServerEntryWindow.cpp
trunk/Vision/src/ServerEntryWindow.h
trunk/Vision/src/SettingsFile.cpp
trunk/Vision/src/SettingsFile.h
trunk/Vision/src/SetupWindow.cpp
trunk/Vision/src/SetupWindow.h
trunk/Vision/src/SpeedButton.cpp
trunk/Vision/src/SpeedButton.h
trunk/Vision/src/StatusView.cpp
trunk/Vision/src/StatusView.h
trunk/Vision/src/TestScript.cpp
trunk/Vision/src/TestScript.h
trunk/Vision/src/Theme.cpp
trunk/Vision/src/Theme.h
trunk/Vision/src/URLCrunch.cpp
trunk/Vision/src/URLCrunch.h
trunk/Vision/src/Utilities.cpp
trunk/Vision/src/Utilities.h
trunk/Vision/src/VTextControl.cpp
trunk/Vision/src/VTextControl.h
trunk/Vision/src/Vision.cpp
trunk/Vision/src/Vision.h
trunk/Vision/src/VisionBase.h
trunk/Vision/src/VisionMessages.h
trunk/Vision/src/WindowList.cpp
trunk/Vision/src/WindowList.h
Removed Paths:
-------------
trunk/Vision/Makefile
Deleted: trunk/Vision/Makefile
===================================================================
--- trunk/Vision/Makefile 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/Makefile 2010-06-14 00:18:28 UTC (rev 916)
@@ -1,194 +0,0 @@
-################################################
-#
-# Vision
-#
-# This makefile is free software; you can redistribute it and/or
-# modify it under the terms of the enclosed JBQ code license.
-# See data/LICENSE.Makefile
-#
-# This makefile is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# License for more details.
-#
-#
-################################################
-
-# the file name, ...
-BINARY := Vision
-VERSION := 0.9.8-20100606
-BUILDDATE := $(shell date +%b_%d_%Y)
-BUILD_TYPE := Release
-
-# system libs
-REG_LIBS := -lbe -ltranslation -ltextencoding -ltracker -lnetwork -lroot -lstdc++ -lsupc++ -llocale
-
-# lua
-LUA_LIBS := -L./src/lua/lib -llua -llualib
-
-################################################
-
-# output directories
-
-OBJDIR := obj
-DEPDIR := dep
-SRCDIR := src
-DATADIR := data
-
-TEMPDEPFILE := /tmp/vision_temp_deps
-
-LIBLUA_PATH := ./src/lua/lib/liblua.a
-
-# compiler, linker, ...
-
-CC := gcc -c -pipe
-
-CFLAGS := -DVERSION_STRING=\"$(VERSION)\"
-
-# These can be set from the shell to change the build type
-ifeq ($(CHECK_MEM),true)
- CFLAGS += -fcheck-memory-usage -D_NO_INLINE_ASM=1
- BUILD_DEBUG=true
-endif
-
-ifeq ($(BUILD_DEBUG),true)
- CFLAGS += -g -O0
- BUILD_TYPE = Debug
-else
- CFLAGS += -O1
-endif
-
-ifeq ($(CHECK_MEM),true)
- BUILD_TYPE = MemCheck
-endif
-
-CFLAGS += -DBEOS_BUILD
-CFLAGS += -DBUILD_DATE=\"$(BUILDDATE)\"
-CFLAGS += -fno-pic
-CFLAGS += -ffast-math
-CFLAGS += -march=pentium -mtune=pentium3
-CFLAGS += -Wall -W -Wno-multichar -Wpointer-arith
-CFLAGS += -Wwrite-strings -Woverloaded-virtual
-CFLAGS += -Wpointer-arith
-CFLAGS += -Wmissing-declarations
-CFLAGS += -Wcast-qual -Wshadow -Werror
-
-# be able to add flags from the env at will without chaging the makefile
-CFLAGS += $(VISION_ADDL_BUILD_FLAGS)
-
-LD := gcc
-
-LDFLAGS := $(REG_LIBS) -nodefaultlibs
-
-ifeq ($(wildcard /boot/common/include/infopopper/InfoPopper.h), )
-else
- CFLAGS += -DUSE_INFOPOPPER=1
-endif
-
-DEP := gcc -MM -DBEOS_BUILD
-
-# create the dep dir.
-MAKEDEP := $(shell mkdir -p $(DEPDIR))
-
-ZIP := zip -r -9 -y
-
-################################################
-
-# the engine
-
-MAKEFILE := Makefile
-
-FULLNAME := $(subst \ ,_,$(BINARY))-$(VERSION)
-
-DATA := $(shell find $(DATADIR) -type f)
-
-EXTRADATA:= $(wildcard data.zip)
-
-BASESOURCES := $(shell cd $(SRCDIR) && ls -1 *.cpp)
-SOURCES := $(addprefix $(SRCDIR)/,$(BASESOURCES))
-OBJECTS := $(addprefix $(OBJDIR)/,$(addsuffix .o,$(basename $(BASESOURCES))))
-DEPENDS := $(addprefix $(DEPDIR)/,$(addsuffix .d,$(basename $(BASESOURCES))))
-
-BASEHEADERS := $(shell cd $(SRCDIR) && ls -1 *.h)
-HEADERS := $(addprefix $(SRCDIR)/,$(BASEHEADERS))
-
-.PHONY : default release clean binarchive sourcearchive all
-
-.DELETE_ON_ERROR : $(BINARY)
-
-default : build
-
-build : $(BINARY)
-
-# rule to create the object file directory if needed
-$(OBJDIR)::
- @[ -d $(OBJDIR) ] || mkdir $(OBJDIR) > /dev/null 2>&1
-
-clean :
- @echo cleaning
- @rm -rf $(BINARY) $(OBJDIR) $(DEPDIR) $(filter-out data.zip,$(wildcard *.zip)) *.zip~
-
-all : sourcearchive binarchive
-
-sourcearchive : $(FULLNAME)-src.zip
-
-binarchive : $(FULLNAME).zip
-
-cvsup:
- @echo CVS up -d
- @cvs up -d
-
-$(BINARY) : $(OBJDIR) $(OBJECTS)
- @rm -f $(TEMPDEPFILE)
- @echo linking $@
- @$(LD) -o $@ $(OBJECTS) $(LDFLAGS)
- @echo merging resources
- @xres -o $@ $(SRCDIR)/Vision.rsrc
- @mimeset -f $@
-
-$(OBJDIR)/%.o : $(SRCDIR)/%.cpp
- @echo compiling [$(BUILD_TYPE) Build] : $@
- @$(CC) $< $(CFLAGS) -o $@
-
-$(DEPDIR)/%.d : $(SRCDIR)/%.cpp
- @/bin/echo generating dependencies for $<
- @/bin/echo $@ $(OBJDIR)/$(shell $(DEP) $<) > $(TEMPDEPFILE)
- @/bin/echo $(OBJDIR)/$(basename $(@F))".o : $(MAKEFILE)" | /bin/cat - $(TEMPDEPFILE) > $@
-
-$(FULLNAME).zip : $(BINARY) $(DATA) $(EXTRADATA) $(MAKEFILE)
- @rm -rf $@~
- @mkdir -p $@~/$(FULLNAME)/
- @copyattr -d -r $(BINARY) $(DATADIR)/* $@~/$(FULLNAME)/
-ifneq "$(EXTRADATA)" ""
- @unzip $(EXTRADATA) -d $@~/$(FULLNAME)/
-endif
- @find $@~ -type f | xargs mimeset
- @rm -rf $@~/$(FULLNAME)/CVS $@~/$(FULLNAME)/protocol/CVS $@~/$(FULLNAME)/help/CVS $@~/$(FULLNAME)/scripts/CVS
- @rm -rf $@~/$(FULLNAME)/CVS $@~/$(FULLNAME)/help/content/CVS $@~/$(FULLNAME)/help/images/CVS
- @cd $@~ && $(ZIP) $@ $(FULLNAME)
- @mv -f $@~/$@ .
- @rm -rf $@~
-
-$(FULLNAME)-src.zip : $(SOURCES) $(HEADERS) $(DATA) $(EXTRADATA) $(MAKEFILE)
- @rm -rf $@~
- @mkdir -p $@~/$(FULLNAME)-src/
- @copyattr -d -r $(SRCDIR) $(DATADIR) $(MAKEFILE) $@~/$(FULLNAME)-src/
-ifneq "$(EXTRADATA)" ""
- @copyattr -d -r $(EXTRADATA) $@~/$(FULLNAME)-src/
-endif
- @find $@~ -type f | xargs mimeset
- @rm -rf $@~/$(FULLNAME)-src/src/CVS $@~/$(FULLNAME)-src/data/CVS
- @rm -rf $@~/$(FULLNAME)-src/CVS $@~/$(FULLNAME)-src/data/protocol/CVS $@~/$(FULLNAME)-src/data/help/CVS $@~/$(FULLNAME)-src/data/scripts/CVS
- @rm -rf $@~/$(FULLNAME)-src/CVS $@~/$(FULLNAME)-src/data/help/content/CVS $@~/$(FULLNAME)-src/data/help/images/CVS
- @cd $@~ && $(ZIP) $@ $(FULLNAME)-src
- @mv -f $@~/$@ .
- @rm -rf $@~
-
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),depend)
-ifneq ($(MAKECMDGOALS),sourcearchive)
--include $(DEPENDS)
-endif
-endif
-endif
-
Modified: trunk/Vision/Makefile.gcc2
===================================================================
--- trunk/Vision/Makefile.gcc2 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/Makefile.gcc2 2010-06-14 00:18:28 UTC (rev 916)
@@ -16,7 +16,7 @@
# the file name, ...
BINARY := Vision
-VERSION := 0.9.8-20100606
+VERSION := 0.9.8-20100613
BUILDDATE := $(shell date +%b_%d_%Y)
BUILD_TYPE := Release
@@ -157,15 +157,15 @@
$(FULLNAME).zip : $(BINARY) $(DATA) $(EXTRADATA) $(MAKEFILE)
@rm -rf $@~
- @mkdir -p $@~/$(FULLNAME)/
- @copyattr -d -r $(BINARY) $(DATADIR)/* $@~/$(FULLNAME)/
+ @mkdir -p $@~/$(BINARY)/
+ @copyattr -d -r $(BINARY) $(DATADIR)/* $@~/$(BINARY)/
ifneq "$(EXTRADATA)" ""
- @unzip $(EXTRADATA) -d $@~/$(FULLNAME)/
+ @unzip $(EXTRADATA) -d $@~/$(BINARY)/
endif
@find $@~ -type f | xargs mimeset
- @rm -rf $@~/$(FULLNAME)/CVS $@~/$(FULLNAME)/protocol/CVS $@~/$(FULLNAME)/help/CVS $@~/$(FULLNAME)/scripts/CVS
- @rm -rf $@~/$(FULLNAME)/CVS $@~/$(FULLNAME)/help/content/CVS $@~/$(FULLNAME)/help/images/CVS
- @cd $@~ && $(ZIP) $@ $(FULLNAME)
+ @rm -rf $@~/$(BINARY)/.svn $@~/$(BINARY)/protocol/.svn $@~/$(BINARY)/help/.svn $@~/$(BINARY)/scripts/.svn
+ @rm -rf $@~/$(BINARY)/.svn $@~/$(BINARY)/help/content/.svn $@~/$(BINARY)/help/images/.svn
+ @cd $@~ && $(ZIP) $@ $(BINARY)/*
@mv -f $@~/$@ .
@rm -rf $@~
@@ -177,9 +177,9 @@
@copyattr -d -r $(EXTRADATA) $@~/$(FULLNAME)-src/
endif
@find $@~ -type f | xargs mimeset
- @rm -rf $@~/$(FULLNAME)-src/src/CVS $@~/$(FULLNAME)-src/data/CVS
- @rm -rf $@~/$(FULLNAME)-src/CVS $@~/$(FULLNAME)-src/data/protocol/CVS $@~/$(FULLNAME)-src/data/help/CVS $@~/$(FULLNAME)-src/data/scripts/CVS
- @rm -rf $@~/$(FULLNAME)-src/CVS $@~/$(FULLNAME)-src/data/help/content/CVS $@~/$(FULLNAME)-src/data/help/images/CVS
+ @rm -rf $@~/$(FULLNAME)-src/src/.svn $@~/$(FULLNAME)-src/data/.svn
+ @rm -rf $@~/$(FULLNAME)-src/.svn $@~/$(FULLNAME)-src/data/protocol/.svn $@~/$(FULLNAME)-src/data/help/.svn $@~/$(FULLNAME)-src/data/scripts/.svn
+ @rm -rf $@~/$(FULLNAME)-src/.svn $@~/$(FULLNAME)-src/data/help/content/.svn $@~/$(FULLNAME)-src/data/help/images/.svn
@cd $@~ && $(ZIP) $@ $(FULLNAME)-src
@mv -f $@~/$@ .
@rm -rf $@~
Modified: trunk/Vision/Makefile.gcc4
===================================================================
--- trunk/Vision/Makefile.gcc4 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/Makefile.gcc4 2010-06-14 00:18:28 UTC (rev 916)
@@ -16,7 +16,7 @@
# the file name, ...
BINARY := Vision
-VERSION := 0.9.8-20100606
+VERSION := 0.9.8-20100613
BUILDDATE := $(shell date +%b_%d_%Y)
BUILD_TYPE := Release
@@ -157,15 +157,15 @@
$(FULLNAME).zip : $(BINARY) $(DATA) $(EXTRADATA) $(MAKEFILE)
@rm -rf $@~
- @mkdir -p $@~/$(FULLNAME)/
- @copyattr -d -r $(BINARY) $(DATADIR)/* $@~/$(FULLNAME)/
+ @mkdir -p $@~/$(BINARY)/
+ @copyattr -d -r $(BINARY) $(DATADIR)/* $@~/$(BINARY)/
ifneq "$(EXTRADATA)" ""
- @unzip $(EXTRADATA) -d $@~/$(FULLNAME)/
+ @unzip $(EXTRADATA) -d $@~/$(BINARY)/
endif
@find $@~ -type f | xargs mimeset
- @rm -rf $@~/$(FULLNAME)/CVS $@~/$(FULLNAME)/protocol/CVS $@~/$(FULLNAME)/help/CVS $@~/$(FULLNAME)/scripts/CVS
- @rm -rf $@~/$(FULLNAME)/CVS $@~/$(FULLNAME)/help/content/CVS $@~/$(FULLNAME)/help/images/CVS
- @cd $@~ && $(ZIP) $@ $(FULLNAME)
+ @rm -rf $@~/$(BINARY)/.svn $@~/$(BINARY)/protocol/.svn $@~/$(BINARY)/help/.svn $@~/$(BINARY)/scripts/.svn
+ @rm -rf $@~/$(BINARY)/.svn $@~/$(BINARY)/help/content/.svn $@~/$(BINARY)/help/images/.svn
+ @cd $@~ && $(ZIP) $@ $(BINARY)/*
@mv -f $@~/$@ .
@rm -rf $@~
@@ -177,9 +177,9 @@
@copyattr -d -r $(EXTRADATA) $@~/$(FULLNAME)-src/
endif
@find $@~ -type f | xargs mimeset
- @rm -rf $@~/$(FULLNAME)-src/src/CVS $@~/$(FULLNAME)-src/data/CVS
- @rm -rf $@~/$(FULLNAME)-src/CVS $@~/$(FULLNAME)-src/data/protocol/CVS $@~/$(FULLNAME)-src/data/help/CVS $@~/$(FULLNAME)-src/data/scripts/CVS
- @rm -rf $@~/$(FULLNAME)-src/CVS $@~/$(FULLNAME)-src/data/help/content/CVS $@~/$(FULLNAME)-src/data/help/images/CVS
+ @rm -rf $@~/$(FULLNAME)-src/src/.svn $@~/$(FULLNAME)-src/data/.svn
+ @rm -rf $@~/$(FULLNAME)-src/.svn $@~/$(FULLNAME)-src/data/protocol/.svn $@~/$(FULLNAME)-src/data/help/.svn $@~/$(FULLNAME)-src/data/scripts/.svn
+ @rm -rf $@~/$(FULLNAME)-src/.svn $@~/$(FULLNAME)-src/data/help/content/.svn $@~/$(FULLNAME)-src/data/help/images/.svn
@cd $@~ && $(ZIP) $@ $(FULLNAME)-src
@mv -f $@~/$@ .
@rm -rf $@~
Modified: trunk/Vision/src/AboutWindow.cpp
===================================================================
--- trunk/Vision/src/AboutWindow.cpp 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/src/AboutWindow.cpp 2010-06-14 00:18:28 UTC (rev 916)
@@ -13,13 +13,13 @@
*
* The Initial Developer of the Original Code is The Vision Team.
* Portions created by The Vision Team are
- * Copyright (C) 1999-2010 The Vision Team. All Rights
+ * Copyright (C) 1999-2010 The Vision Team. All Rights
* Reserved.
*
* Contributor(s): Wade Majors <wade@...>
- * Brian Luft
- * Todd Lair
- * Rene Gollent
+ * Brian Luft
+ * Todd Lair
+ * Rene Gollent
*/
#include <Bitmap.h>
@@ -35,210 +35,210 @@
class ClickView;
AboutWindow::AboutWindow (void)
- : BWindow (
- BRect (0.0, 0.0, 420.0, 266.0),
- "About Vision",
- B_TITLED_WINDOW,
- B_WILL_DRAW | B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
+ : BWindow (
+ BRect (0.0, 0.0, 420.0, 266.0),
+ "About Vision",
+ B_TITLED_WINDOW,
+ B_WILL_DRAW | B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
{
- /*
- * Function purpose: Construct
- */
+ /*
+ * Function purpose: Construct
+ */
-
- BRect bounds (Bounds());
- BBitmap *bmp (NULL);
+
+ BRect bounds (Bounds());
+ BBitmap *bmp (NULL);
- fBackground = new BView (
- bounds,
- "background",
- B_FOLLOW_ALL_SIDES,
- B_WILL_DRAW);
- fBackground->SetViewColor (255, 255, 255);
- AddChild (fBackground);
+ fBackground = new BView (
+ bounds,
+ "background",
+ B_FOLLOW_ALL_SIDES,
+ B_WILL_DRAW);
+ fBackground->SetViewColor (255, 255, 255);
+ AddChild (fBackground);
- if ((bmp = BTranslationUtils::GetBitmap ('bits', "vision")) != 0)
- {
- //BRect logo_bounds (bmp->Bounds());
+ if ((bmp = BTranslationUtils::GetBitmap ('bits', "vision")) != 0)
+ {
+ //BRect logo_bounds (bmp->Bounds());
- fLogo = new ClickView (
- bmp->Bounds().OffsetByCopy (16, 16),
- "image",
- B_FOLLOW_LEFT | B_FOLLOW_TOP,
- B_WILL_DRAW,
- "http://vision.sourceforge.net");
- fBackground->AddChild (fLogo);
- fLogo->SetViewBitmap (bmp);
- delete bmp;
+ fLogo = new ClickView (
+ bmp->Bounds().OffsetByCopy (16, 16),
+ "image",
+ B_FOLLOW_LEFT | B_FOLLOW_TOP,
+ B_WILL_DRAW,
+ "http://vision.sourceforge.net");
+ fBackground->AddChild (fLogo);
+ fLogo->SetViewBitmap (bmp);
+ delete bmp;
- bounds.Set (
- 0.0,
- fLogo->Frame().bottom + 12,
- Bounds().right,
- Bounds().bottom);
- }
+ bounds.Set (
+ 0.0,
+ fLogo->Frame().bottom + 12,
+ Bounds().right,
+ Bounds().bottom);
+ }
- fCredits = new BTextView (
- bounds,
- "credits",
- bounds.OffsetToCopy (B_ORIGIN).InsetByCopy (20, 0),
- B_FOLLOW_LEFT | B_FOLLOW_TOP,
- B_WILL_DRAW);
+ fCredits = new BTextView (
+ bounds,
+ "credits",
+ bounds.OffsetToCopy (B_ORIGIN).InsetByCopy (20, 0),
+ B_FOLLOW_LEFT | B_FOLLOW_TOP,
+ B_WILL_DRAW);
- fCredits->MakeSelectable (false);
- fCredits->MakeEditable (false);
- fCredits->SetStylable (true);
- fCredits->SetAlignment (B_ALIGN_CENTER);
- fBackground->AddChild (fCredits);
+ fCredits->MakeSelectable (false);
+ fCredits->MakeEditable (false);
+ fCredits->SetStylable (true);
+ fCredits->SetAlignment (B_ALIGN_CENTER);
+ fBackground->AddChild (fCredits);
- fCreditsText =
- "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
- "Unit A\n[Vision]\n"
- "{A-Z}\n"
- "Alan Ellis (voidref)\n"
- "Rene Gollent (AnEvilYak)\n"
- "Todd Lair (tlair)\n"
- "Wade Majors (kurros)\n\n\n\n"
+ fCreditsText =
+ "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
+ "Unit A\n[Vision]\n"
+ "{A-Z}\n"
+ "Alan Ellis (voidref)\n"
+ "Rene Gollent (AnEvilYak)\n"
+ "Todd Lair (tlair)\n"
+ "Wade Majors (kurros)\n\n\n\n"
- "\n\n\n\nUnit B\n[Bowser]\n"
- "{A-Z}\n"
- "Andrew Bazan (Hiisi)\n"
- "Rene Gollent (AnEvilYak)\n"
- "Todd Lair (tlair)\n"
- "Brian Luft (Electroly)\n"
- "Wade Majors (kurros)\n"
- "Jamie Wilkinson (project)\n\n\n\n"
-
- "\n\n\n\nBrought To You In Part By Contributions From\n"
- "{A-Z}\n"
- "Seth Flaxman (Flax)\n"
- "Joshua Jensen\n"
- "Gord McLeod (G_McLeod)\n"
- "John Robinson ([geo])\n"
- "Bjorn Oksholen (GuinnessM)\n"
- "Jean-Baptiste M. Quéru (jbq)\n"
- "\n\n\n"
+ "\n\n\n\nUnit B\n[Bowser]\n"
+ "{A-Z}\n"
+ "Andrew Bazan (Hiisi)\n"
+ "Rene Gollent (AnEvilYak)\n"
+ "Todd Lair (tlair)\n"
+ "Brian Luft (Electroly)\n"
+ "Wade Majors (kurros)\n"
+ "Jamie Wilkinson (project)\n\n\n\n"
+
+ "\n\n\n\nBrought To You In Part By Contributions From\n"
+ "{A-Z}\n"
+ "Seth Flaxman (Flax)\n"
+ "Joshua Jensen\n"
+ "Gord McLeod (G_McLeod)\n"
+ "John Robinson ([geo])\n"
+ "Bjorn Oksholen (GuinnessM)\n"
+ "Jean-Baptiste M. Quéru (jbq)\n"
+ "\n\n\n"
- "\n\n\n\nUnit C\n[Support Crew]\n"
- "Assistant to Wade Majors: Patches\n"
- "Music Supervisor: Baron Arnold\n"
- "Assistant to Baron Arnold: Ficus Kirkpatrick\n"
- "Stunt Coordinator: Gilligan\n"
- "Nude Scenes: Natalie Portman\n"
- "Counselors: regurg and helix\n\n\n"
- "No animals were injured during the production of this IRC client\n\n\n"
- "Soundtrack available on Catastrophe Records\n\n\n\n"
-
- "\n\n\n\nSpecial Thanks\n\n"
- "Olathe\n"
- "Terminus\n"
- "Bob Maple\n"
- "Ted Stodgell\n"
- "Seth Flaxman\n"
- "David Aquilina\n"
- "Kurt von Finck\n"
- "Kristine Gouveia\n"
- "Be, Inc., Menlo Park, CA\n"
- "Pizza Hut, Winter Haven, FL (now give me that free pizza Mike)\n\n\n"
-
- "send all complaints and nipple pictures to kaye\n\n\n"
+ "\n\n\n\nUnit C\n[Support Crew]\n"
+ "Assistant to Wade Majors: Patches\n"
+ "Music Supervisor: Baron Arnold\n"
+ "Assistant to Baron Arnold: Ficus Kirkpatrick\n"
+ "Stunt Coordinator: Gilligan\n"
+ "Nude Scenes: Natalie Portman\n"
+ "Counselors: regurg and helix\n\n\n"
+ "No animals were injured during the production of this IRC client\n\n\n"
+ "Soundtrack available on Catastrophe Records\n\n\n\n"
+
+ "\n\n\n\nSpecial Thanks\n\n"
+ "Olathe\n"
+ "Terminus\n"
+ "Bob Maple\n"
+ "Ted Stodgell\n"
+ "Seth Flaxman\n"
+ "David Aquilina\n"
+ "Kurt von Finck\n"
+ "Kristine Gouveia\n"
+ "Be, Inc., Menlo Park, CA\n"
+ "Pizza Hut, Winter Haven, FL (now give me that free pizza Mike)\n\n\n"
+
+ "send all complaints and nipple pictures to kaye\n\n\n"
- "\n\n\n\n\n"
- "\"A human being should be able to change "
- "a diaper, plan an invasion, butcher a "
- "hog, conn a ship, design a building, "
- "write a sonnet, balance accounts, build "
- "a wall, set a bone, comfort the dying, "
- "take orders, give orders, cooperate, act "
- "alone, solve equations, analyze a new "
- "problem, pitch manure, program a com"
- "puter, cook a tasty meal, fight effi"
- "ciently, die gallantly. Specialization "
- "is for insects.\" -- Robert A. Heinlein"
- ;
+ "\n\n\n\n\n"
+ "\"A human being should be able to change "
+ "a diaper, plan an invasion, butcher a "
+ "hog, conn a ship, design a building, "
+ "write a sonnet, balance accounts, build "
+ "a wall, set a bone, comfort the dying, "
+ "take orders, give orders, cooperate, act "
+ "alone, solve equations, analyze a new "
+ "problem, pitch manure, program a com"
+ "puter, cook a tasty meal, fight effi"
+ "ciently, die gallantly. Specialization "
+ "is for insects.\" -- Robert A. Heinlein"
+ ;
- rgb_color myBlack = {0,0,0,255};
- fTextRun.count = 1;
- fTextRun.runs[0].offset = 0;
- fTextRun.runs[0].font = *be_fixed_font;
- fTextRun.runs[0].color = myBlack;
+ rgb_color myBlack = {0,0,0,255};
+ fTextRun.count = 1;
+ fTextRun.runs[0].offset = 0;
+ fTextRun.runs[0].font = *be_fixed_font;
+ fTextRun.runs[0].color = myBlack;
- fCredits->Insert (fCreditsText, &fTextRun);
+ fCredits->Insert (fCreditsText, &fTextRun);
- // Center window
- BRect frame (BScreen().Frame());
- MoveTo (
- frame.Width()/2 - Frame().Width()/2,
- frame.Height()/2 - Frame().Height()/2);
- fScrollRunner = new BMessageRunner (BMessenger (this), new BMessage (M_ABOUT_SCROLL),
- 50000);
+ // Center window
+ BRect frame (BScreen().Frame());
+ MoveTo (
+ frame.Width()/2 - Frame().Width()/2,
+ frame.Height()/2 - Frame().Height()/2);
+ fScrollRunner = new BMessageRunner (BMessenger (this), new BMessage (M_ABOUT_SCROLL),
+ 50000);
}
AboutWindow::~AboutWindow (void)
{
- //
+ //
}
bool
AboutWindow::QuitRequested (void)
{
- /*
- * Function purpose: Tell vision_app about our death
- */
- delete fScrollRunner;
- vision_app->PostMessage (M_ABOUT_CLOSE);
-
- return true;
+ /*
+ * Function purpose: Tell vision_app about our death
+ */
+ delete fScrollRunner;
+ vision_app->PostMessage (M_ABOUT_CLOSE);
+
+ return true;
}
void
AboutWindow::AboutImage (const char *, bool)
{
- /*
- * Function purpose: Read image resource bits::{eggName} and display
- */
+ /*
+ * Function purpose: Read image resource bits::{eggName} and display
+ */
-/* TODO : get this working
- BBitmap *bmp;
+/* TODO : get this working
+ BBitmap *bmp;
- if ((bmp = BTranslationUtils::GetBitmap ('bits', eggName)) != 0)
- {
- BRect bmp_bounds (bmp->Bounds());
- graphic->ResizeTo (bmp_bounds.Width(), bmp_bounds.Height());
- graphic->SetViewBitmap (bmp);
- credits->MoveTo (0.0, graphic->Frame().bottom + 1);
- graphic->Invalidate();
- EasterEggOn = egg;
- delete bmp;
- }
+ if ((bmp = BTranslationUtils::GetBitmap ('bits', eggName)) != 0)
+ {
+ BRect bmp_bounds (bmp->Bounds());
+ graphic->ResizeTo (bmp_bounds.Width(), bmp_bounds.Height());
+ graphic->SetViewBitmap (bmp);
+ credits->MoveTo (0.0, graphic->Frame().bottom + 1);
+ graphic->Invalidate();
+ EasterEggOn = egg;
+ delete bmp;
+ }
*/
}
void
AboutWindow::MessageReceived (BMessage *msg)
{
- switch (msg->what)
- {
- case M_ABOUT_SCROLL:
- {
+ switch (msg->what)
+ {
+ case M_ABOUT_SCROLL:
+ {
#if B_BEOS_VERSION_DANO
- fCredits->SetDoubleBuffering(0xf);
+ fCredits->SetDoubleBuffering(0xf);
#endif
- BPoint point (fCredits->PointAt (fCredits->TextLength() - 1));
- fCredits->ScrollBy (0, 1);
+ BPoint point (fCredits->PointAt (fCredits->TextLength() - 1));
+ fCredits->ScrollBy (0, 1);
- if (fCredits->Bounds().bottom > point.y + Bounds().Height())
- fCredits->ScrollTo (0, 0);
- }
- break;
-
- default:
- BWindow::MessageReceived (msg);
- break;
- }
+ if (fCredits->Bounds().bottom > point.y + Bounds().Height())
+ fCredits->ScrollTo (0, 0);
+ }
+ break;
+
+ default:
+ BWindow::MessageReceived (msg);
+ break;
+ }
}
Modified: trunk/Vision/src/AboutWindow.h
===================================================================
--- trunk/Vision/src/AboutWindow.h 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/src/AboutWindow.h 2010-06-14 00:18:28 UTC (rev 916)
@@ -13,13 +13,13 @@
*
* The Initial Developer of the Original Code is The Vision Team.
* Portions created by The Vision Team are
- * Copyright (C) 1999-2010 The Vision Team. All Rights
+ * Copyright (C) 1999-2010 The Vision Team. All Rights
* Reserved.
*
* Contributor(s): Wade Majors <wade@...>
- * Brian Luft
- * Todd Lair
- * Rene Gollent
+ * Brian Luft
+ * Todd Lair
+ * Rene Gollent
*/
#ifndef _ABOUTWINDOW_H_
@@ -34,22 +34,22 @@
class AboutWindow : public BWindow
{
- public:
- AboutWindow (void);
- virtual ~AboutWindow (void);
- virtual void MessageReceived (BMessage *);
- virtual bool QuitRequested (void);
+ public:
+ AboutWindow (void);
+ virtual ~AboutWindow (void);
+ virtual void MessageReceived (BMessage *);
+ virtual bool QuitRequested (void);
- private:
- BTextView *fCredits;
- BView *fBackground,
- *fLogo;
- bool fEasterEggOn;
- const char *fCreditsText;
- text_run_array fTextRun;
- BMessageRunner *fScrollRunner;
-
- void AboutImage (const char *, bool);
+ private:
+ BTextView *fCredits;
+ BView *fBackground,
+ *fLogo;
+ bool fEasterEggOn;
+ const char *fCreditsText;
+ text_run_array fTextRun;
+ BMessageRunner *fScrollRunner;
+
+ void AboutImage (const char *, bool);
};
#endif
Modified: trunk/Vision/src/ChannelAgent.cpp
===================================================================
--- trunk/Vision/src/ChannelAgent.cpp 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/src/ChannelAgent.cpp 2010-06-14 00:18:28 UTC (rev 916)
@@ -13,15 +13,15 @@
*
* The Initial Developer of the Original Code is The Vision Team.
* Portions created by The Vision Team are
- * Copyright (C) 1999-2010 The Vision Team. All Rights
+ * Copyright (C) 1999-2010 The Vision Team. All Rights
* Reserved.
*
* Contributor(s): Wade Majors <wade@...>
- * Rene Gollent
- * Todd Lair
- * Andrew Bazan
- * Jamie Wilkinson
- * Alan Ellis <alan@...>
+ * Rene Gollent
+ * Todd Lair
+ * Andrew Bazan
+ * Jamie Wilkinson
+ * Alan Ellis <alan@...>
*/
#include <Beep.h>
@@ -53,1542 +53,1542 @@
#define B_TRANSLATE_CONTEXT "ChannelWindow"
ChannelAgent::ChannelAgent (
- const char *id_,
- const char *serverName_,
- int ircdtype_,
- const char *nick,
- BMessenger &sMsgr_,
- BRect &frame_)
+ const char *id_,
+ const char *serverName_,
+ int ircdtype_,
+ const char *nick,
+ BMessenger &sMsgr_,
+ BRect &frame_)
- : ClientAgent (
- id_,
- serverName_,
- nick,
- sMsgr_,
- frame_),
+ : ClientAgent (
+ id_,
+ serverName_,
+ nick,
+ sMsgr_,
+ frame_),
- fChanMode (""),
- fChanLimit (""),
- fChanLimitOld (""),
- fChanKey (""),
- fChanKeyOld (""),
- fLastExpansion (""),
- fUserCount (0),
- fOpsCount (0),
- fIrcdtype (ircdtype_),
- fChanOpt (0)
+ fChanMode (""),
+ fChanLimit (""),
+ fChanLimitOld (""),
+ fChanKey (""),
+ fChanKeyOld (""),
+ fLastExpansion (""),
+ fUserCount (0),
+ fOpsCount (0),
+ fIrcdtype (ircdtype_),
+ fChanOpt (0)
{
- /*
- * Function purpose: Consctruct
- */
+ /*
+ * Function purpose: Consctruct
+ */
}
ChannelAgent::~ChannelAgent (void)
{
- /*
- * Function purpose: Clean up
- */
-
- fNamesList->ClearList();
-
- // empty recent nick list
- while (fRecentNicks.CountItems() > 0)
- delete fRecentNicks.RemoveItemAt(0L);
-
- // empty nick completion list
- while (fCompletionNicks.CountItems() > 0)
- delete fCompletionNicks.RemoveItemAt(0L);
+ /*
+ * Function purpose: Clean up
+ */
+
+ fNamesList->ClearList();
+
+ // empty recent nick list
+ while (fRecentNicks.CountItems() > 0)
+ delete fRecentNicks.RemoveItemAt(0L);
+
+ // empty nick completion list
+ while (fCompletionNicks.CountItems() > 0)
+ delete fCompletionNicks.RemoveItemAt(0L);
}
void
ChannelAgent::AttachedToWindow(void)
{
- /*
- * Function purpose: Once the BView has been successfully attached,
- call Init()
- */
-
- Init();
- ClientAgent::AttachedToWindow();
+ /*
+ * Function purpose: Once the BView has been successfully attached,
+ call Init()
+ */
+
+ Init();
+ ClientAgent::AttachedToWindow();
}
void
ChannelAgent::Init (void)
{
- /*
- * Function purpose: Setup everything
- */
-
- const BRect namesRect (vision_app->GetRect ("nameListRect"));
+ /*
+ * Function purpose: Setup everything
+ */
+
+ const BRect namesRect (vision_app->GetRect ("nameListRect"));
- fTextScroll->ResizeTo (
- Frame().Width() - ((namesRect.Width() == 0.0) ? 100 : namesRect.Width()),
- fTextScroll->Frame().Height());
-
- fFrame = Bounds();
- fFrame.left = fTextScroll->Frame().right + 6;
- fFrame.right -= B_V_SCROLL_BAR_WIDTH + 1;
- fFrame.bottom = fTextScroll->Frame().bottom - 1;
-
- fNamesList = new NamesView (fFrame);
-
- fNamesScroll = new BScrollView(
- "scroll_names",
- fNamesList,
- B_FOLLOW_RIGHT | B_FOLLOW_TOP_BOTTOM,
- 0,
- false,
- true,
- B_PLAIN_BORDER);
+ fTextScroll->ResizeTo (
+ Frame().Width() - ((namesRect.Width() == 0.0) ? 100 : namesRect.Width()),
+ fTextScroll->Frame().Height());
+
+ fFrame = Bounds();
+ fFrame.left = fTextScroll->Frame().right + 6;
+ fFrame.right -= B_V_SCROLL_BAR_WIDTH + 1;
+ fFrame.bottom = fTextScroll->Frame().bottom - 1;
+
+ fNamesList = new NamesView (fFrame);
+
+ fNamesScroll = new BScrollView(
+ "scroll_names",
+ fNamesList,
+ B_FOLLOW_RIGHT | B_FOLLOW_TOP_BOTTOM,
+ 0,
+ false,
+ true,
+ B_PLAIN_BORDER);
- fResize = new ResizeView (fNamesList, BRect (fTextScroll->Frame().right + 1,
- Bounds().top + 1, fTextScroll->Frame().right + 5,
- fTextScroll->Frame().Height()), "resize",
- B_FOLLOW_RIGHT | B_FOLLOW_TOP_BOTTOM);
+ fResize = new ResizeView (fNamesList, BRect (fTextScroll->Frame().right + 1,
+ Bounds().top + 1, fTextScroll->Frame().right + 5,
+ fTextScroll->Frame().Height()), "resize",
+ B_FOLLOW_RIGHT | B_FOLLOW_TOP_BOTTOM);
- AddChild (fNamesScroll);
+ AddChild (fNamesScroll);
- AddChild (fResize);
-
- BString joinString = B_TRANSLATE("Now talking in %1");
- joinString.ReplaceFirst("%1", fId.String());
- joinString += "\n";
+ AddChild (fResize);
+
+ BString joinString = B_TRANSLATE("Now talking in %1");
+ joinString.ReplaceFirst("%1", fId.String());
+ joinString += "\n";
- Display (joinString.String(), C_JOIN);
+ Display (joinString.String(), C_JOIN);
}
void
ChannelAgent::Show (void)
{
- const BRect namesListRect (vision_app->GetRect ("namesListRect"));
- float difference (fNamesList->Bounds().Width() - namesListRect.Width());
- if (difference != 0.0)
- {
- fResize->MoveBy (difference, 0.0);
- fTextScroll->ResizeBy (difference, 0.0);
- fNamesScroll->ResizeBy (-difference, 0.0);
- fNamesScroll->MoveBy (difference, 0.0);
- Sync();
- }
-
- ClientAgent::Show();
+ const BRect namesListRect (vision_app->GetRect ("namesListRect"));
+ float difference (fNamesList->Bounds().Width() - namesListRect.Width());
+ if (difference != 0.0)
+ {
+ fResize->MoveBy (difference, 0.0);
+ fTextScroll->ResizeBy (difference, 0.0);
+ fNamesScroll->ResizeBy (-difference, 0.0);
+ fNamesScroll->MoveBy (difference, 0.0);
+ Sync();
+ }
+
+ ClientAgent::Show();
}
int
ChannelAgent::FindPosition (const char *data) const
{
- ASSERT (data != NULL);
- /*
- * Function purpose: Find the index of nickname {data} in the
- * ChannelAgent's NamesView
- */
-
- if (fNamesList == NULL)
- return -1;
-
- int32 count (fNamesList->CountItems());
+ ASSERT (data != NULL);
+ /*
+ * Function purpose: Find the index of nickname {data} in the
+ * ChannelAgent's NamesView
+ */
+
+ if (fNamesList == NULL)
+ return -1;
+
+ int32 count (fNamesList->CountItems());
- for (int32 i = 0; i < count; ++i)
- {
- NameItem *item (static_cast<NameItem *>(fNamesList->ItemAt (i)));
-
- if (item == NULL)
- continue;
-
- BString nick (item->Name());
+ for (int32 i = 0; i < count; ++i)
+ {
+ NameItem *item (static_cast<NameItem *>(fNamesList->ItemAt (i)));
+
+ if (item == NULL)
+ continue;
+
+ BString nick (item->Name());
- if ((nick[0] == '@' || nick[0] == '+' || nick[0] == '%')
- && *data != nick[0])
- nick.Remove (0, 1);
+ if ((nick[0] == '@' || nick[0] == '+' || nick[0] == '%')
+ && *data != nick[0])
+ nick.Remove (0, 1);
- if ((*data == '@' || *data == '+' || *data == '%')
- && nick[0] != *data)
- ++data;
+ if ((*data == '@' || *data == '+' || *data == '%')
+ && nick[0] != *data)
+ ++data;
- if (!nick.ICompare (data))
- return i;
- }
+ if (!nick.ICompare (data))
+ return i;
+ }
- return -1;
+ return -1;
}
const NamesView *
ChannelAgent::pNamesList(void) const
{
- return fNamesList;
+ return fNamesList;
}
void
ChannelAgent::RemoveNickFromList (BObjectList<BString> &list, const char *data)
{
- int32 count (list.CountItems());
- for (int32 i = 0; i < count; i++)
- {
- if (list.ItemAt(i)->ICompare(data) == 0)
- {
- delete list.RemoveItemAt (i);
- break;
- }
- }
+ int32 count (list.CountItems());
+ for (int32 i = 0; i < count; i++)
+ {
+ if (list.ItemAt(i)->ICompare(data) == 0)
+ {
+ delete list.RemoveItemAt (i);
+ break;
+ }
+ }
}
void
ChannelAgent::AddUser (const char *nick, const int32 status)
{
- NameItem *compareItem (NULL);
-
- // make sure this nick doesn't already exist in the list
- // can happen since some ircds allow stealth quits that don't
- // broadcast a quit message
- int32 i;
- for (i = 0; i < fNamesList->CountItems(); i++)
- {
- compareItem = static_cast<NameItem *>(fNamesList->ItemAt(i));
- if (compareItem && compareItem->Name().ICompare(nick) == 0)
- return;
- }
-
- fNamesList->AddItem (new NameItem (nick, status));
- fNamesList->SortItems (SortNames);
+ NameItem *compareItem (NULL);
+
+ // make sure this nick doesn't already exist in the list
+ // can happen since some ircds allow stealth quits that don't
+ // broadcast a quit message
+ int32 i;
+ for (i = 0; i < fNamesList->CountItems(); i++)
+ {
+ compareItem = static_cast<NameItem *>(fNamesList->ItemAt(i));
+ if (compareItem && compareItem->Name().ICompare(nick) == 0)
+ return;
+ }
+
+ fNamesList->AddItem (new NameItem (nick, status));
+ fNamesList->SortItems (SortNames);
- ++fUserCount;
- BString buffer;
- buffer << fUserCount;
- BString *comparator (NULL);
-
- // check if new nickname matches against tab completion sequence and update nick list
- // if so
- if (fLastExpansion.Length() > 0 && fLastExpansion.ICompare(nick, fLastExpansion.Length()) == 0)
- {
- int32 count (fCompletionNicks.CountItems());
- for (i = count - 1; i >= 0; i--)
- {
- comparator = fCompletionNicks.ItemAt (i);
- if (comparator && comparator->ICompare (nick) < 0)
- {
- BString *string (new BString (nick));
- fCompletionNicks.AddItem (string, i+1);
- break;
- }
- }
- }
-
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String());
+ ++fUserCount;
+ BString buffer;
+ buffer << fUserCount;
+ BString *comparator (NULL);
+
+ // check if new nickname matches against tab completion sequence and update nick list
+ // if so
+ if (fLastExpansion.Length() > 0 && fLastExpansion.ICompare(nick, fLastExpansion.Length()) == 0)
+ {
+ int32 count (fCompletionNicks.CountItems());
+ for (i = count - 1; i >= 0; i--)
+ {
+ comparator = fCompletionNicks.ItemAt (i);
+ if (comparator && comparator->ICompare (nick) < 0)
+ {
+ BString *string (new BString (nick));
+ fCompletionNicks.AddItem (string, i+1);
+ break;
+ }
+ }
+ }
+
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String());
}
bool
ChannelAgent::RemoveUser (const char *data)
{
- ASSERT (data != NULL);
- /*
- * Function purpose: Remove nickname {data} from the ChannelAgent's
- * NamesView and update the status counts
- */
-
-
- if (fNamesList == NULL)
- return false;
-
- // if nickname is present in tab completion lists, remove
- RemoveNickFromList(fRecentNicks, data);
- RemoveNickFromList(fCompletionNicks, data);
-
- int32 myIndex (FindPosition (data));
+ ASSERT (data != NULL);
+ /*
+ * Function purpose: Remove nickname {data} from the ChannelAgent's
+ * NamesView and update the status counts
+ */
+
+
+ if (fNamesList == NULL)
+ return false;
+
+ // if nickname is present in tab completion lists, remove
+ RemoveNickFromList(fRecentNicks, data);
+ RemoveNickFromList(fCompletionNicks, data);
+
+ int32 myIndex (FindPosition (data));
- if (myIndex >= 0)
- {
- NameItem *item;
+ if (myIndex >= 0)
+ {
+ NameItem *item;
- fNamesList->Deselect (myIndex);
- if ((item = static_cast<NameItem *>(fNamesList->RemoveItem (myIndex))) != NULL)
- {
- BString buffer;
+ fNamesList->Deselect (myIndex);
+ if ((item = static_cast<NameItem *>(fNamesList->RemoveItem (myIndex))) != NULL)
+ {
+ BString buffer;
- if ((item->Status() & STATUS_OP_BIT) != 0)
- {
- --fOpsCount;
- buffer << fOpsCount;
-
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
+ if ((item->Status() & STATUS_OP_BIT) != 0)
+ {
+ --fOpsCount;
+ buffer << fOpsCount;
+
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
- buffer = "";
- }
+ buffer = "";
+ }
- --fUserCount;
- buffer << fUserCount;
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String());
-
- delete item;
- return true;
- }
- }
-
- return false;
+ --fUserCount;
+ buffer << fUserCount;
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String());
+
+ delete item;
+ return true;
+ }
+ }
+
+ return false;
}
void
ChannelAgent::ChannelMessage (
- const char *msgz,
- const char *nick,
- const char *ident,
- const char *address)
+ const char *msgz,
+ const char *nick,
+ const char *ident,
+ const char *address)
{
- if (nick)
- {
- int32 count (fRecentNicks.CountItems());
- if (count > MAX_RECENT_NICKS)
- {
- delete fRecentNicks.RemoveItemAt (0L);
- }
- // scan for presence of nick in list, and remove duplicate if found
- RemoveNickFromList (fRecentNicks, nick);
- fRecentNicks.AddItem (new BString (nick));
- }
+ if (nick)
+ {
+ int32 count (fRecentNicks.CountItems());
+ if (count > MAX_RECENT_NICKS)
+ {
+ delete fRecentNicks.RemoveItemAt (0L);
+ }
+ // scan for presence of nick in list, and remove duplicate if found
+ RemoveNickFromList (fRecentNicks, nick);
+ fRecentNicks.AddItem (new BString (nick));
+ }
- ClientAgent::ChannelMessage (msgz, nick, ident, address);
+ ClientAgent::ChannelMessage (msgz, nick, ident, address);
}
int
ChannelAgent::AlphaSortNames(const BString *name1, const BString *name2)
{
- /*
- * Function purpose: Help Tab Completion sort nicknames
- *
- * uses strict lexicographic order, ignores the op/voice bits
- */
-
- // clunky way to get around C++ warnings re casting from const void * to NameItem *
-
- // Not sure if this can happen, and we
- // are assuming that if one is NULL
- // we return them as equal. What if one
- // is NULL, and the other isn't?
- if (!name1
- || !name2)
- return 0;
+ /*
+ * Function purpose: Help Tab Completion sort nicknames
+ *
+ * uses strict lexicographic order, ignores the op/voice bits
+ */
+
+ // clunky way to get around C++ warnings re casting from const void * to NameItem *
+
+ // Not sure if this can happen, and we
+ // are assuming that if one is NULL
+ // we return them as equal. What if one
+ // is NULL, and the other isn't?
+ if (!name1
+ || !name2)
+ return 0;
- return name1->ICompare (*name2);
+ return name1->ICompare (*name2);
}
int
ChannelAgent::SortNames(const void *name1, const void *name2)
{
- /*
- * Function purpose: Help NamesView::SortItems() sort nicknames
- *
- * Order:
- * Channel Ops
- * Channel Helper/HalfOps
- * Voiced
- * Normal User
- */
-
- // clunky way to get around C++ warnings re casting from const void * to NameItem *
-
- const NameItem *firstPtr (*((NameItem * const *)name1));
- const NameItem *secondPtr (*((NameItem * const *)name2));
+ /*
+ * Function purpose: Help NamesView::SortItems() sort nicknames
+ *
+ * Order:
+ * Channel Ops
+ * Channel Helper/HalfOps
+ * Voiced
+ * Normal User
+ */
+
+ // clunky way to get around C++ warnings re casting from const void * to NameItem *
+
+ const NameItem *firstPtr (*((NameItem * const *)name1));
+ const NameItem *secondPtr (*((NameItem * const *)name2));
- // Not sure if this can happen, and we
- // are assuming that if one is NULL
- // we return them as equal. What if one
- // is NULL, and the other isn't?
- if (!firstPtr
- || !secondPtr)
- return 0;
+ // Not sure if this can happen, and we
+ // are assuming that if one is NULL
+ // we return them as equal. What if one
+ // is NULL, and the other isn't?
+ if (!firstPtr
+ || !secondPtr)
+ return 0;
- BString first, second;
+ BString first, second;
- first << (((firstPtr)->Status() & STATUS_OP_BIT) ? STATUS_OP_BIT : (firstPtr)->Status());
- second << (((secondPtr)->Status() & STATUS_OP_BIT) ? STATUS_OP_BIT : (secondPtr)->Status());
- first.Prepend ('0', 10 - first.Length());
- second.Prepend ('0', 10 - second.Length());
- first += (firstPtr)->Name();
- second += (secondPtr)->Name();
+ first << (((firstPtr)->Status() & STATUS_OP_BIT) ? STATUS_OP_BIT : (firstPtr)->Status());
+ second << (((secondPtr)->Status() & STATUS_OP_BIT) ? STATUS_OP_BIT : (secondPtr)->Status());
+ first.Prepend ('0', 10 - first.Length());
+ second.Prepend ('0', 10 - second.Length());
+ first += (firstPtr)->Name();
+ second += (secondPtr)->Name();
- return first.ICompare(second);
+ return first.ICompare(second);
}
void
ChannelAgent::TabExpansion (void)
{
- /*
- * Function purpose: Get the characters before the caret's current position,
- * and update the fInput VTextControl with a relevant match
- * from the ChannelAgent's NamesView
- */
-
- int32 start, finish;
- static int32 lastindex;
- static BString lastNick;
- fInput->TextView()->GetSelection (&start, &finish);
+ /*
+ * Function purpose: Get the characters before the caret's current position,
+ * and update the fInput VTextControl with a relevant match
+ * from the ChannelAgent's NamesView
+ */
+
+ int32 start, finish;
+ static int32 lastindex;
+ static BString lastNick;
+ fInput->TextView()->GetSelection (&start, &finish);
- if (fInput->TextView()->TextLength()
- && start == finish
- && start == fInput->TextView()->TextLength())
- {
- const char *fInputText (fInput->TextView()->Text() + fInput->TextView()->TextLength());
- const char *place (fInputText);
+ if (fInput->TextView()->TextLength()
+ && start == finish
+ && start == fInput->TextView()->TextLength())
+ {
+ const char *fInputText (fInput->TextView()->Text() + fInput->TextView()->TextLength());
+ const char *place (fInputText);
- while (place > fInput->TextView()->Text())
- {
- if (*(place - 1) == '\x20')
- break;
+ while (place > fInput->TextView()->Text())
+ {
+ if (*(place - 1) == '\x20')
+ break;
- --place;
- }
+ --place;
+ }
- if (fLastExpansion.Length() == 0
- || fLastExpansion.ICompare(place, fLastExpansion.Length()) != 0
- || lastNick != place)
- {
- lastindex = 0;
- fLastExpansion = place;
+ if (fLastExpansion.Length() == 0
+ || fLastExpansion.ICompare(place, fLastExpansion.Length()) != 0
+ || lastNick != place)
+ {
+ lastindex = 0;
+ fLastExpansion = place;
- while (!fCompletionNicks.IsEmpty())
- delete fCompletionNicks.RemoveItemAt(0L);
-
- int32 count (fNamesList->CountItems()),
- i (0);
-
- for (i = 0; i < count ; i++)
- {
- BString *name (new BString(static_cast<NameItem *>(fNamesList->ItemAt(i))->Name()));
- if (!(name->ICompare(fLastExpansion.String(), strlen(fLastExpansion.String()))))
- fCompletionNicks.AddItem(name);
- else
- delete name;
- }
- // sort items alphabetically
- fCompletionNicks.SortItems (AlphaSortNames);
-
- count = fRecentNicks.CountItems();
- // parse recent nicks in reverse to ensure that they're pushed onto the completion
- // list in the correct order
- for (i = 0; i < count; i++)
- {
- BString *name (new BString(*fRecentNicks.ItemAt(i)));
- if (!(name->ICompare(fLastExpansion.String(), strlen(fLastExpansion.String()))))
- {
- // parse through list and nuke duplicate if present
- for (int32 j = fCompletionNicks.CountItems() - 1; j >= 0; j--)
- {
- if (!(name->ICompare(*fCompletionNicks.ItemAt (j))))
- {
- delete fCompletionNicks.RemoveItemAt(j);
- break;
- }
- }
- fCompletionNicks.AddItem(name, 0);
- }
- else
- delete name;
- }
- }
-
- // We first check if what the user typed matches the channel
- // If that doesn't match, we check the names
- BString insertion;
+ while (!fCompletionNicks.IsEmpty())
+ delete fCompletionNicks.RemoveItemAt(0L);
+
+ int32 count (fNamesList->CountItems()),
+ i (0);
+
+ for (i = 0; i < count ; i++)
+ {
+ BString *name (new BString(static_cast<NameItem *>(fNamesList->ItemAt(i))->Name()));
+ if (!(name->ICompare(fLastExpansion.String(), strlen(fLastExpansion.String()))))
+ fCompletionNicks.AddItem(name);
+ else
+ delete name;
+ }
+ // sort items alphabetically
+ fCompletionNicks.SortItems (AlphaSortNames);
+
+ count = fRecentNicks.CountItems();
+ // parse recent nicks in reverse to ensure that they're pushed onto the completion
+ // list in the correct order
+ for (i = 0; i < count; i++)
+ {
+ BString *name (new BString(*fRecentNicks.ItemAt(i)));
+ if (!(name->ICompare(fLastExpansion.String(), strlen(fLastExpansion.String()))))
+ {
+ // parse through list and nuke duplicate if present
+ for (int32 j = fCompletionNicks.CountItems() - 1; j >= 0; j--)
+ {
+ if (!(name->ICompare(*fCompletionNicks.ItemAt (j))))
+ {
+ delete fCompletionNicks.RemoveItemAt(j);
+ break;
+ }
+ }
+ fCompletionNicks.AddItem(name, 0);
+ }
+ else
+ delete name;
+ }
+ }
+
+ // We first check if what the user typed matches the channel
+ // If that doesn't match, we check the names
+ BString insertion;
- if (!fId.ICompare (place, strlen (place)))
- insertion = fId;
- else
- {
- int32 count = fCompletionNicks.CountItems();
- if (count > 0)
- {
- insertion = *(fCompletionNicks.ItemAt(lastindex++));
-
- if (lastindex == count) lastindex = 0;
- lastNick = insertion;
- }
- }
+ if (!fId.ICompare (place, strlen (place)))
+ insertion = fId;
+ else
+ {
+ int32 count = fCompletionNicks.CountItems();
+ if (count > 0)
+ {
+ insertion = *(fCompletionNicks.ItemAt(lastindex++));
+
+ if (lastindex == count) lastindex = 0;
+ lastNick = insertion;
+ }
+ }
- if (insertion.Length())
- {
- // check if we are at the beginning of a line
- // (ignoring whitespace). if we are, prepend a colon to the nick being
- // inserted
+ if (insertion.Length())
+ {
+ // check if we are at the beginning of a line
+ // (ignoring whitespace). if we are, prepend a colon to the nick being
+ // inserted
#if 0
- const char *place2 = place;
- while (place2 > fInput->TextView()->Text())
- {
- --place2;
- if (*place2 != 0x20)
- break;
- }
- if (place2 == fInput->TextView()->Text())
+ const char *place2 = place;
+ while (place2 > fInput->TextView()->Text())
+ {
+ --place2;
+ if (*place2 != 0x20)
+ break;
+ }
+ if (place2 == fInput->TextView()->Text())
insertion += ": ";
#endif
- fInput->TextView()->Delete (
- place - fInput->TextView()->Text(),
- fInput->TextView()->TextLength());
+ fInput->TextView()->Delete (
+ place - fInput->TextView()->Text(),
+ fInput->TextView()->TextLength());
- fInput->TextView()->Insert (insertion.String());
- fInput->TextView()->Select (
- fInput->TextView()->TextLength(),
- fInput->TextView()->TextLength());
- }
- }
+ fInput->TextView()->Insert (insertion.String());
+ fInput->TextView()->Select (
+ fInput->TextView()->TextLength(),
+ fInput->TextView()->TextLength());
+ }
+ }
}
void
ChannelAgent::AddMenuItems (BPopUpMenu *pMenu)
{
- BMenuItem *item (NULL);
- item = new BMenuItem("Channel Options", new BMessage (M_CHANNEL_OPTIONS_SHOW));
- item->SetTarget (this);
- pMenu->AddItem (item);
- pMenu->AddSeparatorItem();
+ BMenuItem *item (NULL);
+ item = new BMenuItem("Channel Options", new BMessage (M_CHANNEL_OPTIONS_SHOW));
+ item->SetTarget (this);
+ pMenu->AddItem (item);
+ pMenu->AddSeparatorItem();
}
void
ChannelAgent::MessageReceived (BMessage *msg)
{
- int32 i (0);
-
- switch (msg->what)
- {
- case M_USER_QUIT:
- {
- const char *nick (NULL);
+ int32 i (0);
+
+ switch (msg->what)
+ {
+ case M_USER_QUIT:
+ {
+ const char *nick (NULL);
- msg->FindString ("nick", &nick);
+ msg->FindString ("nick", &nick);
- if (RemoveUser (nick))
- {
- BMessage display;
+ if (RemoveUser (nick))
+ {
+ BMessage display;
- if (msg->FindMessage ("display", &display) == B_NO_ERROR)
- ClientAgent::MessageReceived (&display);
- }
- }
- break;
+ if (msg->FindMessage ("display", &display) == B_NO_ERROR)
+ ClientAgent::MessageReceived (&display);
+ }
+ }
+ break;
- case M_USER_ADD:
- {
- const char *nick (NULL);
- bool ignore (false);
-
- int32 iStatus (STATUS_NORMAL_BIT);
+ case M_USER_ADD:
+ {
+ const char *nick (NULL);
+ bool ignore (false);
+
+ int32 iStatus (STATUS_NORMAL_BIT);
- msg->FindString ("nick", &nick);
- msg->FindBool ("ignore", &ignore);
- if (nick == NULL)
- {
- printf("ERROR: attempted to AddUser an empty nick in ChannelAgent, channel: %s\n", fId.String());
- break;
- }
+ msg->FindString ("nick", &nick);
+ msg->FindBool ("ignore", &ignore);
+ if (nick == NULL)
+ {
+ printf("ERROR: attempted to AddUser an empty nick in ChannelAgent, channel: %s\n", fId.String());
+ break;
+ }
- if (ignore) iStatus |= STATUS_IGNORE_BIT;
-
- AddUser (nick, iStatus);
+ if (ignore) iStatus |= STATUS_IGNORE_BIT;
+
+ AddUser (nick, iStatus);
- BMessage display;
- if (msg->FindMessage ("display", &display) == B_NO_ERROR)
- ClientAgent::MessageReceived (&display);
- }
- break;
+ BMessage display;
+ if (msg->FindMessage ("display", &display) == B_NO_ERROR)
+ ClientAgent::MessageReceived (&display);
+ }
+ break;
- case M_CHANGE_NICK:
- {
- const char *oldNick (NULL), *newNick (NULL);
- NameItem *item (NULL);
- int32 thePos (-1);
+ case M_CHANGE_NICK:
+ {
+ const char *oldNick (NULL), *newNick (NULL);
+ NameItem *item (NULL);
+ int32 thePos (-1);
- if ((msg->FindString ("oldnick", &oldNick) != B_OK) ||
- (msg->FindString ("newnick", &newNick) != B_OK))
- {
- printf("Error: invalid pointer, ChannelAgent::MessageReceived, M_CHANGE_NICK");
- break;
- }
+ if ((msg->FindString ("oldnick", &oldNick) != B_OK) ||
+ (msg->FindString ("newnick", &newNick) != B_OK))
+ {
+ printf("Error: invalid pointer, ChannelAgent::MessageReceived, M_CHANGE_NICK");
+ break;
+ }
- if (fMyNick.ICompare (oldNick) == 0 && !IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_NICK, newNick);
+ if (fMyNick.ICompare (oldNick) == 0 && !IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_NICK, newNick);
- if (((thePos = FindPosition (oldNick)) >= 0)
- && ((item = (static_cast<NameItem *>(fNamesList->ItemAt (thePos)))) != 0))
- {
- item->SetName (newNick);
- fNamesList->SortItems (SortNames);
- if (fLastExpansion.ICompare (oldNick, fLastExpansion.Length()) == 0)
- {
- int32 count (fRecentNicks.CountItems());
- BString *name (NULL);
-
- for (i = 0; i < count ; i++)
- if ((name = fRecentNicks.ItemAt (i))->ICompare (oldNick) == 0)
- {
- if (fLastExpansion.ICompare (newNick, fLastExpansion.Length()) == 0)
- name->SetTo (newNick);
- else
- delete fRecentNicks.RemoveItemAt (i);
- break;
- }
- count = fCompletionNicks.CountItems();
- for (i = 0; i < count; i++)
- if ((name = fCompletionNicks.ItemAt (i))->ICompare (oldNick) == 0)
- {
- if (fLastExpansion.ICompare (newNick, fLastExpansion.Length()) == 0)
- name->SetTo (newNick);
- else
- delete fCompletionNicks.RemoveItemAt (i);
- break;
- }
- }
- }
- else
- break;
-
- ClientAgent::MessageReceived (msg);
- }
- break;
+ if (((thePos = FindPosition (oldNick)) >= 0)
+ && ((item = (static_cast<NameItem *>(fNamesList->ItemAt (thePos)))) != 0))
+ {
+ item->SetName (newNick);
+ fNamesList->SortItems (SortNames);
+ if (fLastExpansion.ICompare (oldNick, fLastExpansion.Length()) == 0)
+ {
+ int32 count (fRecentNicks.CountItems());
+ BString *name (NULL);
+
+ for (i = 0; i < count ; i++)
+ if ((name = fRecentNicks.ItemAt (i))->ICompare (oldNick) == 0)
+ {
+ if (fLastExpansion.ICompare (newNick, fLastExpansion.Length()) == 0)
+ name->SetTo (newNick);
+ else
+ delete fRecentNicks.RemoveItemAt (i);
+ break;
+ }
+ count = fCompletionNicks.CountItems();
+ for (i = 0; i < count; i++)
+ if ((name = fCompletionNicks.ItemAt (i))->ICompare (oldNick) == 0)
+ {
+ if (fLastExpansion.ICompare (newNick, fLastExpansion.Length()) == 0)
+ name->SetTo (newNick);
+ else
+ delete fCompletionNicks.RemoveItemAt (i);
+ break;
+ }
+ }
+ }
+ else
+ break;
+
+ ClientAgent::MessageReceived (msg);
+ }
+ break;
- case M_CHANNEL_NAMES:
- {
- for (i = 0; msg->HasString ("nick", i); ++i)
- {
- const char *nick (NULL);
- bool founder (false),
- protect (false),
- op (false),
- voice (false),
- helper (false),
- ignored (false);
+ case M_CHANNEL_NAMES:
+ {
+ for (i = 0; msg->HasString ("nick", i); ++i)
+ {
+ const char *nick (NULL);
+ bool founder (false),
+ protect (false),
+ op (false),
+ voice (false),
+ helper (false),
+ ignored (false);
- msg->FindString ("nick", i, &nick);
- msg->FindBool ("founder", i, &founder);
- msg->FindBool ("protect", i, &protect);
- msg->FindBool ("op", i, &op);
- msg->FindBool ("voice", i, &voice);
- msg->FindBool ("helper", i, &helper);
- msg->FindBool ("ignored", i, &ignored);
-
- if (FindPosition (nick) < 0)
- {
- int32 iStatus (ignored ? STATUS_IGNORE_BIT : 0);
-
- if (founder)
- {
- ++nick;
- ++fOpsCount;
- iStatus |= STATUS_FOUNDER_BIT;
- }
- else if (protect)
- {
- ++nick;
- ++fOpsCount;
- iStatus |= STATUS_PROTECTED_BIT;
- }
- else if (op)
- {
- ++nick;
- ++fOpsCount;
- iStatus |= STATUS_OP_BIT;
- }
- else if (voice)
- {
- ++nick;
- iStatus |= STATUS_VOICE_BIT;
- }
- else if (helper)
- {
- ++nick;
- iStatus |= STATUS_HELPER_BIT;
- }
- else
- iStatus |= STATUS_NORMAL_BIT;
+ msg->FindString ("nick", i, &nick);
+ msg->FindBool ("founder", i, &founder);
+ msg->FindBool ("protect", i, &protect);
+ msg->FindBool ("op", i, &op);
+ msg->FindBool ("voice", i, &voice);
+ msg->FindBool ("helper", i, &helper);
+ msg->FindBool ("ignored", i, &ignored);
+
+ if (FindPosition (nick) < 0)
+ {
+ int32 iStatus (ignored ? STATUS_IGNORE_BIT : 0);
+
+ if (founder)
+ {
+ ++nick;
+ ++fOpsCount;
+ iStatus |= STATUS_FOUNDER_BIT;
+ }
+ else if (protect)
+ {
+ ++nick;
+ ++fOpsCount;
+ iStatus |= STATUS_PROTECTED_BIT;
+ }
+ else if (op)
+ {
+ ++nick;
+ ++fOpsCount;
+ iStatus |= STATUS_OP_BIT;
+ }
+ else if (voice)
+ {
+ ++nick;
+ iStatus |= STATUS_VOICE_BIT;
+ }
+ else if (helper)
+ {
+ ++nick;
+ iStatus |= STATUS_HELPER_BIT;
+ }
+ else
+ iStatus |= STATUS_NORMAL_BIT;
- fUserCount++;
+ fUserCount++;
- fNamesList->AddItem (new NameItem (nick, iStatus));
- }
- }
-
- fNamesList->SortItems (SortNames);
+ fNamesList->AddItem (new NameItem (nick, iStatus));
+ }
+ }
+
+ fNamesList->SortItems (SortNames);
- if (!IsHidden())
- {
- BString buffer;
- buffer << fOpsCount;
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
+ if (!IsHidden())
+ {
+ BString buffer;
+ buffer << fOpsCount;
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
- buffer = "";
- buffer << fUserCount;
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String());
- }
- }
- break;
-
- case M_RESIZE_VIEW:
- {
- BPoint point;
- msg->FindPoint ("loc", &point);
- point.x -= Frame().left;
- float offset (point.x - fNamesScroll->Frame().left);
- fResize->MoveBy (offset, 0.0);
- fTextScroll->ResizeBy (offset, 0.0);
- fNamesScroll->ResizeBy (-offset, 0.0);
- fNamesScroll->MoveBy (offset, 0.0);
- BRect namesRect (0, 0, fNamesScroll->Bounds().Width(), 0);
- vision_app->SetRect ("namesListRect", namesRect);
- }
- break;
+ buffer = "";
+ buffer << fUserCount;
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String());
+ }
+ }
+ break;
+
+ case M_RESIZE_VIEW:
+ {
+ BPoint point;
+ msg->FindPoint ("loc", &point);
+ point.x -= Frame().left;
+ float offset (point.x - fNamesScroll->Frame().left);
+ fResize->MoveBy (offset, 0.0);
+ fTextScroll->ResizeBy (offset, 0.0);
+ fNamesScroll->ResizeBy (-offset, 0.0);
+ fNamesScroll->MoveBy (offset, 0.0);
+ BRect namesRect (0, 0, fNamesScroll->Bounds().Width(), 0);
+ vision_app->SetRect ("namesListRect", namesRect);
+ }
+ break;
- case M_SERVER_DISCONNECT:
- {
- // clear names list on disconnect
- fNamesList->ClearList();
- fOpsCount = 0;
- fUserCount = 0;
-
- // clear heuristics completion list - this ensures that no stale nicks are left
- // over in it after reconnect -- list will quickly be rebuilt anyhow if there
- // is any conversation whatsoever going on
- while (fRecentNicks.CountItems() > 0)
- delete fRecentNicks.RemoveItemAt(0L);
-
- }
- break;
-
- case M_REJOIN:
- {
- const char *newNick (NULL);
-
- if (msg->FindString ("nickname", &newNick) != B_OK)
- {
- printf("Error: ChannelAgent::MessageReceived, M_REJOIN: invalid pointer\n");
- break;
- }
+ case M_SERVER_DISCONNECT:
+ {
+ // clear names list on disconnect
+ fNamesList->ClearList();
+ fOpsCount = 0;
+ fUserCount = 0;
+
+ // clear heuristics completion list - this ensures that no stale nicks are left
+ // over in it after reconnect -- list will quickly be rebuilt anyhow if there
+ // is any conversation whatsoever going on
+ while (fRecentNicks.CountItems() > 0)
+ delete fRecentNicks.RemoveItemAt(0L);
+
+ }
+ break;
+
+ case M_REJOIN:
+ {
+ const char *newNick (NULL);
+
+ if (msg->FindString ("nickname", &newNick) != B_OK)
+ {
+ printf("Error: ChannelAgent::MessageReceived, M_REJOIN: invalid pointer\n");
+ break;
+ }
- fMyNick = newNick; // update nickname (might have changed on reconnect)
-
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_NICK, fMyNick.String());
-
- BString rejoinString = "[@] ";
- rejoinString += B_TRANSLATE("Attempting to rejoin ");
- rejoinString += B_UTF8_ELLIPSIS "\n";
-
- Display (rejoinString.String(), C_ERROR, C_BACKGROUND, F_SERVER);
+ fMyNick = newNick; // update nickname (might have changed on reconnect)
+
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_NICK, fMyNick.String());
+
+ BString rejoinString = "[@] ";
+ rejoinString += B_TRANSLATE("Attempting to rejoin ");
+ rejoinString += B_UTF8_ELLIPSIS "\n";
+
+ Display (rejoinString.String(), C_ERROR, C_BACKGROUND, F_SERVER);
- // send join cmd
- BMessage send (M_SERVER_SEND);
- AddSend (&send, "JOIN ");
- AddSend (&send, fId);
- if (fChanKey != "")
- {
- AddSend (&send, " ");
- AddSend (&send, fChanKey);
- }
- AddSend (&send, endl);
- }
- break;
-
- case M_CHANNEL_TOPIC:
- {
- const char *theTopic (NULL);
- BString buffer;
+ // send join cmd
+ BMessage send (M_SERVER_SEND);
+ AddSend (&send, "JOIN ");
+ AddSend (&send, fId);
+ if (fChanKey != "")
+ {
+ AddSend (&send, " ");
+ AddSend (&send, fChanKey);
+ }
+ AddSend (&send, endl);
+ }
+ break;
+
+ case M_CHANNEL_TOPIC:
+ {
+ const char *theTopic (NULL);
+ BString buffer;
- if (msg->FindString ("topic", &theTopic) != B_OK)
- {
- printf("ChannelAgent::MessageReceived, M_CHANNEL_TOPIC: invalid pointer\n");
- break;
- }
- fTopic = theTopic;
-
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_META, FilterCrap(theTopic, true).String());
+ if (msg->FindString ("topic", &theTopic) != B_OK)
+ {
+ printf("ChannelAgent::MessageReceived, M_CHANNEL_TOPIC: invalid pointer\n");
+ break;
+ }
+ fTopic = theTopic;
+
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_META, FilterCrap(theTopic, true).String());
- BMessage display;
-
- if (msg->FindMessage ("display", &display) == B_NO_ERROR)
- ClientAgent::MessageReceived (&display);
- }
- break;
+ BMessage display;
+
+ if (msg->FindMessage ("display", &display) == B_NO_ERROR)
+ ClientAgent::MessageReceived (&display);
+ }
+ break;
- case M_OPEN_MSGAGENT:
- {
- const char *theNick (NULL);
- msg->FindString("nick", &theNick);
-
- if (theNick == NULL)
- {
- NameItem *myUser;
- int32 pos = fNamesList->CurrentSelection();
- if (pos >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt (pos));
- BString targetNick = myUser->Name();
- msg->AddString ("nick", targetNick.String());
- }
- }
-
- fSMsgr.SendMessage (msg);
- }
- break;
+ case M_OPEN_MSGAGENT:
+ {
+ const char *theNick (NULL);
+ msg->FindString("nick", &theNick);
+
+ if (theNick == NULL)
+ {
+ NameItem *myUser;
+ int32 pos = fNamesList->CurrentSelection();
+ if (pos >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt (pos));
+ BString targetNick = myUser->Name();
+ msg->AddString ("nick", targetNick.String());
+ }
+ }
+
+ fSMsgr.SendMessage (msg);
+ }
+ break;
- case M_CHANNEL_GOT_KICKED:
- {
- const char *theChannel (NULL),
- *kicker (NULL), *rest (NULL);
-
- if ((msg->FindString ("channel", &theChannel) != B_OK) ||
- (msg->FindString ("kicker", &kicker) != B_OK) ||
- (msg->FindString ("rest", &rest) != B_OK))
- {
- printf("Error: ClientAgent::MessageReceived, M_CHANNEL_GOT_KICKED, invalid pointer\n");
- break;
- }
+ case M_CHANNEL_GOT_KICKED:
+ {
+ const char *theChannel (NULL),
+ *kicker (NULL), *rest (NULL);
+
+ if ((msg->FindString ("channel", &theChannel) != B_OK) ||
+ (msg->FindString ("kicker", &kicker) != B_OK) ||
+ (msg->FindString ("rest", &rest) != B_OK))
+ {
+ printf("Error: ClientAgent::MessageReceived, M_CHANNEL_GOT_KICKED, invalid pointer\n");
+ break;
+ }
- BMessage wegotkicked (M_DISPLAY); // "you were kicked"
- BString buffer = "*** ";
- buffer += B_TRANSLATE("You have been kicked from %1 by %2 (%3)");
- buffer.ReplaceFirst("%1", theChannel);
- buffer.ReplaceFirst("%2", kicker);
- buffer.ReplaceFirst("%3", rest);
- buffer += "\n";
-
- PackDisplay (&wegotkicked, buffer.String(), C_QUIT, C_BACKGROUND, F_TEXT);
+ BMessage wegotkicked (M_DISPLAY); // "you were kicked"
+ BString buffer = "*** ";
+ buffer += B_TRANSLATE("You have been kicked from %1 by %2 (%3)");
+ buffer.ReplaceFirst("%1", theChannel);
+ buffer.ReplaceFirst("%2", kicker);
+ buffer.ReplaceFirst("%3", rest);
+ buffer += "\n";
+
+ PackDisplay (&wegotkicked, buffer.String(), C_QUIT, C_BACKGROUND, F_TEXT);
- // clean up
- fNamesList->ClearList();
- fOpsCount = 0;
- fUserCount = 0;
-
- fMsgr.SendMessage (&wegotkicked);
+ // clean up
+ fNamesList->ClearList();
+ fOpsCount = 0;
+ fUserCount = 0;
+
+ fMsgr.SendMessage (&wegotkicked);
- BMessage attemptrejoin (M_DISPLAY); // "you were kicked"
- buffer = "*** ";
- buffer += B_TRANSLATE("Attempting to rejoin %1");
- buffer.ReplaceFirst("%1", theChannel);
- buffer += B_UTF8_ELLIPSIS "\n";
- PackDisplay (&attemptrejoin, buffer.String(), C_QUIT, C_BACKGROUND, F_TEXT);
- fMsgr.SendMessage (&attemptrejoin);
+ BMessage attemptrejoin (M_DISPLAY); // "you were kicked"
+ buffer = "*** ";
+ buffer += B_TRANSLATE("Attempting to rejoin %1");
+ buffer.ReplaceFirst("%1", theChannel);
+ buffer += B_UTF8_ELLIPSIS "\n";
+ PackDisplay (&attemptrejoin, buffer.String(), C_QUIT, C_BACKGROUND, F_TEXT);
+ fMsgr.SendMessage (&attemptrejoin);
- BMessage send (M_SERVER_SEND);
- AddSend (&send, "JOIN ");
- AddSend (&send, theChannel);
- if (fChanKey != "")
- {
- AddSend (&send, " ");
- AddSend (&send, fChanKey);
- }
- AddSend (&send, endl);
- }
- break;
+ BMessage send (M_SERVER_SEND);
+ AddSend (&send, "JOIN ");
+ AddSend (&send, theChannel);
+ if (fChanKey != "")
+ {
+ AddSend (&send, " ");
+ AddSend (&send, fChanKey);
+ }
+ AddSend (&send, endl);
+ }
+ break;
- case M_CHANNEL_MODE:
- {
- ModeEvent (msg);
- }
- break;
-
- case M_CHANNEL_MSG:
- {
- bool hasNick (false);
- BString tempString,
- theNick,
- knownAs;
- msg->FindString ("msgz", &tempString);
- msg->FindString ("nick", &theNick);
- if (theNick != fMyNick)
- FirstKnownAs (tempString, knownAs, &hasNick);
-
- if (IsHidden())
- {
- UpdateStatus((hasNick) ? WIN_NICK_BIT : WIN_NEWS_BIT);
+ case M_CHANNEL_MODE:
+ {
+ ModeEvent (msg);
+ }
+ break;
+
+ case M_CHANNEL_MSG:
+ {
+ bool hasNick (false);
+ BString tempString,
+ theNick,
+ knownAs;
+ msg->FindString ("msgz", &tempString);
+ msg->FindString ("nick", &theNick);
+ if (theNick != fMyNick)
+ FirstKnownAs (tempString, knownAs, &hasNick);
+
+ if (IsHidden())
+ {
+ UpdateStatus((hasNick) ? WIN_NICK_BIT : WIN_NEWS_BIT);
#ifdef USE_INFOPOPPER
- if (hasNick)
- {
- if (tempString[0] == '\1')
- {
- tempString.RemoveFirst("\1ACTION ");
- tempString.RemoveLast ("\1");
- }
+ if (hasNick)
+ {
+ if (tempString[0] == '\1')
+ {
+ tempString.RemoveFirst("\1ACTION ");
+ tempString.RemoveLast ("\1");
+ }
- if (be_roster->IsRunning(InfoPopperAppSig) == true) {
- entry_ref ref = vision_app->AppRef();
- BMessage infoMsg(InfoPopper::AddMessage);
- infoMsg.AddString("appTitle", S_INFOPOPPER_TITLE);
- infoMsg.AddString("title", fServerName.String());
- infoMsg.AddInt8("type", (int8)InfoPopper::Important);
-
- infoMsg.AddInt32("iconType", InfoPopper::Attribute);
- infoMsg.AddRef("iconRef", &ref);
-
- BString content;
- content << fId << " - " << theNick << " said: " << tempString;
- infoMsg.AddString("content", content);
-
- BMessenger(InfoPopperAppSig).SendMessage(&infoMsg);
- };
- }
+ if (be_roster->IsRunning(InfoPopperAppSig) == true) {
+ entry_ref ref = vision_app->AppRef();
+ BMessage infoMsg(InfoPopper::AddMessage);
+ infoMsg.AddString("appTitle", S_INFOPOPPER_TITLE);
+ infoMsg.AddString("title", fServerName.String());
+ infoMsg.AddInt8("type", (int8)InfoPopper::Important);
+
+ infoMsg.AddInt32("iconType", InfoPopper::Attribute);
+ infoMsg.AddRef("iconRef", &ref);
+
+ BString content;
+ content << fId << " - " << theNick << " said: " << tempString;
+ infoMsg.AddString("content", content);
+
+ BMessenger(InfoPopperAppSig).SendMessage(&infoMsg);
+ };
+ }
#endif
- }
- else if (hasNick)
- system_beep(kSoundEventNames[(uint32)seNickMentioned]);
+ }
+ else if (hasNick)
+ system_beep(kSoundEventNames[(uint32)seNickMentioned]);
- ClientAgent::MessageReceived (msg);
- }
- break;
+ ClientAgent::MessageReceived (msg);
+ }
+ break;
- case M_CHANNEL_MODES:
- {
- const char *mode (NULL),
- *chan (NULL),
- *msgz (NULL);
-
- if ((msg->FindString ("mode", &mode) != B_OK) ||
- (msg->FindString ("chan", &chan) != B_OK) ||
- (msg->FindString ("msgz", &msgz) != B_OK))
- {
- printf("Error: ChannelAgent::MessageReceived, M_CHANNEL_MODES: invalid pointer\n");
- break;
- }
+ case M_CHANNEL_MODES:
+ {
+ const char *mode (NULL),
+ *chan (NULL),
+ *msgz (NULL);
+
+ if ((msg->FindString ("mode", &mode) != B_OK) ||
+ (msg->FindString ("chan", &chan) != B_OK) ||
+ (msg->FindString ("msgz", &msgz) != B_OK))
+ {
+ printf("Error: ChannelAgent::MessageReceived, M_CHANNEL_MODES: invalid pointer\n");
+ break;
+ }
- if (fId.ICompare (chan) == 0)
- {
- BString realMode (GetWord (mode, 1));
- int32 place (2);
+ if (fId.ICompare (chan) == 0)
+ {
+ BString realMode (GetWord (mode, 1));
+ int32 place (2);
- if (realMode.FindFirst ("l") >= 0)
- fChanLimit = GetWord (mode, place++);
+ if (realMode.FindFirst ("l") >= 0)
+ fChanLimit = GetWord (mode, place++);
- if (realMode.FindFirst ("k") >= 0)
- {
- fChanKey = GetWord (mode, place++);
-
- // u2 may not send the channel key, thats why we stored the /join cmd
- // in a string in ParseCmd
- if (fChanKey == "*" && fIrcdtype == IRCD_UNDERNET)
- {
- BString tempId (fId);
- tempId.Remove (0, 1); // remove any #, &, !, blah.
-
- if (vision_app->pClientWin()->joinStrings.FindFirst (tempId) < 1)
- {
- // can't find the join cmd for this channel in joinStrings!
- }
- else
- {
- BString joinStringsL (vision_app->pClientWin()->joinStrings);
-
- // FindLast to make sure we get the last attempt (user might have
- // tried several keys)
- int32 idPos (joinStringsL.FindLast (tempId));
- BString tempKeyString;
- joinStringsL.MoveInto (tempKeyString, idPos, joinStringsL.Length());
-
- fChanKey = GetWord (tempKeyString.String(), 2);
- }
- } // end u2-kludge stuff
-
- }
- fChanMode = mode;
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_MODES, fChanMode.String());
- }
-
- BMessage dispMsg (M_DISPLAY);
- PackDisplay (&dispMsg, msgz, C_OP, C_BACKGROUND, F_TEXT);
- BMessenger display (this);
- display.SendMessage (&dispMsg);
- }
- break;
+ if (realMode.FindFirst ("k") >= 0)
+ {
+ fChanKey = GetWord (mode, place++);
+
+ // u2 may not send the channel key, thats why we stored the /join cmd
+ // in a string in ParseCmd
+ if (fChanKey == "*" && fIrcdtype == IRCD_UNDERNET)
+ {
+ BString tempId (fId);
+ tempId.Remove (0, 1); // remove any #, &, !, blah.
+
+ if (vision_app->pClientWin()->joinStrings.FindFirst (tempId) < 1)
+ {
+ // can't find the join cmd for this channel in joinStrings!
+ }
+ else
+ {
+ BString joinStringsL (vision_app->pClientWin()->joinStrings);
+
+ // FindLast to make sure we get the last attempt (user might have
+ // tried several keys)
+ int32 idPos (joinStringsL.FindLast (tempId));
+ BString tempKeyString;
+ joinStringsL.MoveInto (tempKeyString, idPos, joinStringsL.Length());
+
+ fChanKey = GetWord (tempKeyString.String(), 2);
+ }
+ } // end u2-kludge stuff
+
+ }
+ fChanMode = mode;
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_MODES, fChanMode.String());
+ }
+
+ BMessage dispMsg (M_DISPLAY);
+ PackDisplay (&dispMsg, msgz, C_OP, C_BACKGROUND, F_TEXT);
+ BMessenger display (this);
+ display.SendMessage (&dispMsg);
+ }
+ break;
- case M_NAMES_POPUP_MODE:
- {
- const char *inaction (NULL);
-
- msg->FindString ("action", &inaction);
+ case M_NAMES_POPUP_MODE:
+ {
+ const char *inaction (NULL);
+
+ msg->FindString ("action", &inaction);
- int32 count (0), index (0);
-
- BString victims,
- targetNick,
- action (inaction),
- modechar,
- polarity;
-
- NameItem *myUser (NULL);
+ int32 count (0), index (0);
+
+ BString victims,
+ targetNick,
+ action (inaction),
+ modechar,
+ polarity;
+
+ NameItem *myUser (NULL);
- /// action ///
- if (action.FindFirst ("voice") >= 0)
- modechar = "v";
- else if (action.FindFirst ("op") >= 0)
- modechar = "o";
- else
- break;
+ /// action ///
+ if (action.FindFirst ("voice") >= 0)
+ modechar = "v";
+ else if (action.FindFirst ("op") >= 0)
+ modechar = "o";
+ else
+ break;
- /// polarity ///
- if (action.FindFirst ("de") >= 0)
- polarity += " -";
- else
- polarity += " +";
+ /// polarity ///
+ if (action.FindFirst ("de") >= 0)
+ polarity += " -";
+ else
+ polarity += " +";
- /// iterate ///
- while ((i = fNamesList->CurrentSelection (index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection (index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
+ targetNick = myUser->Name();
- victims += " ";
- victims += targetNick;
- count++;
- }
+ victims += " ";
+ victims += targetNick;
+ count++;
+ }
- BString command ("/mode ");
- command += fId;
- command += polarity;
+ BString command ("/mode ");
+ command += fId;
+ command += polarity;
- for (i = 0; i < count; i++)
- command += modechar;
+ for (i = 0; i < count; i++)
+ command += modechar;
- command += victims;
+ command += victims;
- ParseCmd (command.String());
- }
- break;
+ ParseCmd (command.String());
+ }
+ break;
- case M_NAMES_POPUP_CTCP:
- {
- const char *inaction (NULL);
-
- msg->FindString ("action", &inaction);
+ case M_NAMES_POPUP_CTCP:
+ {
+ const char *inaction (NULL);
+
+ msg->FindString ("action", &inaction);
- int32 index (0);
- BString victims,
- targetNick,
- action (inaction);
- NameItem *myUser (NULL);
- action.ToUpper();
+ int32 index (0);
+ BString victims,
+ targetNick,
+ action (inaction);
+ NameItem *myUser (NULL);
+ action.ToUpper();
- /// iterate ///
- while ((i = fNamesList->CurrentSelection (index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection (index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
+ targetNick = myUser->Name();
- victims += targetNick;
- victims += ",";
- }
+ victims += targetNick;
+ victims += ",";
+ }
- victims.RemoveLast (",");
+ victims.RemoveLast (",");
- BString command ("/ctcp ");
- command += victims;
- command += " ";
- command += action;
+ BString command ("/ctcp ");
+ command += victims;
+ command += " ";
+ command += action;
- ParseCmd (command.String());
- }
- break;
+ ParseCmd (command.String());
+ }
+ break;
- case M_NAMES_POPUP_WHOIS:
- {
- int32 index (0);
- BString victims,
- targetNick;
- NameItem *myUser (NULL);
+ case M_NAMES_POPUP_WHOIS:
+ {
+ int32 index (0);
+ BString victims,
+ targetNick;
+ NameItem *myUser (NULL);
- /// iterate ///
- while ((i = fNamesList->CurrentSelection (index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection (index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
+ targetNick = myUser->Name();
- victims += targetNick;
- victims += ",";
- }
+ victims += targetNick;
+ victims += ",";
+ }
- victims.RemoveLast (",");
-
- BString command ("/whois ");
- command += victims;
+ victims.RemoveLast (",");
+
+ BString command ("/whois ");
+ command += victims;
- ParseCmd (command.String());
- }
- break;
-
- case M_NAMES_POPUP_NOTIFY:
- {
- int32 index (0);
- BString victims,
- targetNick;
- NameItem *myUser (NULL);
+ ParseCmd (command.String());
+ }
+ break;
+
+ case M_NAMES_POPUP_NOTIFY:
+ {
+ int32 index (0);
+ BString victims,
+ targetNick;
+ NameItem *myUser (NULL);
- /// iterate ///
- while ((i = fNamesList->CurrentSelection (index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection (index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt (i));
+ targetNick = myUser->Name();
- victims += targetNick;
- victims += " ";
- }
+ victims += targetNick;
+ victims += " ";
+ }
- victims.RemoveLast (",");
-
- BString command ("/notify ");
- command += victims;
+ victims.RemoveLast (",");
+
+ BString command ("/notify ");
+ command += victims;
- ParseCmd (command.String());
+ ParseCmd (command.String());
- }
- break;
+ }
+ break;
- case M_NAMES_POPUP_DCCCHAT:
- {
- int32 index (0);
- BString targetNick;
- NameItem *myUser (NULL);
+ case M_NAMES_POPUP_DCCCHAT:
+ {
+ int32 index (0);
+ BString targetNick;
+ NameItem *myUser (NULL);
- /// iterate ///
- while ((i = fNamesList->CurrentSelection(index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt(i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection(index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt(i));
+ targetNick = myUser->Name();
- BString command ("/dcc chat ");
- command += targetNick;
+ BString command ("/dcc chat ");
+ command += targetNick;
- ParseCmd (command.String());
- }
- }
- break;
-
- case M_NAMES_POPUP_DCCSEND:
- {
- int32 index (0);
- BString targetNick;
- NameItem *myUser (NULL);
+ ParseCmd (command.String());
+ }
+ }
+ break;
+
+ case M_NAMES_POPUP_DCCSEND:
+ {
+ int32 index (0);
+ BString targetNick;
+ NameItem *myUser (NULL);
- /// iterate ///
- while ((i = fNamesList->CurrentSelection(index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt(i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection(index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt(i));
+ targetNick = myUser->Name();
- BString command ("/dcc send ");
- command += targetNick;
+ BString command ("/dcc send ");
+ command += targetNick;
- ParseCmd (command.String());
- }
- }
- break;
+ ParseCmd (command.String());
+ }
+ }
+ break;
- case M_NAMES_POPUP_KICK:
- {
- int32 index (0);
- BString targetNick,
- kickMsg (vision_app->GetCommand (CMD_KICK));
- NameItem *myUser (NULL);
+ case M_NAMES_POPUP_KICK:
+ {
+ int32 index (0);
+ BString targetNick,
+ kickMsg (vision_app->GetCommand (CMD_KICK));
+ NameItem *myUser (NULL);
- /// iterate ///
- while ((i = fNamesList->CurrentSelection(index++)) >= 0)
- {
- myUser = static_cast<NameItem *>(fNamesList->ItemAt(i));
- targetNick = myUser->Name();
+ /// iterate ///
+ while ((i = fNamesList->CurrentSelection(index++)) >= 0)
+ {
+ myUser = static_cast<NameItem *>(fNamesList->ItemAt(i));
+ targetNick = myUser->Name();
- BString command ("/kick ");
- command += targetNick;
- command += " ";
- command += kickMsg;
+ BString command ("/kick ");
+ command += targetNick;
+ command += " ";
+ command += kickMsg;
- ParseCmd (command.String());
- }
- }
- break;
+ ParseCmd (command.String());
+ }
+ }
+ break;
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "StatusBar"
- case M_STATUS_ADDITEMS:
- {
- BString statusString;
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- 0, ""), true);
-
- statusString = B_TRANSLATE("Lag");
- statusString += ": ";
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- statusString.String(), "", STATUS_ALIGN_LEFT), true);
+ case M_STATUS_ADDITEMS:
+ {
+ BString statusString;
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ 0, ""), true);
+
+ statusString = B_TRANSLATE("Lag");
+ statusString += ": ";
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ statusString.String(), "", STATUS_ALIGN_LEFT), true);
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- 0, "", STATUS_ALIGN_LEFT), true);
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ 0, "", STATUS_ALIGN_LEFT), true);
- statusString = B_TRANSLATE("Users");
- statusString += ": ";
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- statusString.String(), ""), true);
+ statusString = B_TRANSLATE("Users");
+ statusString += ": ";
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ statusString.String(), ""), true);
- statusString = B_TRANSLATE("Ops");
- statusString += ": ";
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- statusString.String(), ""), true);
+ statusString = B_TRANSLATE("Ops");
+ statusString += ": ";
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ statusString.String(), ""), true);
- statusString = B_TRANSLATE("Modes");
- statusString += ": ";
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- statusString.String(), ""), true);
+ statusString = B_TRANSLATE("Modes");
+ statusString += ": ";
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ statusString.String(), ""), true);
- vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
- "", "", STATUS_ALIGN_LEFT), true);
+ vision_app->pClientWin()->pStatusView()->AddItem (new StatusItem (
+ "", "", STATUS_ALIGN_LEFT), true);
- // The false bool for SetItemValue() tells the StatusView not to Invalidate() the view.
- // We send true on the last SetItemValue().
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_SERVER, fServerName.String(), false);
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_LAG, fMyLag.String(), false);
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_NICK, fMyNick.String(), false);
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_MODES, fChanMode.String(), false);
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_META, FilterCrap(fTopic.String(), true).String());
+ // The false bool for SetItemValue() tells the StatusView not to Invalidate() the view.
+ // We send true on the last SetItemValue().
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_SERVER, fServerName.String(), false);
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_LAG, fMyLag.String(), false);
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_NICK, fMyNick.String(), false);
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_MODES, fChanMode.String(), false);
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_META, FilterCrap(fTopic.String(), true).String());
- BString buffer;
- buffer << fUserCount;
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String(), false);
- buffer = "";
- buffer << fOpsCount;
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String(), true);
- }
- break;
+ BString buffer;
+ buffer << fUserCount;
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_USERS, buffer.String(), false);
+ buffer = "";
+ buffer << fOpsCount;
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String(), true);
+ }
+ break;
- case M_CHANNEL_OPTIONS_SHOW:
- {
- if (fChanOpt)
- fChanOpt->Activate();
- else
- {
- fChanOpt = new ChannelOptions (fId.String(), this);
- fChanOpt->Show();
- }
- }
- break;
+ case M_CHANNEL_OPTIONS_SHOW:
+ {
+ if (fChanOpt)
+ fChanOpt->Activate();
+ else
+ {
+ fChanOpt = new ChannelOptions (fId.String(), this);
+ fChanOpt->Show();
+ }
+ }
+ break;
- case M_CHANNEL_OPTIONS_CLOSE:
- {
- fChanOpt = NULL;
- }
- break;
+ case M_CHANNEL_OPTIONS_CLOSE:
+ {
+ fChanOpt = NULL;
+ }
+ break;
- case M_CLIENT_QUIT:
- {
- if ((msg->HasBool ("vision:part") && msg->FindBool ("vision:part"))
- || (msg->HasBool ("vision:winlist") && msg->FindBool ("vision:winlist")))
- {
- BMessage send (M_SERVER_SEND);
- AddSend (&send, "PART ");
- AddSend (&send, fId);
- if (msg->HasString ("vision:partmsg"))
- {
- AddSend (&send, " :");
- AddSend (&send, msg->FindString("vision:partmsg"));
- }
- AddSend (&send, endl);
- }
- ClientAgent::MessageReceived(msg);
- }
- break;
+ case M_CLIENT_QUIT:
+ {
+ if ((msg->HasBool ("vision:part") && msg->FindBool ("vision:part"))
+ || (msg->HasBool ("vision:winlist") && msg->FindBool ("vision:winlist")))
+ {
+ BMessage send (M_SERVER_SEND);
+ AddSend (&send, "PART ");
+ AddSend (&send, fId);
+ if (msg->HasString ("vision:partmsg"))
+ {
+ AddSend (&send, " :");
+ AddSend (&send, msg->FindString("vision:partmsg"));
+ }
+ AddSend (&send, endl);
+ }
+ ClientAgent::MessageReceived(msg);
+ }
+ break;
- default:
- ClientAgent::MessageReceived (msg);
- }
+ default:
+ ClientAgent::MessageReceived (msg);
+ }
}
void
ChannelAgent::Parser (const char *buffer)
{
- /*
- * Function purpose: Send the text in {buffer} to the server
- */
-
- fLastExpansion = ""; // used by ChannelAgent::TabExpansion()
+ /*
+ * Function purpose: Send the text in {buffer} to the server
+ */
+
+ fLastExpansion = ""; // used by ChannelAgent::TabExpansion()
- BMessage send (M_SERVER_SEND);
+ BMessage send (M_SERVER_SEND);
- AddSend (&send, "PRIVMSG ");
- AddSend (&send, fId);
- AddSend (&send, " :");
+ AddSend (&send, "PRIVMSG ");
+ AddSend (&send, fId);
+ AddSend (&send, " :");
- Display ("<", C_MYNICK);
- Display (fMyNick.String(), C_NICKDISPLAY);
- Display ("> ", C_MYNICK);
-
- BString sBuffer (buffer);
-
- AddSend (&send, sBuffer.String());
- AddSend (&send, endl);
-
- Display (sBuffer.String());
- Display ("\n");
+ Display ("<", C_MYNICK);
+ Display (fMyNick.String(), C_NICKDISPLAY);
+ Display ("> ", C_MYNICK);
+
+ BString sBuffer (buffer);
+
+ AddSend (&send, sBuffer.String());
+ AddSend (&send, endl);
+
+ Display (sBuffer.String());
+ Display ("\n");
}
void
ChannelAgent::UpdateMode(char theSign, char theMode)
{
- char modeString[2]; // necessary C-style string
- memset(modeString, 0, sizeof(modeString));
- sprintf (modeString, "%c", theMode);
- BString myTemp;
-
- if (theSign == '-')
- {
- switch (theMode)
- {
- case 'l':
- {
- myTemp = fChanLimit;
- myTemp.Append (" ");
- fChanMode.RemoveLast (myTemp);
- myTemp = fChanLimit;
- myTemp.Prepend (" ");
- fChanMode.RemoveLast (myTemp);
- fChanMode.RemoveLast (fChanLimit);
- }
- break;
+ char modeString[2]; // necessary C-style string
+ memset(modeString, 0, sizeof(modeString));
+ sprintf (modeString, "%c", theMode);
+ BString myTemp;
+
+ if (theSign == '-')
+ {
+ switch (theMode)
+ {
+ case 'l':
+ {
+ myTemp = fChanLimit;
+ myTemp.Append (" ");
+ fChanMode.RemoveLast (myTemp);
+ myTemp = fChanLimit;
+ myTemp.Prepend (" ");
+ fChanMode.RemoveLast (myTemp);
+ fChanMode.RemoveLast (fChanLimit);
+ }
+ break;
- case 'k':
- {
- myTemp = fChanKey;
- myTemp.Append(" ");
- fChanMode.RemoveLast (myTemp);
- myTemp = fChanKey;
- myTemp.Prepend (" ");
- fChanMode.RemoveLast (myTemp);
- fChanMode.RemoveLast (fChanKey);
- }
- break;
- }
-
- fChanMode.RemoveFirst (modeString);
- }
- else
- {
- BString theReal (GetWord(fChanMode.String(), 1)),
- theRest (RestOfString(fChanMode.String(), 2));
- theReal.RemoveFirst(modeString);
- theReal.Append(modeString);
- BString tempString(theReal);
- if (theRest != "-9z99")
- {
- tempString += " ";
- tempString += theRest;
- }
+ case 'k':
+ {
+ myTemp = fChanKey;
+ myTemp.Append(" ");
+ fChanMode.RemoveLast (myTemp);
+ myTemp = fChanKey;
+ myTemp.Prepend (" ");
+ fChanMode.RemoveLast (myTemp);
+ fChanMode.RemoveLast (fChanKey);
+ }
+ break;
+ }
+
+ fChanMode.RemoveFirst (modeString);
+ }
+ else
+ {
+ BString theReal (GetWord(fChanMode.String(), 1)),
+ theRest (RestOfString(fChanMode.String(), 2));
+ theReal.RemoveFirst(modeString);
+ theReal.Append(modeString);
+ BString tempString(theReal);
+ if (theRest != "-9z99")
+ {
+ tempString += " ";
+ tempString += theRest;
+ }
- if (theMode == 'l')
- {
- if (fChanLimitOld != "")
- {
- BString theOld (" ");
- theOld += fChanLimitOld;
- tempString.RemoveFirst (theOld);
- }
-
- tempString.Append (" ");
- tempString.Append (fChanLimit);
- fChanLimitOld = fChanLimit;
- }
- else if (theMode == 'k')
- {
- if (fChanKeyOld != "")
- {
- BString theOld (" ");
- theOld += fChanKeyOld;
- tempString.RemoveFirst (theOld);
- }
-
- tempString.Append (" ");
- tempString.Append (fChanKey);
- fChanKeyOld = fChanKey;
- }
-
- fChanMode = tempString;
- }
+ if (theMode == 'l')
+ {
+ if (fChanLimitOld != "")
+ {
+ BString theOld (" ");
+ theOld += fChanLimitOld;
+ tempString.RemoveFirst (theOld);
+ }
+
+ tempString.Append (" ");
+ tempString.Append (fChanLimit);
+ fChanLimitOld = fChanLimit;
+ }
+ else if (theMode == 'k')
+ {
+ if (fChanKeyOld != "")
+ {
+ BString theOld (" ");
+ theOld += fChanKeyOld;
+ tempString.RemoveFirst (theOld);
+ }
+
+ tempString.Append (" ");
+ tempString.Append (fChanKey);
+ fChanKeyOld = fChanKey;
+ }
+
+ fChanMode = tempString;
+ }
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_MODES, fChanMode.String());
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_MODES, fChanMode.String());
}
void
ChannelAgent::ModeEvent (BMessage *msg)
{
- int32 modPos (0), targetPos (1);
- const char *mode (0), *target (0), *theNick (0);
- char theOperator (0);
- bool hit (false);
+ int32 modPos (0), targetPos (1);
+ const char *mode (0), *target (0), *theNick (0);
+ char theOperator (0);
+ bool hit (false);
- // TODO Change Status to bitmask -- Too hard this way
- msg->FindString ("mode", &mode);
- msg->FindString ("target", &target);
- msg->FindString ("nick", &theNick);
+ // TODO Change Status to bitmask -- Too hard this way
+ msg->FindString ("mode", &mode);
+ msg->FindString ("target", &target);
+ msg->FindString ("nick", &theNick);
- BString buffer,
- targetS (target);
+ BString buffer,
+ targetS (target);
- buffer = "*** ";
- if (targetS != "-9z99")
- {
- buffer += B_TRANSLATE("%1 set mode %2 %3");
- }
- else
- {
- buffer += B_TRANSLATE("%1 set mode %2");
- }
- buffer.ReplaceFirst("%1", theNick);
- buffer.ReplaceFirst("%2", mode);
- buffer.ReplaceFirst("%3", targetS);
- buffer += "\n";
+ buffer = "*** ";
+ if (targetS != "-9z99")
+ {
+ buffer += B_TRANSLATE("%1 set mode %2 %3");
+ }
+ else
+ {
+ buffer += B_TRANSLATE("%1 set mode %2");
+ }
+ buffer.ReplaceFirst("%1", theNick);
+ buffer.ReplaceFirst("%2", mode);
+ buffer.ReplaceFirst("%3", targetS);
+ buffer += "\n";
- BMessenger display (this);
+ BMessenger display (this);
- BMessage modeMsg (M_DISPLAY);
- PackDisplay (&modeMsg, buffer.String(), C_OP, C_BACKGROUND, F_TEXT);
- display.SendMessage (&modeMsg);
+ BMessage modeMsg (M_DISPLAY);
+ PackDisplay (&modeMsg, buffer.String(), C_OP, C_BACKGROUND, F_TEXT);
+ display.SendMessage (&modeMsg);
- // at least one
- if (mode && *mode && *(mode + 1))
- theOperator = mode[modPos++];
+ // at least one
+ if (mode && *mode && *(mode + 1))
+ theOperator = mode[modPos++];
- while (theOperator && mode[modPos])
- {
- char theModifier (mode[modPos]);
+ while (theOperator && mode[modPos])
+ {
+ char theModifier (mode[modPos]);
- if (theModifier == 'o'
- || theModifier == 'v'
- || theModifier == 'h')
- {
- BString myTarget (GetWord (target, targetPos++));
- NameItem *item;
- int32 pos;
+ if (theModifier == 'o'
+ || theModifier == 'v'
+ || theModifier == 'h')
+ {
+ BString myTarget (GetWord (target, targetPos++));
+ NameItem *item;
+ int32 pos;
- if ((pos = FindPosition (myTarget.String())) < 0
- || (item = static_cast<NameItem *>(fNamesList->ItemAt (pos))) == 0)
- {
- printf("[ERROR] Couldn't find %s in NamesView\n", myTarget.String());
- return;
- }
+ if ((pos = FindPosition (myTarget.String())) < 0
+ || (item = static_cast<NameItem *>(fNamesList->ItemAt (pos))) == 0)
+ {
+ printf("[ERROR] Couldn't find %s in NamesView\n", myTarget.String());
+ return;
+ }
- int32 iStatus (item->Status());
+ int32 iStatus (item->Status());
- if (theOperator == '+' && theModifier == 'o')
- {
- hit = true;
+ if (theOperator == '+' && theModifier == 'o')
+ {
+ hit = true;
- if ((iStatus & STATUS_OP_BIT) == 0)
- {
- item->SetStatus ((iStatus & ~STATUS_NORMAL_BIT) | STATUS_OP_BIT);
- ++fOpsCount;
+ if ((iStatus & STATUS_OP_BIT) == 0)
+ {
+ item->SetStatus ((iStatus & ~STATUS_NORMAL_BIT) | STATUS_OP_BIT);
+ ++fOpsCount;
- buffer = "";
- buffer << fOpsCount;
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
- }
- }
+ buffer = "";
+ buffer << fOpsCount;
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
+ }
+ }
- else if (theModifier == 'o')
- {
- hit = true;
+ else if (theModifier == 'o')
+ {
+ hit = true;
- if ((iStatus & STATUS_OP_BIT) != 0)
- {
- iStatus &= ~STATUS_OP_BIT;
- if ((iStatus & STATUS_VOICE_BIT) == 0)
- iStatus |= STATUS_NORMAL_BIT;
- item->SetStatus (iStatus);
- --fOpsCount;
+ if ((iStatus & STATUS_OP_BIT) != 0)
+ {
+ iStatus &= ~STATUS_OP_BIT;
+ if ((iStatus & STATUS_VOICE_BIT) == 0)
+ iStatus |= STATUS_NORMAL_BIT;
+ item->SetStatus (iStatus);
+ --fOpsCount;
- buffer = "";
- buffer << fOpsCount;
-
- if (!IsHidden())
- vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
- }
- }
+ buffer = "";
+ buffer << fOpsCount;
+
+ if (!IsHidden())
+ vision_app->pClientWin()->pStatusView()->SetItemValue (STATUS_OPS, buffer.String());
+ }
+ }
- if (theOperator == '+' && theModifier == 'v')
- {
- hit = true;
+ if (theOperator == '+' && theModifier == 'v')
+ {
+ hit = true;
- item->SetStatus ((iStatus & ~STATUS_NORMAL_BIT) | STATUS_VOICE_BIT);
- }
- else if (theModifier == 'v')
- {
- hit = true;
+ item->SetStatus ((iStatus & ~STATUS_NORMAL_BIT) | STATUS_VOICE_BIT);
+ }
+ else if (theModifier == 'v')
+ {
+ hit = true;
- iStatus &= ~STATUS_VOICE_BIT;
- if ((iStatus & STATUS_OP_BIT) == 0)
- iStatus |= STATUS_NORMAL_BIT;
- item->SetStatus (iStatus);
- }
+ iStatus &= ~STATUS_VOICE_BIT;
+ if ((iStatus & STATUS_OP_BIT) == 0)
+ iStatus |= STATUS_NORMAL_BIT;
+ item->SetStatus (iStatus);
+ }
- if (theOperator == '+' && theModifier == 'h')
- {
- hit = true;
-
- item->SetStatus ((iStatus & ~STATUS_NORMAL_BIT) | STATUS_HELPER_BIT);
- }
- else if (theModifier == 'h')
- {
- hit = true;
-
- iStatus &= ~STATUS_HELPER_BIT;
- if ((iStatus & STATUS_HELPER_BIT) == 0)
- iStatus |= STATUS_NORMAL_BIT;
- item->SetStatus (iStatus);
- }
- }
- else if (theModifier == 'l' && theOperator == '-')
- {
- BString myTarget (GetWord (target, targetPos++));
- UpdateMode ('-', 'l');
- fChanLimit = "";
- }
- else if (theModifier == 'l')
- {
- BString myTarget (GetWord (target, targetPos++));
- fChanLimitOld = fChanLimit;
- fChanLimit = myTarget;
- UpdateMode ('+', 'l');
- }
- else if (theModifier == 'k' && theOperator == '-')
- {
- UpdateMode('-', 'k');
- fChanKey = "";
- }
- else if (theModifier == 'k')
- {
- BString myTarget (GetWord (target, targetPos++));
- fChanKeyOld = fChanKey;
- fChanKey = myTarget;
- UpdateMode ('+', 'k');
- }
- else if (theModifier == 'b' || theModifier == 'a' || theModifier == 'q')
- {
- // dont do anything else
- }
- else
- {
- UpdateMode (theOperator, theModifier);
- }
+ if (theOperator == '+' && theModifier == 'h')
+ {
+ hit = true;
+
+ item->SetStatus ((iStatus & ~STATUS_NORMAL_BIT) | STATUS_HELPER_BIT);
+ }
+ else if (theModifier == 'h')
+ {
+ hit = true;
+
+ iStatus &= ~STATUS_HELPER_BIT;
+ if ((iStatus & STATUS_HELPER_BIT) == 0)
+ iStatus |= STATUS_NORMAL_BIT;
+ item->SetStatus (iStatus);
+ }
+ }
+ else if (theModifier == 'l' && theOperator == '-')
+ {
+ BString myTarget (GetWord (target, targetPos++));
+ UpdateMode ('-', 'l');
+ fChanLimit = "";
+ }
+ else if (theModifier == 'l')
+ {
+ BString myTarget (GetWord (target, targetPos++));
+ fChanLimitOld = fChanLimit;
+ fChanLimit = myTarget;
+ UpdateMode ('+', 'l');
+ }
+ else if (theModifier == 'k' && theOperator == '-')
+ {
+ UpdateMode('-', 'k');
+ fChanKey = "";
+ }
+ else if (theModifier == 'k')
+ {
+ BString myTarget (GetWord (target, targetPos++));
+ fChanKeyOld = fChanKey;
+ fChanKey = myTarget;
+ UpdateMode ('+', 'k');
+ }
+ else if (theModifier == 'b' || theModifier == 'a' || theModifier == 'q')
+ {
+ // dont do anything else
+ }
+ else
+ {
+ UpdateMode (theOperator, theModifier);
+ }
- ++modPos;
- if (mode[modPos] == '+'
- || mode[modPos] == '-')
- theOperator = mode[modPos++];
- }
+ ++modPos;
+ if (mode[modPos] == '+'
+ || mode[modPos] == '-')
+ theOperator = mode[modPos++];
+ }
- if (hit)
- {
- fNamesList->SortItems (SortNames);
- fNamesList->Invalidate();
- }
+ if (hit)
+ {
+ fNamesList->SortItems (SortNames);
+ fNamesList->Invalidate();
+ }
}
Modified: trunk/Vision/src/ChannelAgent.h
===================================================================
--- trunk/Vision/src/ChannelAgent.h 2010-06-11 03:02:39 UTC (rev 915)
+++ trunk/Vision/src/ChannelAgent.h 2010-06-14 00:18:28 UTC (rev 916)
@@ -13,14 +13,14 @@
*
* The Initial Developer of the Original Code is The Vision Team.
* Portions created by The Vision Team are
- * Copyright (C) 1999-2010 The Vision Team. All Rights
+ * Copyright (C) 1999-2010 The Vision Team. All Rights
* Reserved.
*
* Contributor(s): Wade Majors <wade@...>
- * Rene Gollent
- * Todd Lair
- * Andrew Bazan
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|