Subversion Repositories Kolibri OS

Rev

Rev 1188 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1188 Rev 1315
Line 1545... Line 1545...
1545
 
1545
 
1546
 
1546
 
Line -... Line 1547...
-
 
1547
    cmp  [irc_command],'NICK'	   ; nick change
-
 
1548
    jne  no_nick_change
-
 
1549
 
-
 
1550
	add	[command_position], 6
-
 
1551
; test for change of my nick
-
 
1552
	mov	esi, command+1
-
 
1553
	mov	edi, user_nick+4
-
 
1554
	mov	ecx, [edi-4]
-
 
1555
	repz	cmpsb
-
 
1556
	jnz	.notmy
-
 
1557
	cmp	byte [esi], '!'
-
 
1558
	jnz	.notmy
-
 
1559
; yes, this is my nick, set to new
-
 
1560
	mov	esi, [command_position]
-
 
1561
	or	ecx, -1
-
 
1562
	mov	edi, esi
-
 
1563
	xor	eax, eax
-
 
1564
	repnz	scasb
-
 
1565
	not	ecx
-
 
1566
	dec	ecx
-
 
1567
	cmp	ecx, user_nick_max
-
 
1568
	jb	@f
-
 
1569
	mov	ecx, user_nick_max
-
 
1570
@@:
-
 
1571
	mov	edi, user_nick+4
-
 
1572
	mov	[edi-4], ecx
-
 
1573
	rep	movsb
-
 
1574
 
-
 
1575
	mov	edi, text+70*1+15
-
 
1576
	mov	al, ' '
-
 
1577
	mov	cl, 15
-
 
1578
	push	edi
-
 
1579
	rep	stosb
-
 
1580
	pop	edi
-
 
1581
	mov	esi, user_nick+4
-
 
1582
	mov	ecx, [esi-4]
-
 
1583
	cmp	ecx, 15
-
 
1584
	jb	@f
-
 
1585
	mov	ecx, 15
-
 
1586
@@:
-
 
1587
	rep	movsb
-
 
1588
	mov	[xpos], 0
-
 
1589
	call	draw_window
-
 
1590
.notmy:
-
 
1591
; replace nick in all lists of users
-
 
1592
	mov	ebx, I_END + 120*70
-
 
1593
.channels:
-
 
1594
	mov	esi, ebx
-
 
1595
	mov	edx, [esi-4]
-
 
1596
	add	edx, esi
-
 
1597
.nicks:
-
 
1598
	mov	edi, command+1
-
 
1599
	cmp	byte [esi], '@'
-
 
1600
	jnz	@f
-
 
1601
	inc	esi
-
 
1602
@@:
-
 
1603
	cmp	esi, edx
-
 
1604
	jae	.srcdone
-
 
1605
	lodsb
-
 
1606
	cmp	al, ' '
-
 
1607
	jz	.srcdone
-
 
1608
	scasb
-
 
1609
	jz	@b
-
 
1610
@@:
-
 
1611
	cmp	esi, edx
-
 
1612
	jae	.nextchannel
-
 
1613
	lodsb
-
 
1614
	cmp	al, ' '
-
 
1615
	jnz	@b
-
 
1616
.nextnick:
-
 
1617
	cmp	esi, edx
-
 
1618
	jae	.nextchannel
-
 
1619
	lodsb
-
 
1620
	cmp	al, ' '
-
 
1621
	jz	.nextnick
-
 
1622
	dec	esi
-
 
1623
	jmp	.nicks
-
 
1624
.srcdone:
-
 
1625
	cmp	byte [edi], '!'
-
 
1626
	jnz	.nextnick
-
 
1627
; here we have esi -> end of nick which must be replaced to [command_position]+6
-
 
1628
	lea	edx, [edi-command-1]
-
 
1629
	sub	esi, edx
-
 
1630
	or	ecx, -1
-
 
1631
	xor	eax, eax
-
 
1632
	mov	edi, [command_position]
-
 
1633
	repnz	scasb
-
 
1634
	not	ecx
-
 
1635
	dec	ecx
-
 
1636
	push	ecx
-
 
1637
	cmp	ecx, edx
-
 
1638
	jb	.decrease
-
 
1639
	jz	.copy
-
 
1640
.increase:
-
 
1641
; new nick is longer than the old
-
 
1642
	push	esi
-
 
1643
	lea	edi, [ebx+120*10]
-
 
1644
	lea	esi, [edi+edx]
-
 
1645
	sub	esi, ecx
-
 
1646
	mov	ecx, esi
-
 
1647
	sub	ecx, [esp]
-
 
1648
	dec	esi
-
 
1649
	dec	edi
-
 
1650
	std
-
 
1651
	rep	movsb
-
 
1652
	cld
-
 
1653
	pop	esi
-
 
1654
	jmp	.copy
-
 
1655
.decrease:
-
 
1656
; new nick is shorter than the old
-
 
1657
	push	esi
-
 
1658
	lea	edi, [esi+ecx]
-
 
1659
	add	esi, edx
-
 
1660
	lea	ecx, [ebx+120*10]
-
 
1661
	sub	ecx, edi
-
 
1662
	rep	movsb
-
 
1663
	pop	esi
-
 
1664
.copy:
-
 
1665
; copy nick
-
 
1666
	mov	edi, esi
-
 
1667
	dec	edi
-
 
1668
	mov	esi, [command_position]
-
 
1669
	pop	ecx
-
 
1670
	sub	edx, ecx
-
 
1671
	sub	[ebx-4], edx
-
 
1672
	rep	movsb
-
 
1673
	mov	al, ' '
-
 
1674
	stosb
-
 
1675
.nextchannel:
-
 
1676
	add	ebx, 120*80
1547
    cmp  [irc_command],'NICK'	   ; nick change
1677
	cmp	ebx, I_END + 120*70 + 120*80*19
1548
    jne  no_nick_change
1678
	jb	.channels
Line 1549... Line 1679...
1549
 
1679
 
Line 1560... Line 1690...
1560
    call print_text
1690
    call print_text
1561
    mov  eax,is_now_known_as
1691
    mov  eax,is_now_known_as
1562
    mov  dl,0
1692
    mov  dl,0
1563
    call print_text
1693
    call print_text
1564
    mov  eax,[command_position]
1694
    mov  eax,[command_position]
1565
    add  eax,6
-
 
1566
    mov  dl,0
1695
    mov  dl,0
1567
    call print_text
1696
    call print_text
1568
    call notify_channel_thread
1697
    call notify_channel_thread
Line 1569... Line 1698...
1569
 
1698