Recent Posts

Pages: [1] 2 3 ... 10
1
Плагины / Re: MirLua
« Last post by Oneiron on Today at 17:09:27 »
Вау... просто вау. Огромное вам спасибо! :)

UPD: Не работает на больших текстах. Маленькие кусочки отправляет без проблем, при попытке отправить сообщение размеров в 20000 символов миранда молча крашится.
2
Плагины / Re: MRA еще живой?
« Last post by SunStroke on Today at 10:52:21 »
Адекватная проверялка по IMAP не помешала бы…
Кстати, да. С одной стороны IMAP универсальный и достаточно простой механизм для реализации. Можно прикрутить куда угодно. Но с другой, у mail.ru по-моему не всё радужно с имап. Не помню уже что точно, но когда делал для корпоративных нужд мониторинг почты столкнулся с тем, кажись, что у mail.ru нельзя получить список "новых" писем - пришлось получать все и вручную выделять новые. Ну и push-уведомления теряются - придётся довольствоваться задаваемыми интервалами проверки.
3
Разработка / Re: Протокол VKontakte
« Last post by CrazyWolf on Today at 03:55:35 »
Подзагрузку починили, все работает, спасиб!
4
Плагины / Re: MirLua
« Last post by unsane on 16 10 2018, 21:51:28 »
Извиняюсь за долгий ответ, пришлось изрядно покопаться в требухах и немного допилить:
Code: [Select]
local schedule = require('m_schedule')
local srmm = require('m_srmm')
local msgs  = require('m_message')
local icolib = require('m_icolib')
local winapi  = require('winapi')

local WAIT = 2
local IDC_MESSAGE = 3012

local function split(str, limit)
    local pos = 1
    return function()
        local res = str:sub(pos, pos + limit - 1)
        if #res > 0 then
            pos = pos + #res
            return res
        end
    end
end

function get_message_area(hwnd)
    local hEdit = winapi.GetDlgItem(hwnd, IDC_MESSAGE)
    if (hEdit == nil) then
        error("unable to find message area")
    end
    return hEdit
end

function get_log_message(hwnd)
    local hEdit = get_message_area(hwnd)
    return winapi.GetWindowText(hEdit);
end

function clear_log_message(hwnd)
    local hEdit = get_message_area(hwnd)
    winapi.SetWindowText(hEdit, '');
end

function send_message_by_parts(hContact, message, limit)
    if #message <= limit then
        msgs.Send(hContact, message)
        return
    end

    local n = 1
    local first = true
    for msg in split(message, limit) do
        if first then
            msgs.Send(hContact, msg)
            first = false
        else
            schedule.Wait(WAIT * n).Seconds().Do(function()
                msgs.Send(hContact, msg)
            end)
            n = n + 1
        end
    end
end

local module = 'sendInParts'
local BBBF_ISCHATBUTTON = 16
local BBBF_ISIMBUTTON = 32
local BBBF_ISRSIDEBUTTON = 128

srmm.AddButton{
    Module = module,
    ButtonId = 1000,
    Flags = BBBF_ISCHATBUTTON | BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON,
    Tooltip = m.Translate('Send in parts of 1000 characters'),
    Icon = icolib.AddIcon(module, 'Send in parts of 1000 characters')
}

srmm.AddButton{
    Module = module,
    ButtonId = 4000,
    Flags = BBBF_ISCHATBUTTON | BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON,
    Tooltip = m.Translate('Send in parts of 4000 characters'),
    Icon = icolib.AddIcon(module, 'Send in parts of 4000 characters')
}

m.HookEvent("SRMM/ButtonsBar/ButtonPressed", function(w, l)
    local bcd = CustomButtonClickData(l)
    if bcd.Module ~= module then
        return;
    end
    local message = get_log_message(bcd.hWnd)
    send_message_by_parts(bcd.hContact, message, bcd.ButtonId)
    clear_log_message(bcd.hWnd)
end)
5
Sorry, I am slightly distracted by other activities, but I'll try to check it somewhere at weekend.
6
Feature requests / Re: Database tools
« Last post by Vulpix on 16 10 2018, 21:15:42 »
Autobackups (via the autobackup plugin) don't copy the file; they perform a copy of the database into a new profile, more or less. Autobackups work fine for me (now), but they had failed me previously (same as they are failing you now, I reckon). I think the reason they don't work for you is because they basically do an export of your profile. Since you use 32bit miranda and your profile may or may not be corrupted, the export fails. Very fatal, I know; especially because it's a feature supposed to be a failsafe against losing your data. If the failsafe is not safe, am I even real?

