aMSN Forums
May 20, 2013, 11:38:45 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Grouping incoming and outgoing messages  (Read 2299 times)
alexandernst
Developers
Super Power User
*
Offline Offline

Posts: 870



View Profile
« on: January 10, 2010, 03:09:24 am »

Hi all, I decided to try latest WLM and I really liked something that the team of WLM did. It's the grouping messages option.
This will make WLM to group the messages from the same user instead of writing in the chat window $user said: $msg every time the user sends something.

Let me show you an example:


Since download links died a few times and I really have no idea where can I upload the file, I'll just leave the code here:

GroupMessages.tcl

Code:
namespace eval ::GroupMessages {
    variable last
    proc init { dir } {
        ::plugins::RegisterPlugin GroupMessages
        ::plugins::RegisterEvent GroupMessages pre_msg_receive msgReceived
        variable last
    }

    proc deinit { } {
        ;
    }

    proc msgReceived {event evpar} {
        upvar 2 msg msg
        upvar 2 chatid chatid
        upvar 2 tmsg tmsg
        upvar 2 user user
        upvar 2 fontformat fontformat
        variable last

        if { ![info exists last($chatid)] } {
            set last($chatid) $user
        }
        if { $last($chatid) == $user } {
            ::amsn::WinWrite $chatid "\n$msg" "user" $fontformat
            set tmsg ""
            set msg ""
        } else {
            set last($chatid) $user
        }
    }
}

plugininfo.xml

Code:
<?xml version="1.0"?>
<plugin>
<name>GroupMessages</name>
<author>Alexander Nestorov (alexandernst@gmail.com)</author>
<description>Group your incoming and outgoing messages.</description>
<amsn_version>0.97</amsn_version>
<plugin_version>0.1</plugin_version>
<plugin_file>GroupMessages.tcl</plugin_file>
<plugin_namespace>GroupMessages</plugin_namespace>
<init_procedure>init</init_procedure>
<deinit_procedure>deinit</deinit_procedure>
</plugin>
« Last Edit: March 27, 2010, 06:15:55 pm by alexandernst » Logged
square87
Super Power User
**
Offline Offline

Posts: 427


View Profile
« Reply #1 on: January 10, 2010, 12:19:08 pm »

Hi.
This function is already available in aMSN 0.98.
Open a ChatWindow. View -> Style -> Compact Style.
Logged
alexandernst
Developers
Super Power User
*
Offline Offline

Posts: 870



View Profile
« Reply #2 on: January 10, 2010, 12:48:46 pm »

compact will keep saying the hour before every message, my plugin will make the CW look exactly like WLM. :p

also, compact adds an extra \n before every group of messages.
Logged
arantes
Super Power User
**
Offline Offline

Posts: 364



View Profile
« Reply #3 on: January 11, 2010, 03:33:03 am »

Yeah but writing the hour of the first message of the group then not the others is ... useless :p You can also disable totally the timestamping and the compact style is perfect then. ^^
Plus i don't like that at all, i used to disable it even in WLM, but that's my opinion.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!