diff --git a/programs/network/ircc/gui.inc b/programs/network/ircc/gui.inc index 5daa0988e3..e68e52c40c 100644 --- a/programs/network/ircc/gui.inc +++ b/programs/network/ircc/gui.inc @@ -121,20 +121,22 @@ draw_window: ; Completely redraw the window, recalculate all coordinates and cmp [edi + window.type], WINDOWTYPE_CHANNEL jne .not_channel - ; draw a vertical separator line - ; TODO: dont draw this if we draw textbox scrollbar ?? + mov [scroll1.all_redraw], 1 + call draw_channel_list + +; draw a vertical separator line when there is no scrollbar + cmp [scroll2.all_redraw], 1 + jne .not_channel + mov ebx, [xsize] sub ebx, USERLIST_WIDTH + SCROLLBAR_WIDTH + 3 push bx shl ebx, 16 pop bx mov ecx, [ysize] - add ecx, TOP_Y SHL 16 -(BOTTOM_Y) ;;;; + add ecx, TOP_Y shl 16 - (BOTTOM_Y) mov edx, [colors.work_graph] mcall 38 - - mov [scroll1.all_redraw], 1 - call draw_channel_list .not_channel: ; draw editbox diff --git a/programs/network/ircc/ircc.asm b/programs/network/ircc/ircc.asm index e7eae9989c..6f7ca5188f 100644 --- a/programs/network/ircc/ircc.asm +++ b/programs/network/ircc/ircc.asm @@ -13,7 +13,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -version equ '0.20' +version equ '0.21' ; connection status STATUS_DISCONNECTED = 0 @@ -563,7 +563,7 @@ import boxlib,\ scrollbar_mouse,'scrollbar_v_mouse' ; width, left, top -edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_focus, 25, 25 +edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_always_focus, 25, 25 ; xsize, xpos, ysize, ypos, btn_height, max, cur, pos, bgcol, frcol, linecol scroll1 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1 scroll2 scrollbar SCROLLBAR_WIDTH, 0, 0, TOP_Y, SCROLLBAR_WIDTH, 0, 0, 0, 0, 0, 0, 1 diff --git a/programs/network/ircc/serverparser.inc b/programs/network/ircc/serverparser.inc index 62a2e1d879..8d88f47b74 100644 --- a/programs/network/ircc/serverparser.inc +++ b/programs/network/ircc/serverparser.inc @@ -257,10 +257,6 @@ cmd_privmsg: jz .fail2 pop esi call skip_parameter ; our own nickname - - cmp byte[esi], 1 ; Client to Client protocol? - je cmd_ctcp - jmp .print .channel: @@ -269,7 +265,9 @@ cmd_privmsg: jz .fail .print: -; nope, just plain old privmsg, print it using ' message' format + cmp byte[esi], 1 ; Client to Client protocol? + je cmd_ctcp + if TIMESTAMP call print_timestamp end if diff --git a/programs/network/ircc/userparser.inc b/programs/network/ircc/userparser.inc index cb24bff219..ffb987cdc2 100644 --- a/programs/network/ircc/userparser.inc +++ b/programs/network/ircc/userparser.inc @@ -117,7 +117,6 @@ user_commands: .number = ($ - user_commands) / 8 - server_command: mov eax, dword[usercommand+1] ; skip '/' @@ -126,7 +125,7 @@ server_command: mov edi, user_commands mov ecx, user_commands.number cmp [status], STATUS_CONNECTED - jne .loop + je .loop mov ecx, user_commands.number2 .loop: scasd @@ -137,6 +136,10 @@ server_command: cmp [status], STATUS_CONNECTED jne .notconnected +; Commands shorter then 3 chars are placed here + and eax, 0x00ffffff + cmp eax, 'me ' + je cmd_usr_me jmp cmd_usr_send ; If none of the previous commands, just send to server @@ -432,7 +435,6 @@ cmd_usr_part: cmd_usr_close_window: mov esi, [window_active] - mov [window_print], esi cmp [esi + window.type], WINDOWTYPE_SERVER je .not_channel @@ -540,6 +542,74 @@ cmd_usr_ctcp: +cmd_usr_me: + +; prepare a 'PRIVMSG ' + mov dword[packetbuf], 'PRIV' + mov dword[packetbuf+4], 'MSG ' + lea edi, [packetbuf+8] + +; append the destination (nickname/channel) + mov esi, [window_active] + lea esi, [esi + window.name] + @@: + lodsb + test al, al + je @f + stosb + jmp @r + @@: + +; Make the CTCP action header + mov eax, ' :' + 0x01 shl 16 + 'A' shl 24 + stosd + mov eax, 'CTIO' + stosd + mov al, 'N' + stosb + +; copy the message itself (including first space) + mov esi, usercommand+3 + @@: + lodsb + cmp al, 13 + je @f + stosb + jmp @r + @@: + +; end of CTCP message + mov al, 0x01 + stosb + mov ax, 0x0a0d + stosw + +; now send it to the server + lea esi, [edi - packetbuf] ; calculate length + mcall send, [socketnum], packetbuf, , 0 ; and finally send to server + +; print to local window + if TIMESTAMP + call print_timestamp + end if + + mov esi, action_header + call print_asciiz + + mov esi, user_nick + call print_asciiz + + mov esi, usercommand+3 + mov bl, 13 + call print_string + + mov al, 10 + call print_char + + ret + + + ; The user typed some undefined command, just recode it and send to the server cmd_usr_send: diff --git a/programs/network/ircc/users.inc b/programs/network/ircc/users.inc index 67724b9c45..955dd4f2d1 100644 --- a/programs/network/ircc/users.inc +++ b/programs/network/ircc/users.inc @@ -15,6 +15,7 @@ user_prefixes db '~&@%+ ', 0 ; in descending order +; TODO: update selected user if needed ; esi is ptr to nick ; ebx is ptr to window align 4 @@ -120,7 +121,7 @@ user_add: - +; TODO: update selected user if needed ; esi is ptr to nick ; ebx is ptr to window align 4