You can sort of see if this is the case by examining the size of the exported autobackups. If it fluctuates weirdly (like 100mb 99mb 101mb 100mb 100mb 101mb 99mb) etc.. basically not really increasing as you would expect but just being all over the place, it means the export is not working properly).

So yeah I backup manually. And JSONexports via msgexport, they have saved my skin.

As for uniqueness, yes - however, currently the code is not there for facebook, and was only recently (yesterday? :D) added to Discord. In other words, the DB supports it, and recently an method/api was added that lets plugins use it, but the support for it has yet to be coded for Facebook and other "retrieved from server" kinds of protocols.
7
Плагины / Re: MRA еще живой?
« Last post by Apollo2k4 on 16 10 2018, 20:31:36 »
Так может для этих целей нужна уведомлялка для email?
Адекватная проверялка по IMAP не помешала бы…
8
Feature requests / Re: Database tools
« Last post by riki on 16 10 2018, 20:29:47 »
I've read the thread you linked. My oh my... luckily, you are in the "backup everything every day" club. But stressful, eh?

By the way, autobackups aren't functional, either. Apparently, it's still impossible to duplicate an open database - as I'm sure you know well. The only way I found that works is closing down Miranda and copy the file via OS, then reopen Miranda. Just an additional teaspoon of stress.

2) to remove duplicate messages you can export the entire history once imported, then erase current history and import it with the "check for duplicates" mark checked. That should delete duplicates. Problem is duplicate testing is _still_ only based on timestamp so if you speak quickly you will also lose a potential nonduplicate message... so honestly...

I thought the new db driver had an index for objects that would make it possible to check for uniqueness without resorting to unreliable timestamp tests?  ???
9
Feature requests / Re: Database tools
« Last post by Vulpix on 16 10 2018, 19:50:52 »
Tools to recover DB are present in the latest miranda, they should be in miranda base dir when you update.

usage:

Code: [Select]
mdbx_dump.exe -n -a -f 1.tmp "path/to/corrupted.dat"
mdbx_load.exe -n -f 1.tmp repaired.dat
del 1.tmp

I however tried them with no success when I reproduced an issue so your mileage may wary. (see post https://forum.miranda-ng.org/index.php?topic=5552.msg22340#msg22340 )

1) Unsane is working on some sqlite implementation. However since miranda's main core was not written for SQL-like requests, it is incredibly slow. Though Unsane improved this recently. I am yet to test this improvement however, but of course without some better core rewrite the slowness is going to persist. But then obviously, sqlite is a very common format with plenty of recovery tools.

2) to remove duplicate messages you can export the entire history once imported, then erase current history and import it with the "check for duplicates" mark checked. That should delete duplicates. Problem is duplicate testing is _still_ only based on timestamp so if you speak quickly you will also lose a potential nonduplicate message... so honestly...

I know how you feel, and I wish we'd never abandoned mmap...
10
Bug reports / Re: Compact database command truncates .dat file
« Last post by Vulpix on 16 10 2018, 19:46:08 »
Yes this I encountered as well.

This happens if:

1) your db is corrupted (but this sucks because you can't easily tell since miranda looks like everything is ok
OR
2) you use 32 bit miranda and your DB is large (200-300+ MB). The compaction loads the whole profile and spits it out into a clean profile and I think the 32bit mdbx cannot map so much. The max is around 430something megabytes (not sure what the exact number is).

So unfortunately known but hard to predict when it'll happen. I've simply stopped running compaction altogether for now.

Moreover if your db is corrupted and you compact, even 64bit miranda will make it into a 1MB and bye bye data.
Pages: [1] 2 3 ... 10